1Perl::Critic::StatisticUss(e3r)Contributed Perl DocumentPaetrilo:n:Critic::Statistics(3)
2
3
4
6 Perl::Critic::Statistics - Compile stats on Perl::Critic violations.
7
9 This class accumulates statistics on Perl::Critic violations across one
10 or more files. NOTE: This class is experimental and subject to change.
11
13 This is considered to be a non-public class. Its interface is subject
14 to change without notice.
15
17 "new()"
18 Create a new instance of Perl::Critic::Statistics. No arguments
19 are supported at this time.
20
21 " accumulate( $doc, \@violations ) "
22 Accumulates statistics about the $doc and the @violations that were
23 found.
24
25 "modules()"
26 The number of chunks of code (usually files) that have been
27 analyzed.
28
29 "subs()"
30 The total number of subroutines analyzed by this Critic.
31
32 "statements()"
33 The total number of statements analyzed by this Critic.
34
35 "lines()"
36 The total number of lines of code analyzed by this Critic.
37
38 "lines_of_blank()"
39 The total number of blank lines analyzed by this Critic. This
40 includes only blank lines in code, not POD or data.
41
42 "lines_of_comment()"
43 The total number of comment lines analyzed by this Critic. This
44 includes only lines whose first non-whitespace character is "#".
45
46 "lines_of_data()"
47 The total number of lines of data section analyzed by this Critic,
48 not counting the "__END__" or "__DATA__" line. POD in a data
49 section is counted as POD, not data.
50
51 "lines_of_perl()"
52 The total number of lines of Perl code analyzed by this Critic.
53 Perl appearing in the data section is not counted.
54
55 "lines_of_pod()"
56 The total number of lines of POD analyzed by this Critic. Pod
57 occurring in a data section is counted as POD, not as data.
58
59 "violations_by_severity()"
60 The number of violations of each severity found by this Critic as a
61 reference to a hash keyed by severity.
62
63 "violations_by_policy()"
64 The number of violations of each policy found by this Critic as a
65 reference to a hash keyed by full policy name.
66
67 "total_violations()"
68 The total number of violations found by this Critic.
69
70 "statements_other_than_subs()"
71 The total number of statements minus the number of subroutines.
72 Useful because a subroutine is considered a statement by PPI.
73
74 "average_sub_mccabe()"
75 The average McCabe score of all scanned subroutines.
76
77 "violations_per_file()"
78 The total violations divided by the number of modules.
79
80 "violations_per_statement()"
81 The total violations divided by the number statements minus
82 subroutines.
83
84 "violations_per_line_of_code()"
85 The total violations divided by the lines of code.
86
88 Elliot Shank "<perl@galumph.com>"
89
91 Copyright (c) 2007-2011 Elliot Shank.
92
93 This program is free software; you can redistribute it and/or modify it
94 under the same terms as Perl itself. The full text of this license can
95 be found in the LICENSE file included with this module.
96
97
98
99perl v5.34.0 2021-07-22 Perl::Critic::Statistics(3)