Perl::Metrics2::Plugin::Core - The Core Perl Metrics Package
This class provides a set of core metrics for Perl documents, based on very simple code using only the core PPI package.
As with all Perl::Metrics::Plugin packages, all metrics can be referenced with the global identifier Perl::Metrics::Plugin::Core::metric.
Perl::Metrics::Plugin::Core::metric
Metrics are listed as "datatype name".
The bytes metric represents the number of bytes in the file.
bytes
The lines metric represents the number of raw lines in the file.
lines
The sloc metric represents Source Lines of Code. That is, raw lines minus __END__ content, __DATA__ content, POD, comments and blank lines.
sloc
The tokens metric represents the total number of PPI::Token objects contained in the document.
tokens
For example, the following one-line document would have a tokens metric of 5 (assuming a single trailing newline)
print "Hello World!\n";
The significant_tokens metric represents the total number of significant tokens contained in the document.
significant_tokens
significant
This filters out things like whitespace and comments, and refers (more or less) to only the parts of the document that actually do something.
For more information on significance, see "significant" in PPI::Element.
Bugs should be reported via the CPAN bug tracker at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Metrics2
For other issues, contact the author.
Adam Kennedy <adamk@cpan.org>
Perl::Metrics::Plugin, Perl::Metrics, PPI
Copyright 2009 Adam Kennedy.
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.
To install Perl::Metrics2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Metrics2
CPAN shell
perl -MCPAN -e shell install Perl::Metrics2
For more information on module installation, please visit the detailed CPAN module installation guide.