| 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
MC/DC100%1/1
$self->model->{'lines'}{$function} || 0
$self->model->{'lines'}{$function}
Truth table100%2/2
A
A= $self->model->{'lines'}{$function}
| |||||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | 10 | ▶ | return $statisticalCalculator->max() || 0; | ||||||||||
|
Condition100%2/2
$statisticalCalculator->max || 0
MC/DC100%1/1
$statisticalCalculator->max || 0
$statisticalCalculator->max
Truth table100%2/2
A
A= $statisticalCalculator->max
| |||||||||||||
| 30 | } | ||||||||||||
| 31 | |||||||||||||
| 32 | 21 | 1; | |||||||||||
| 33 | |||||||||||||