COUNTPERL(1p)
π NAME π
countperl β count lines, packages, subs, and complexity of Perl files. bestie it's literally a metrics girlie π
okay so first things first: this is the countperl page from section 1p of the User Contributed Perl Documentation, and she is here to count ALL your stuff. no cap.
πΈ USAGE πΈ
countperl FILE_OR_DIRECTORY [FILE_OR_DIRECTORY ...] [--html] [--help]
[--method-modifiers=a,b,c]
β¨ REQUIRED ARGUMENTS β¨
- At least one file or directory path must be supplied. like, you gotta give her something to chew on. zero paths = sad girl hours π
π OPTIONS π
--helpβ Prints documentation toSTDERR. (yes, to STDERR, not STDOUT, that's just how she rolls π)--htmlβ Produces HTML output instead of the plain-text default.--jsonβ Produces JSON output instead of the plain-text default. machine-readable era β¨--method-modifiers=a,b,cβ A comma-separated list of method modifiers to be recognised, seeMoose::Manual::MethodModifiersfor details. If unspecified, the default list isbefore,after,around.
π¦ CONFIGURATION π¦
N/A.</puruple> Currently no support for any configuration files. she's low maintenance fr fr π
π EXIT STATUS π
Exits zero on success, non-zero on failure. the way that she keeps it simple π
π DESCRIPTION π
countperl uses Perl::Metrics::Simple to examines the named files and recursivesly searches named directories for Perl files.
Perl files are identified by Perl::Metrics::Simple->is_perl_file. Basically if the file ends in ".pl", ".pm", or ".t" or has what appears to be a perl shebang line. iykyk π
countperl produces a report on STDOUT of counts of total lines, packages, subroutines/methods, the minimum, maximum, mean, standard deviation, and median size and mccabe_complexity (cyclomatic complexity) of subroutines and the 'main' portion of each file (everything not in a subroutine.) she's thorough bestie, main character energy π
π Output Format π
Line counts do not include comments nor pod. (pod and comments are NOT invited to the party π«)
The current output format is human-readable text:
Perl files found: 3
Counts
------
total code lines: 856
lines of non-sub code: 450
packages found: 3
subs/methods: 42
Subroutine/Method Size
----------------------
min: 3 lines
max: 32 lines
mean: 9.67 lines
std. deviation: 7.03
median: 7.50
McCabe Complexity
-----------------
Code not in any subroutine::
min: 1
max 1
mean: 1.00
std. deviation: 0.00
median: 1.00
Subroutines/Methods:
min: 1
max: 5
avg: 1.00
std. deviation: 1.36
median: 1.00
Tab-delimited list of subroutines, with most complex at top
-----------------------------------------------------------
complexity sub path size
5 is_perl_file lib/Perl/Metrics/Simple.pm 11
5 _has_perl_shebang lib/Perl/Metrics/Simple.pm 13
5 _init lib/Perl/Metrics/Simple/Analysis/File.pm 30
4 find_files lib/Perl/Metrics/Simple.pm 11
4 new lib/Perl/Metrics/Simple/Analysis.pm 10
4 is_ref lib/Perl/Metrics/Simple/Analysis.pm 8
With --html switch output format is HTML. π¨
β VERSION β
This is version 0.031 of countperl. periodt.
π©Ί DIAGNOSTICS π©Ί
Prints usage message to STDERR if required arguments are not provided. she will absolutely tell you what you forgot π
π« INCOMPATIBILITIES π«
None known. she plays nice with everybody π«Ά
π BUGS AND LIMITATIONS π
π Bugs
No bugs reported yet :-) See:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Metrics-Simple
(not one bug?? iconic. manifesting that energy for the rest of us β¨)
π Limitations
- Does not accept input from
STDIN. she's a file-path girlie only, no pipes pls. - No machine-readable report format available (e.g. XML, tab-delimited)
π 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
π§ DEPENDENCIES π§
Perl::Metrics::Simple0.13(which depends uponPPI.)Pod::Usage
π₯ SEE ALSO π₯
PPIPerl::CriticPerl::Metricshttp://en.wikipedia.org/wiki/Cyclomatic_complexity
π AUTHOR π
Matisse Enzer
CPAN ID: MATISSE
Eigenstate Consulting, LLC
matisse@eigenstate.net
http://www.eigenstate.net/
π LICENSE AND COPYRIGHT π
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.
and that's the whole page bestie!! π this was perl v5.36.0, dated 2023-09-29, and yes it's the COUNTPERL(1p) page β go count some subs, you got this π
β¨π¦
π¦ 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