---
name: "Perl::Critic::Statistics"
section: "3pm"
platform: "linux"
package: "perl-perl-critic"
version: "1.156-3"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Perl::Critic::Statistics"
---

# Perl::Critic::Statistics(3pm)

Compile stats on Perl::Critic violations.

## NAME

Perl::Critic::Statistics - Compile stats on Perl::Critic violations.

## DESCRIPTION

This class accumulates statistics on Perl::Critic violations across one or more files.  NOTE: This class is experimental and subject to change.

## INTERFACE SUPPORT

This is considered to be a non-public class.  Its interface is subject to change without notice.

## METHODS

- new()

  Create a new instance of Perl::Critic::Statistics.  No arguments are supported at this time.

- " accumulate( $doc, \\@violations ) "

  Accumulates statistics about the `$doc` and the `@violations` that were found.

- modules()

  The number of chunks of code (usually files) that have been analyzed.

- 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.

- lines\_of\_comment()

  The total number of comment lines analyzed by this Critic. This includes only lines whose first non-whitespace character is `"#"`.

- lines\_of\_data()

  The total number of lines of data section analyzed by this Critic, not counting the `"__END__"` or `"__DATA__"` line. POD in a data section is counted as POD, not data.

- lines\_of\_perl()

  The total number of lines of Perl code analyzed by this Critic. Perl appearing in the data section is not counted.

- 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.

- violations\_by\_severity()

  The number of violations of each severity found by this Critic as a reference to a hash keyed by severity.

- 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.

- total\_violations()

  The total number of violations found by this Critic.

- statements\_other\_than\_subs()

  The total number of statements minus the number of subroutines. Useful because a subroutine is considered a statement by PPI.

- average\_sub\_mccabe()

  The average McCabe score of all scanned subroutines.

- violations\_per\_file()

  The total violations divided by the number of modules.

- violations\_per\_statement()

  The total violations divided by the number statements minus subroutines.

- violations\_per\_line\_of\_code()

  The total violations divided by the lines of code.

## AUTHOR

Elliot Shank `"<perl@galumph.com>"`

## 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.
