blib/lib/Class/MakeMethods/Emulator/Inheritable.pm

filter: Statementstmt 90.4% 19 / 21 Branchbran 66.6% 4 / 6 Conditioncond 50.0% 6 / 12 MC/DCmcdc 16.6% 1 / 6 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 68.6% 35 / 51 CC 8 SCAR 18.3
CC
8
Cov
74%
import
9.7
mk_classdata
2.1
BEGIN
1.0
CRAP 6.3
« blib/lib/Class/MakeMethods/Emulator/Singleton.pm ↑ Summary blib/lib/Class/MakeMethods/Emulator/Struct.pm »
1 package Class::MakeMethods::Emulator::Inheritable;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶use Class::MakeMethods::Template::ClassInherit;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Class::MakeMethods::Emulator qw( namespace_capture namespace_release );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 my $emulation_target = 'Class::Data::Inheritable';
9  
10 2 ▶sub import {
Subroutine import: called CC=7 SCAR=22.7
11 2 my $mm_class = shift;
12 2 ▶ if ( scalar @_ and $_[0] =~ /^-take_namespace/ and shift) {
Branch: 2 branches
BranchTrueFalseTotal
if (scalar @_ and $_[0] =~ /^-take_namespace/ and shift()) { } 1 1 2
elsif (scalar @_ and $_[0] =~ /^-release_namespace/ and shift()) { } 0 2 2
Condition66%4/6
scalar @_ and $_[0] =~ /^-take_namespace/ and shift()
!ll&&!rl&&r
101
scalar @_ and $_[0] =~ /^-take_namespace/
!ll&&!rl&&r
101
MC/DC33%1/3
scalar @_ and $_[0] =~ /^-take_namespace/ and shift()
scalar @_ $_[0] =~ /^-take_namespace/ shift()
Truth table50%2/4
A and B and C
A= scalar @_B= $_[0] =~ /^-take_namespace/C= shift()
ABCresult
0XX0
10X0
1100
1111
13 1 namespace_capture(__PACKAGE__, $emulation_target);
14 ▶ } elsif ( scalar @_ and $_[0] =~ /^-release_namespace/ and shift) {
Condition33%2/6
scalar @_ and $_[0] =~ /^-release_namespace/ and shift()
!ll&&!rl&&r
100
scalar @_ and $_[0] =~ /^-release_namespace/
!ll&&!rl&&r
100
MC/DC0%0/3
scalar @_ and $_[0] =~ /^-release_namespace/ and shift()
scalar @_ $_[0] =~ /^-release_namespace/ shift()
Truth table25%1/4
A and B and C
A= scalar @_B= $_[0] =~ /^-release_namespace/C= shift()
ABCresult
0XX0
10X0
1100
1111
15 0 namespace_release(__PACKAGE__, $emulation_target);
16 }
17 # The fallback should really be to NEXT::import.
18 2 $mm_class->SUPER::import( @_ );
19 }
20  
21 ########################################################################
22  
23 2 ▶sub mk_classdata {
Subroutine mk_classdata: called CC=2 SCAR=7.4
Pod undocumented
24 2 my $declaredclass = shift;
25 2 my $attribute = shift;
26 2 Class::MakeMethods::Template::ClassInherit->make(
27 -TargetClass => $declaredclass,
28 'scalar' => [ -interface => { '*'=>'get_set', '_*_accessor'=>'get_set' },
29 $attribute ],
30 );
31 2 ▶ if ( scalar @_ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @_) 0 2 2
32 0 $declaredclass->$attribute( @_ );
33 }
34 }
35  
36 ########################################################################
37  
38 2 1;
39  
40 __END__
« blib/lib/Class/MakeMethods/Emulator/Singleton.pm ↑ Summary blib/lib/Class/MakeMethods/Emulator/Struct.pm »