MixinFactory/NEXT.pm

filter: Statementstmt 94.4% 17 / 18 Branchbran 83.3% 5 / 6 Conditioncond 50.0% 3 / 6 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 76.3% 29 / 38 CC 6 SCAR 16.0
CC
6
Cov
83%
NEXT
6.3
BEGIN
1.0
BEGIN
1.0
CRAP 4.9
« MixinFactory/Factory.pm ↑ Summary MixinFactory.pm »
1 package Class::MixinFactory::NEXT;
2  
3 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 ########################################################################
6  
7 116 ▶sub NEXT {
Subroutine NEXT: called CC=6 SCAR=18.3
Pod undocumented
8 116 my ( $self, $method, @args ) = @_;
9
10 116 my $package = caller();
11 116 ▶ my @classes = ref($self) || $self;
Condition33%1/3
ref $self || $self
l!l&&r!l&&!r
01160
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table33%1/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
12
13 116 my $found_current = 0;
14 116 ▶ while ( my $class = shift @classes ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $class = shift @classes) 406 0 406
15 406 ▶ if ( $class eq $package ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($class eq $package) { } 116 290 406
elsif ($found_current and my $sub = $class->can($method)) { } 116 348 464
16 116 $found_current = 1
17 ▶ } elsif ( $found_current and my $sub = $class->can( $method ) ) {
Condition66%2/3
$found_current and my $sub = $class->can($method)
!ll&&!rl&&r
1740116
MC/DC50%1/2
$found_current and my $sub = $class->can($method)
$found_current my $sub = $class->can($method)
Truth table66%2/3
A and B
A= $found_currentB= my $sub = $class->can($method)
ABresult
0X0
100
111
18 116 return &$sub( $self, @args );
19 }
20 8 ▶ no strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 290 unshift @classes, @{ $class . "::ISA" };
22 }
23 0 Carp::croak( "Can't find NEXT method for $method" );
24 }
25  
26 ########################################################################
27  
28 8 1;
29  
30 __END__
« MixinFactory/Factory.pm ↑ Summary MixinFactory.pm »