- SEE ALSO
- COPYRIGHT AND LICENSE
Perl::Metrics::Halstead - Compute Halstead complexity metrics
use Perl::Metrics::Halstead; my $pmh = Perl::Metrics::Halstead->new(file => '/some/perl/code.pl'); my $metrics = $pmh->dump; $pmh->report;
Perl::Metrics::Halstead computes Halstead complexity metrics.
Please see the explanatory links in the "SEE ALSO" section for descriptions of what these attributes mean and how they are computed.
All attributes are calculated except for file, which is required to be given in the constructor.
$file = $pmh->file;
The file to analyze.
$n_operators = $pmh->n_operators;
The total number of operators.
$n_operands = $pmh->n_operands;
The total number of operands.
$n_distinct_operators = $pmh->n_distinct_operators;
The number of distinct operators.
$n_distinct_operands = $pmh->n_distinct_operands;
The number of distinct operands.
$prog_vocab = $pmh->prog_vocab;
The program vocabulary.
$prog_length = $pmh->prog_length;
The program length.
$est_prog_length = $pmh->est_prog_length;
The estimated program length.
$volume = $pmh->volume;
The program volume.
$difficulty = $pmh->difficulty;
The program difficulty.
$level = $pmh->level;
The program level.
$lang_level = $pmh->lang_level;
The programming language level.
$intel_content = $pmh->intel_content;
Measure of the information content of a program.
$effort = $pmh->effort;
The program effort.
$time_to_program = $pmh->time_to_program;
The time to program (in seconds).
$delivered_bugs = $pmh->delivered_bugs;
$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.
Print the computed metrics to
$metrics = $pmh->dump();
Return a hashref of the metrics and their computed values.
The t/01-methods.t file in this distribution.
Gene Boggs <firstname.lastname@example.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.