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

filter: Statementstmt 92.8% 13 / 14 Branchbran 75.0% 3 / 4 Conditioncond 50.0% 6 / 12 MC/DCmcdc 16.6% 1 / 6 Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 66.6% 26 / 39 CC 7 SCAR 20.5
CC
7
Cov
73%
import
9.7
BEGIN
1.0
BEGIN
1.0
CRAP 7.8
« blib/lib/Class/MakeMethods/Standard/Hash.pm ↑ Summary blib/lib/Class/MakeMethods/Emulator/Inheritable.pm »
1 package Class::MakeMethods::Emulator::Singleton;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 require Class::MakeMethods::Emulator;
5  
6 2 my $emulation_target = 'Class::Singleton';
7  
8 2 ▶sub import {
Subroutine import: called CC=7 SCAR=22.7
9 2 my $mm_class = shift;
10 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
11 1 Class::MakeMethods::Emulator::namespace_capture(__PACKAGE__, $emulation_target);
12 ▶ } 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
13 0 Class::MakeMethods::Emulator::namespace_release(__PACKAGE__, $emulation_target);
14 }
15 # The fallback should really be to NEXT::import.
16 2 $mm_class->SUPER::import( @_ );
17 }
18  
19 ########################################################################
20  
21 2 ▶use Class::MakeMethods (
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 'Template::Hash:new --with_values' => '_new_instance',
23 'Template::ClassVar:instance --get_init' => [ 'instance',
24 {new_method=>'_new_instance', variable=>'_instance'} ]
25 2 );
26  
27 ########################################################################
28  
29 2 1;
30  
31 __END__
« blib/lib/Class/MakeMethods/Standard/Hash.pm ↑ Summary blib/lib/Class/MakeMethods/Emulator/Inheritable.pm »