logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Perl::Metrics::Simple::Analysis - Contains anaylsis results.

Author

           Matisse Enzer
           CPAN ID: MATISSE
           Eigenstate Consulting, LLC
           matisse@eigenstate.nethttp://www.eigenstate.net/

Bugs And Limitations

       None reported yet ;-)

Dependencies

       Readonly
       Statistics::Basic

Description

Name

       Perl::Metrics::Simple::Analysis - Contains anaylsis results.

See Also

perl(1).

perl v5.36.0                                       2023-09-29               Perl::Metrics::Simple::Analysis(3pm)

Static Package Subroutines

       Utility subs used internally, but no harm in exposing them for now.  Call these with a fully-qualified
       package name, e.g.

         Perl::Metrics::Simple::Analysis::is_ref($thing,'ARRAY')

   is_ref
       Takes a thing and a type. Returns true is thing is a reference of type type, otherwise returns false.

Support

       Via CPAN:

   DisussionForumhttp://www.cpanforum.com/dist/Perl-Metrics-SimpleBugReportshttp://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Metrics-Simple

Synopsis

       This is the class of objects returned by the analyze_files method of the Perl::Metrics::Simple class.

       Normally you would not create objects of this class directly, instead you get them by calling the
       analyze_files method on a Perl::Metrics::Simple object.

Usage

new
         $analysis = Perl::Metrics::Simple::Analsys->new( \@file_objects )

       Takes an arrayref of Perl::Metrics::Simple::Analysis::File objects and returns a new
       Perl::Metrics::Simple::Analysis object.

   data
       The raw data for the analysis. This is the arrayref you passed as the argument to new();

   files
       Arrayref of file paths, in the order they were encountered.

   file_count
       How many Perl files were found.

   lines
       Total lines in all files, excluding comments and pod.

   main_stats
       Returns a hashref of data based the main code in all files, that is, on the code minus all named
       subroutines.

         {
           lines             => 723,
           mccabe_complexity => 45
         }

   file_stats
       Returns an arrayref of hashrefs, each entry is for one analyzed file, in the order they were encountered.
       The main_stats slot in the hashref is for all the code in the file outsideof any named subroutines.

          [
             {
               path => '/path/to/file',
               main_stats => {
                               lines             => 23,
                               mccabe_complexity => 3,
                               path              => '/path/to/file',
                               name              => '{code not in named subroutines}',
                              },
               },
               ...
          ]

   packages
       Arrayref of unique packages found in code.

   package_count
       How many unique packages found.

   subs
       Array ref containing hashrefs of all named subroutines, in the order encounted.

       Each hashref has the structure:

           {
                'lines' => 19,
                'mccabe_complexity' => 6,
                'name' => 'databaseRecords',
                'path' => '../path/to/File.pm',
           }

   sub_count
       How many subroutines found.

   summary_stats
       Returns a data structure of the summary counts for all the files examined:

           {
               sub_length      => {
                   min           => $min_sub_length,
                   max           => $max_sub_length,
                   sorted_values => \@lengths_of_all_subs,
                   mean          => $average_sub_length,
                   median        => $median_sub_length,
                   standard_deviation => $std_dev_for_sub_lengths,
                },
               sub_complexity  => {
                   min           => $min_sub_complexity,
                   max           => $max_sub_complexity,
                   sorted_values => \@complexities_of_all_subs,
                   mean          => $average_sub_complexity,
                   median        => $median_sub_complexity,
                   standard_deviation => $std_dev_for_sub_complexity,
               },
               main_complexity => {
                   min           => $min_main_complexity,
                   max           => $max_main_complexity,
                   sorted_values => \@complexities_of_all_subs,
                   mean          => $average_main_complexity,
                   median        => $median_main_complexity,
                   standard_deviation => $std_dev_for_main_complexity,
               },
           }

Version

       This is VERSION 0.1

See Also