Phylo/Util/OptionalInterface.pm

filter: Statementstmt 91.6% 22 / 24 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 90.3% 28 / 31 CC 3 SCAR 6.5
CC
3
Cov
88%
import
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« Phylo/Matrices/Characters.pm ↑ Summary Phylo/Set.pm »
1 package Bio::Phylo::Util::OptionalInterface;
2 46 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 46 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 46 ▶use Bio::Phylo::Util::CONSTANT 'looks_like_class';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 46 ▶use Bio::Phylo::Util::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 46 my $logger = Bio::Phylo::Util::Logger->new;
7  
8 94 ▶sub import {
Subroutine import: called CC=3 SCAR=11.4
9 94 my $class = shift;
10 94 my ($caller) = caller;
11 94 for my $iface (@_) {
12 94 eval { looks_like_class $iface };
13 94 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) { } 94 0 94
14 94 $logger->info("Couldn't load optional interface $iface");
15 94 undef($@);
16 }
17 else {
18 0 eval "push \@${caller}::ISA, '$iface'";
19 0 $logger->info("Added interface $iface to $caller");
20 }
21 }
22 }
23 46 1;
24 __END__
« Phylo/Matrices/Characters.pm ↑ Summary Phylo/Set.pm »