Perl::Metrics::Halstead - Compute Halstead complexity metrics
version 0.0202
use Perl::Metrics::Halstead; my $pmh = Perl::Metrics::Halstead->new(file => '/some/perl/code.pl'); $pmh->dump;
Perl::Metrics::Halstead computes Halstead complexity metrics.
Perl::Metrics::Halstead
Please see the explanatory links in the "SEE ALSO" section for descriptions of what these attributes mean and how they are computed.
$file = $pmh->file;
The file to analyze. This is a required attribute.
$n_operators = $pmh->n_operators;
The total number of operators. This is a computed attribute.
$n_operands = $pmh->n_operands;
$n_distinct_operators = $pmh->n_distinct_operators;
The number of distinct operators. This is a computed attribute.
$n_distinct_operands = $pmh->n_distinct_operands;
$prog_vocab = $pmh->prog_vocab;
The program vocabulary. This is a computed attribute.
$prog_length = $pmh->prog_length;
The program length. This is a computed attribute.
$est_prog_length = $pmh->est_prog_length;
The estimated program length. This is a computed attribute.
$volume = $pmh->volume;
The program volume. This is a computed attribute.
$difficulty = $pmh->difficulty;
The program difficulty. This is a computed attribute.
$level = $pmh->level;
The program level. This is a computed attribute.
$effort = $pmh->effort;
The program effort. This is a computed attribute.
$time_to_program = $pmh->time_to_program;
The time to program. This is a computed attribute.
$delivered_bugs = $pmh->delivered_bugs;
Delivered bugs. This is a computed attribute.
$pmh = Perl::Metrics::Halstead->new(file => $file);
Create a new Perl::Metrics::Halstead object given the file argument.
Process the given file into the computed metrics.
$pmh->dump();
Print the computed metrics to STDOUT.
STDOUT
The t/01-methods.t file in this distribution.
Moo
PPI::Document
PPI::Dumper
https://en.wikipedia.org/wiki/Halstead_complexity_measures
https://www.verifysoft.com/en_halstead_metrics.html
Gene Boggs <gene@cpan.org>
This software is copyright (c) 2019 by Gene Boggs.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Perl::Metrics::Halstead, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Metrics::Halstead
CPAN shell
perl -MCPAN -e shell install Perl::Metrics::Halstead
For more information on module installation, please visit the detailed CPAN module installation guide.