1COUNTPERL(1)          User Contributed Perl Documentation         COUNTPERL(1)
2
3
4

NAME

6       countperl - count lines, packages, subs and complexity of Perl files.
7

USAGE

9       countperl FILE_OR_DIRECTORY [FILE_OR_DIRECTORY ...] [--html] [--help]
10       [--method-modifiers=a,b,c]
11

REQUIRED ARGUMENTS

13       At least one file or directory path must be supplied.
14

OPTIONS

16       --help
17           Prints documentation to STDERR.
18
19       --html
20           Produces HTML output instead of the plain-text default.
21
22       --json
23           Produces JSON output instead of the plain-text default.
24
25       --method-modifiers=a,b,c
26           A comma-separated list of method modifiers to be recognised, see
27           Moose::Manual::MethodModifiers for details. If unspecified, the
28           default list is before,after,around.
29

CONFIGURATION

31       N/A. Currently no support for any configuration files.
32

EXIT STATUS

34       Exits zero on success, non-zero on failure.
35

DESCRIPTION

37       countperl uses Perl::Metrics::Simple to examines the named files and
38       recursivesly searches named directories for Perl files.
39
40       Perl files are identified by Perl::Metrics::Simple->is_perl_file.
41       Basically if the file ends in ".pl", ".pm", or ".t" or has what appears
42       to be a perl shebang line.
43
44       countperl produces a report on STDOUT of counts of total lines,
45       packages, subroutines/methods, the minimum, maximum, mean, standard
46       deviation, and median size and mccabe_complexity (cyclomatic
47       complexity) of subroutines and the 'main' portion of each file
48       (everything not in a subroutine.)
49
50   Output Format
51       Line counts do not include comments nor pod.
52
53       The current output format is human-readable text:
54
55           Perl files found:                3
56
57           Counts
58           ------
59           total code lines:       856
60           lines of non-sub code:  450
61           packages found:           3
62           subs/methods:            42
63
64           Subroutine/Method Size
65           ----------------------
66           min:                  3 lines
67           max:                  32 lines
68           mean:                 9.67 lines
69           std. deviation:       7.03
70           median:               7.50
71
72           McCabe Complexity
73           -----------------
74           Code not in any subroutine::
75           min:                  1
76           max                   1
77           mean:                 1.00
78           std. deviation:       0.00
79           median:               1.00
80
81           Subroutines/Methods:
82           min:                  1
83           max:                  5
84           avg:                  1.00
85           std. deviation:       1.36
86           median:               1.00
87
88           Tab-delimited list of subroutines, with most complex at top
89           -----------------------------------------------------------
90           complexity      sub     path    size
91           5       is_perl_file    lib/Perl/Metrics/Simple.pm      11
92           5       _has_perl_shebang       lib/Perl/Metrics/Simple.pm      13
93           5       _init   lib/Perl/Metrics/Simple/Analysis/File.pm        30
94           4       find_files      lib/Perl/Metrics/Simple.pm      11
95           4       new     lib/Perl/Metrics/Simple/Analysis.pm     10
96           4       is_ref  lib/Perl/Metrics/Simple/Analysis.pm     8
97
98       With --html switch output format is HTML.
99

VERSION

101       This is version 0.031 of countperl.
102

DIAGNOSTICS

104       Prints usage message to STDERR if required arguments are not provided.
105

INCOMPATIBILITIES

107       None known.
108

BUGS AND LIMITATIONS

110   Bugs No bugs reported yet :-) See:
111       http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Metrics-Simple
112   Limitations
113       Does not accept input from STDIN.
114       No machine-readable report format available (e.g. XML, tab-delimited)
115

SUPPORT

117       Via CPAN:
118
119   Disussion Forum
120       http://www.cpanforum.com/dist/Perl-Metrics-Simple
121
122   Bug Reports
123       http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Metrics-Simple
124

DEPENDENCIES

126       Perl::Metrics::Simple 0.13 (which depends upon PPI.)
127       Pod::Usage
128

SEE ALSO

130       PPI
131       Perl::Critic
132       Perl::Metrics
133       http://en.wikipedia.org/wiki/Cyclomatic_complexity
134

AUTHOR

136           Matisse Enzer
137           CPAN ID: MATISSE
138           Eigenstate Consulting, LLC
139           matisse@eigenstate.net
140           http://www.eigenstate.net/
141
143       This program is free software; you can redistribute it and/or modify it
144       under the same terms as Perl itself.
145
146       The full text of the license can be found in the LICENSE file included
147       with this module.
148
149
150
151perl v5.36.0                      2022-07-22                      COUNTPERL(1)
Impressum