blib/lib/YATT/Lite/Partial/MarkAfterNew.pm

filter: Statementstmt 95.6% 44 / 46 Branchbran 62.5% 5 / 8 Conditioncond 36.3% 4 / 11 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 100% 11 / 11 Podpod 0.0% 0 / 3 totaltotal 76.1% 64 / 84 CC 9 SCAR 13.5
CC
9
Cov
82%
import
8.7
declare_as_base
3.0
BEGIN
2.0
CRAP 3.9
« blib/lib/YATT/Lite/ConnectionProxy.pm ↑ Summary blib/lib/YATT/Lite/Site/Registry.pm »
1 package YATT::Lite::Partial::MarkAfterNew;
2 80 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 80 ▶use warnings qw(FATAL all NONFATAL misc);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 80 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 80 ▶use mro 'c3';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 80 ▶use YATT::Lite::MFields qw/__after_new_is_called__/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 sub MY () {__PACKAGE__}
8 80 ▶use YATT::Lite::Util qw/globref/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 80 ▶use constant DEBUG => $ENV{DEBUG_YATT_IMPORT} // 0;
Subroutine BEGIN: called CC=2 SCAR=7.1
Condition50%1/2
$ENV{"DEBUG_YATT_IMPORT"} // 0
l!l
080
MC/DC0%0/1
$ENV{"DEBUG_YATT_IMPORT"} // 0
$ENV{"DEBUG_YATT_IMPORT"}
Truth table50%1/2
A
A= $ENV{"DEBUG_YATT_IMPORT"}
Aresult
11
00
11  
12 #========================================
13  
14 534 ▶sub after_new {
Subroutine after_new: called CC=1 SCAR=0.0
Pod undocumented
15 534 (my MY $self) = @_;
16 534 $self->{__after_new_is_called__} = 1;
17 534 &maybe::next::method;
18 }
19  
20 282 ▶sub after_new_is_called {
Subroutine after_new_is_called: called CC=1 SCAR=0.0
Pod undocumented
21 282 (my MY $self) = @_;
22 282 $self->{__after_new_is_called__};
23 }
24  
25 #========================================
26 # XXX: use YATT::Lite::Util::AsBase qw/-as_base import/; was not ok...
27  
28 154 ▶sub import {
Subroutine import: called CC=6 SCAR=21.6
29 154 my ($pack, @args) = @_;
30 154 ▶ return unless @args;
Branch: 1 branch
BranchTrueFalseTotal
unless @args 1 153 154
31 153 ▶ if (@args == 1 and $args[0] and $args[0] =~ /^-(\w+)/
Branch: 1 branch
BranchTrueFalseTotal
if (@args == 1 and $args[0] and $args[0] =~ /^-(\w+)/ and my $sub = $pack->can("declare_$1")) { } 153 0 153
Condition33%3/9
@args == 1 and $args[0] and $args[0] =~ /^-(\w+)/ and my $sub = $pack->can("declare_$1")
!ll&&!rl&&r
00153
@args == 1 and $args[0] and $args[0] =~ /^-(\w+)/
!ll&&!rl&&r
00153
@args == 1 and $args[0]
!ll&&!rl&&r
00153
MC/DC0%0/4
@args == 1 and $args[0] and $args[0] =~ /^-(\w+)/ and my $sub = $pack->can("declare_$1")
@args == 1 $args[0] $args[0] =~ /^-(\w+)/ my $sub = $pack->can("declare_$1")
Truth table20%1/5
A and B and C and D
A= @args == 1B= $args[0]C= $args[0] =~ /^-(\w+)/D= my $sub = $pack->can("declare_$1")
ABCDresult
0XXX0
10XX0
110X0
11100
11111
32 and my $sub = $pack->can("declare_$1")) {
33 153 my $callpack = caller;
34 153 $sub->($pack, $callpack);
35 } else {
36 0 Carp::croak("Invalid use spec: ", @args);
37 }
38 }
39  
40 153 ▶sub declare_as_base {
Subroutine declare_as_base: called CC=3 SCAR=11.1
Pod undocumented
41 153 my ($myPack, $callpack) = @_;
42 153 print STDERR "$myPack->declare_as_base($callpack)\n" if DEBUG;
43  
44 {
45 153 my $sym = globref($callpack, 'ISA');
46 153 my $isa;
47 153 ▶ unless ($isa = *{$sym}{ARRAY}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($isa = *{$sym;}{"ARRAY"}) 0 153 153
48 0 *$sym = $isa = [];
49 }
50 153 mro::set_mro($callpack, 'c3');
51 153 ▶ unless (grep {$_ eq $myPack} @$isa) {
Branch: 1 branch
BranchTrueFalseTotal
unless (grep {$_ eq $myPack;} @$isa) 153 0 153
52 153 unshift @$isa, $myPack;
53 153 print STDERR " => $callpack isa: @$isa\n" if DEBUG;
54 }
55 }
56 }
57  
58 80 1;
« blib/lib/YATT/Lite/ConnectionProxy.pm ↑ Summary blib/lib/YATT/Lite/Site/Registry.pm »