Perl::...nalysis(3pm)
π NAME π
Bestie, welcome to the Perl::...nalysis(3pm) page β part of the User Contributed Perl Documentation, no less. π
So what is this? It's Perl::Metrics::Simple::Analysis β and it contains anaylsis results. (Yes, the typo is canon, we're keeping it, it's iconic π
)
β¨ SYNOPSIS β¨
Okay so listen. This is the class of objects that the analyze_files method of the Perl::Metrics::Simple class hands back to you. That's the whole vibe. π¦
Normally you would not create objects of this class directly β like, why would you β instead you get them by calling the analyze_files method on a Perl::Metrics::Simple object. That's the move. Periodt. π
πΈ VERSION πΈ
This is VERSION 0.1 β¨
π DESCRIPTION π
Not me leaving this section literally empty π the original page just puts the heading here and skips straight to USAGE. Faithful reproduction, we don't invent content in this house. π
π«Ά USAGE π«Ά
π new
$analysis = Perl::Metrics::Simple::Analsys->new( \@file_objects )
Takes an arrayref of Perl::Metrics::Simple::Analysis::File objects and returns a brand new Perl::Metrics::Simple::Analysis object. Slay. π
π data
The raw data for the analysis. This is literally the arrayref you passed as the argument to new(). The way it just... holds your data. Obsessed. π
π files
Arrayref of file paths, in the order they were encountered. π¦
π file_count
How many Perl files were found. Counting era. π₯
π lines
Total lines in all files, excluding comments and pod. So like, the real ones only. π
π 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 outside of 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. Only the uniques, bestie. π
π 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,
},
}
β STATIC PACKAGE SUBROUTINES β
Utility subs used internally, but no harm in exposing them for now. Lowkey generous of them tbh. π
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. Vibe check, but for references. π¦
π BUGS AND LIMITATIONS π
None reported yet ;-) Not a single one. The confidence is immaculate. πβ¨
π DEPENDENCIES π
ReadonlyStatistics::Basic
π SUPPORT π
Via CPAN: πΈ
π Disussion Forum
http://www.cpanforum.com/dist/Perl-Metrics-Simple
π Bug Reports
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Metrics-Simple
π AUTHOR π
Matisse Enzer
CPAN ID: MATISSE
Eigenstate Consulting, LLC
matisse@eigenstate.net
http://www.eigenstate.net/
Shoutout to the author, we love a legend. π«Ά
πΈ LICENSE AND COPYRIGHT πΈ
Copyright (c) 2006-2021 by Eigenstate Consulting, LLC.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module. π
π¦ SEE ALSO π¦
And that's the whole page, bestie β this was perl v5.36.0, dated 2023-09-29, and honestly? Iconic. Go analyze some files, you main character. π
β¨π«Ά
π¦ where this page comes from
- debian trixie: libperl-metrics-simple-perl 1.0.3-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libperl-metrics-simple-perl 1.0.3-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libperl-metrics-simple-perl 1.0.3-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libperl-metrics-simple-perl 1.0.3-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms