Analizo/Metric/MaximumMethodLinesOfCode.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond 100% 4 / 4 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 6 / 6 Podpod 33.3% 1 / 3 totaltotal 94.2% 33 / 35 CC 4 SCAR 8.5
CC
4
Cov
100%
calculate
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.3
« Analizo/Filter/Client.pm ↑ Summary Analizo/Metric/AverageMethodLinesOfCode.pm »
1 package Analizo::Metric::MaximumMethodLinesOfCode;
2 21 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 21 ▶use parent qw(Class::Accessor::Fast Analizo::ModuleMetric);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 21 ▶use Statistics::Descriptive;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 21 __PACKAGE__->mk_accessors(qw( model ));
7  
8 15 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
9 15 my ($package, %args) = @_;
10 my @instance_variables = (
11 model => $args{model}
12 15 );
13 15 return bless { @instance_variables }, $package;
14 }
15  
16 4 ▶sub description {
Subroutine description: called CC=1 SCAR=0.0
Pod undocumented
17 4 return "Max Method LOC";
18 }
19  
20 10 ▶sub calculate {
Subroutine calculate: called CC=4 SCAR=13.9
Pod undocumented
21 10 my ($self, $module) = @_;
22  
23 10 my $statisticalCalculator = Statistics::Descriptive::Full->new();
24  
25 10 for my $function ($self->model->functions($module)) {
26 14 ▶ $statisticalCalculator->add_data($self->model->{lines}->{$function} || 0);
Condition100%2/2
$self->model->{'lines'}{$function} || 0
l!l
59
MC/DC100%1/1
$self->model->{'lines'}{$function} || 0
$self->model->{'lines'}{$function}
Truth table100%2/2
A
A= $self->model->{'lines'}{$function}
Aresult
11
00
27 }
28  
29 10 ▶ return $statisticalCalculator->max() || 0;
Condition100%2/2
$statisticalCalculator->max || 0
l!l
37
MC/DC100%1/1
$statisticalCalculator->max || 0
$statisticalCalculator->max
Truth table100%2/2
A
A= $statisticalCalculator->max
Aresult
11
00
30 }
31  
32 21 1;
33  
« Analizo/Filter/Client.pm ↑ Summary Analizo/Metric/AverageMethodLinesOfCode.pm »