NAME
countperl - count lines, packages, subs, and complexity of Perl files.
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.
OPTIONS
- --help
-
Prints documentation to STDERR.
- --html
-
Produces HTML output instead of the plain-text default.
- --json
-
Produces JSON output instead of the plain-text default.
- --method-modifiers=a,b,c
-
A comma-separated list of method modifiers to be recognised, see Moose::Manual::MethodModifiers for details. If unspecified, the default list is before,after,around.
CONFIGURATION
N/A. Currently no support for any configuration files.
EXIT STATUS
Exits zero on success, non-zero on failure.
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.
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.)
Output Format
Line counts do not include comments nor pod.
The current output format is human-readable text:
Perl files found: 3Counts------total code lines: 856lines of non-sub code: 450packages found: 3subs/methods: 42Subroutine/Method Size----------------------min: 3 linesmax: 32 linesmean: 9.67 linesstd. deviation: 7.03median: 7.50McCabe Complexity-----------------Code not in any subroutine::min: 1max 1mean: 1.00std. deviation: 0.00median: 1.00Subroutines/Methods:min: 1max: 5avg: 1.00std. deviation: 1.36median: 1.00Tab-delimited list of subroutines, with most complex at top-----------------------------------------------------------complexity sub path size5 is_perl_file lib/Perl/Metrics/Simple.pm 115 _has_perl_shebang lib/Perl/Metrics/Simple.pm 135 _init lib/Perl/Metrics/Simple/Analysis/File.pm 304 find_files lib/Perl/Metrics/Simple.pm 114 new lib/Perl/Metrics/Simple/Analysis.pm 104 is_ref lib/Perl/Metrics/Simple/Analysis.pm 8
With --html switch output format is HTML.
VERSION
This is version 0.031 of countperl.
DIAGNOSTICS
Prints usage message to STDERR if required arguments are not provided.
INCOMPATIBILITIES
None known.
BUGS AND LIMITATIONS
Bugs No bugs reported yet :-) See: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Metrics-Simple
Limitations
- Does not accept input from STDIN.
- 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::Simple 0.13 (which depends upon PPI.)
- Pod::Usage
SEE ALSO
- PPI
- Perl::Critic
- Perl::Metrics
- http://en.wikipedia.org/wiki/Cyclomatic_complexity
AUTHOR
Matisse EnzerCPAN ID: MATISSEEigenstate Consulting, LLC[email protected]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.