Perl::...istics(3pm)
๐ NAME ๐
okay so bestie, welcome to Perl::Critic::Statistics โ it's the 3pm manual page, and it's literally the class that compiles stats on your Perl::Critic violations. no cap, it's giving "spreadsheet but make it cute" ๐
โจ DESCRIPTION โจ
so this class is the one that accumulates statistics on Perl::Critic violations across one or more files. it's the friend who's keeping notes on everybody. ๐
๐ซถ heads up bestie: this class is experimental and subject to change. like, it's still figuring itself out. we love a journey.
๐ฆ INTERFACE SUPPORT ๐ฆ
okay so this is considered a non-public class. its interface is subject to change without notice. it's giving private account energy โ you can look, but don't get too attached. ๐
๐ธ METHODS ๐ธ
new()โ creates a new instance ofPerl::Critic::Statistics. no arguments are supported at this time, so don't come at it with extras. it's a simple queen. ๐accumulate( $doc, \@violations )โ accumulates statistics about the$docand the@violationsthat were found. it's literally gathering the receipts. ๐งพmodules()โ the number of chunks of code (usually files) that have been analyzed. yeah, "usually files" โ they said what they said. ๐subs()โ the total number of subroutines analyzed by this Critic.statements()โ the total number of statements analyzed by this Critic.lines()โ the total number of lines of code analyzed by this Critic.lines_of_blank()โ the total number of blank lines analyzed by this Critic. this includes only blank lines in code, not POD or data. so don't be counting your vibes as code. ๐lines_of_comment()โ the total number of comment lines analyzed by this Critic. this includes only lines whose first non-whitespace character is#. yes, the hashtag matters. โจlines_of_data()โ the total number of lines of data section analyzed by this Critic, not counting the__END__or__DATA__line. and POD in a data section is counted as POD, not data. the category police have spoken. ๐จlines_of_perl()โ the total number of lines of Perl code analyzed by this Critic. Perl appearing in the data section is not counted. sorry to that Perl, different section, different rules. ๐ญlines_of_pod()โ the total number of lines of POD analyzed by this Critic. Pod occurring in a data section is counted as POD, not as data. consistent behavior, we love to see it. ๐violations_by_severity()โ the number of violations of each severity found by this Critic, as a reference to a hash keyed by severity. hash girlies rise. ๐ฅviolations_by_policy()โ the number of violations of each policy found by this Critic, as a reference to a hash keyed by full policy name. full name only, no nicknames. ๐total_violations()โ the total number of violations found by this Critic. the final boss number. ๐statements_other_than_subs()โ the total number of statements minus the number of subroutines. useful because a subroutine is considered a statement by PPI. like, PPI really said "a sub is a statement" and we just have to live with that. ๐ญaverage_sub_mccabe()โ the average McCabe score of all scanned subroutines. complexity check, bestie. ๐violations_per_file()โ the total violations divided by the number of modules. math slay. โจviolations_per_statement()โ the total violations divided by the number statements minus subroutines. (yes, that's how it's written โ statements minus subs.) ๐งฎviolations_per_line_of_code()โ the total violations divided by the lines of code. ๐
๐ AUTHOR ๐
Elliot Shank <perl@galumph.com> โ icon, legend, the moment. ๐
๐ COPYRIGHT ๐
Copyright (c) 2007-2011 Elliot Shank.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. ๐
and that's the whole page, bestie ๐ซถ this was User Contributed Perl Documentation, version perl v5.42.0, dated 2024-10-23 โ see you in the next Perl::...istics(3pm), mwah ๐๐ธ
๐ฆ where this page comes from
- opensuse-leap 16.0: perl-Perl-Critic 1.156.0-bp160.1.1 ยท Artistic-1.0 OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms