| 1 | package Analizo::ModuleMetric; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 4 | 1 | return bless { cache => {} }, __PACKAGE__; | |||||||||
| 5 | } | ||||||||||
| 6 | |||||||||||
| 7 | 132 | ▶ | sub value { | ||||||||
|
Subroutine
value: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 8 | 132 | my ($self, $module) = @_; | |||||||||
| 9 | 132 | ▶ | if (!defined $self->{cache}->{$module}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 10 | 117 | $self->{cache}->{$module} = $self->calculate($module); | |||||||||
| 11 | } | ||||||||||
| 12 | 132 | my $value = $self->{cache}->{$module}; | |||||||||
| 13 | 132 | return $value; | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | sub calculate { | ||||||||
|
Subroutine
calculate: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 17 | 0 | die("Not implemented. Override in subclasses"); | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 39 | 1; | |||||||||