lib/Algorithm/Evolutionary.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 35 / 35 CC 4 SCAR 6.2
CC
4
Cov
100%
import
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« blib/script/tide_float.pl ↑ Summary lib/Algorithm/Evolutionary/Fitness/MMDP.pm »
1 package Algorithm::Evolutionary;
2  
3 21 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 15 our $VERSION = '0.82.1'; # Later than 1st GitHub version
6  
7 # Preloaded methods go here.
8  
9 # A bit of importing magic taken from POE
10 19 ▶sub import {
Subroutine import: called CC=4 SCAR=13.9
11 19 my $self = shift;
12  
13 17 my @modules = grep(!/^(Op|Indi|Fitness)$/, @_);
14  
15 17 my $package = caller();
16 18 my @failed;
17  
18 # Load all the others.
19 17 foreach my $module (@modules) {
20 61 my $code = "package $package; use Algorithm::Evolutionary::$module;";
21 # warn $code;
22 21 ▶ eval($code);
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
23 61 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 45 16 61
24 45 warn $@;
25 45 push(@failed, $module);
26 }
27 }
28  
29 17 ▶ @failed and croak "could not import qw(" . join(' ', @failed) . ")";
Branch: 1 branch
BranchTrueFalseTotal
@failed and croak('could not import qw(' . join(" ", @failed) . ')') 16 1 17
30 }
31  
32 15 1;
33 __END__
« blib/script/tide_float.pl ↑ Summary lib/Algorithm/Evolutionary/Fitness/MMDP.pm »