WSDL/AUTOLOAD.pm

filter: Statementstmt 96.7% 30 / 31 Branchbran 91.6% 11 / 12 Conditioncond 83.3% 15 / 18 MC/DCmcdc 62.5% 5 / 8 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 89.1% 66 / 74 CC 13 SCAR 23.3
CC
13
Cov
92%
AUTOLOAD
13.2
BEGIN
1.0
BEGIN
1.0
CRAP 10.3
« WSDL/Type.pm ↑ Summary WSDL/Param.pm »
1 package Pod::WSDL::AUTOLOAD;
2  
3 16 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 16 our $AUTOLOAD;
8 16 our $VERSION = "0.05";
9  
10 163 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: called CC=13 SCAR=25.8
11 163 my $me = shift;
12 163 my $param = shift;
13
14 163 my $fbd = ref($me) . '::FORBIDDEN_METHODS';
15
16 163 my $attr = $AUTOLOAD;
17 163 $attr =~ s/.*:://;
18  
19 163 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 163 163
20 0 croak ref $me . " received call to '$attr' with too many params (max 1). Call was '$attr($param, " . join (", ", @_) . ")'!";
21 }
22
23 163 ▶ if ($attr eq "DESTROY"){
Branch: 2 branches
BranchTrueFalseTotal
if ($attr eq 'DESTROY') { } 43 120 163
elsif (exists $$me{'_' . $attr}) { } 113 7 120
24 43 return;
25 } elsif (exists $me->{'_' . $attr}) {
26 16 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
27 113 ▶ if (defined $param) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $param) { } 18 95 113
28 18 ▶ croak ref ($me) . " does not allow setting of '$attr', died" if (caller)[0] ne ref($me) and %$fbd and $fbd->{$attr} and !$fbd->{$attr}->{set};
Branch: 1 branch
BranchTrueFalseTotal
if (caller)[0] ne ref $me and %$fbd and $fbd->{$attr} and not $fbd->{$attr}{"set"} 9 9 18
Condition77%7/9
(caller)[0] ne ref $me and %$fbd and $fbd->{$attr} and not $fbd->{$attr}{"set"}
!ll&&!rl&&r
909
(caller)[0] ne ref $me and %$fbd and $fbd->{$attr}
!ll&&!rl&&r
909
(caller)[0] ne ref $me and %$fbd
!ll&&!rl&&r
729
MC/DC50%2/4
(caller)[0] ne ref $me and %$fbd and $fbd->{$attr} and not $fbd->{$attr}{"set"}
(caller)[0] ne ref $me %$fbd $fbd->{$attr} not $fbd->{$attr}{"set"}
Truth table60%3/5
A and B and C and not(D)
A= (caller)[0] ne ref $meB= %$fbdC= $fbd->{$attr}D= not $fbd->{$attr}{"set"}
ABCDresult
0XXX0
10XX0
110X0
11100
11111
29 9 $me->{'_' . $attr} = $param;
30 9 return $me;
31 } else {
32 95 ▶ croak ref ($me) . " does not allow getting of '$attr', died" if (caller)[0] ne ref($me) and %$fbd and $fbd->{$attr} and !$fbd->{$attr}->{get};
Branch: 1 branch
BranchTrueFalseTotal
if (caller)[0] ne ref $me and %$fbd and $fbd->{$attr} and not $fbd->{$attr}{"get"} 2 93 95
Condition88%8/9
(caller)[0] ne ref $me and %$fbd and $fbd->{$attr} and not $fbd->{$attr}{"get"}
!ll&&!rl&&r
41522
(caller)[0] ne ref $me and %$fbd and $fbd->{$attr}
!ll&&!rl&&r
41054
(caller)[0] ne ref $me and %$fbd
!ll&&!rl&&r
33854
MC/DC75%3/4
(caller)[0] ne ref $me and %$fbd and $fbd->{$attr} and not $fbd->{$attr}{"get"}
(caller)[0] ne ref $me %$fbd $fbd->{$attr} not $fbd->{$attr}{"get"}
Truth table80%4/5
A and B and C and not(D)
A= (caller)[0] ne ref $meB= %$fbdC= $fbd->{$attr}D= not $fbd->{$attr}{"get"}
ABCDresult
0XXX0
10XX0
110X0
11100
11111
33 #if (ref $me->{'_' . $attr} eq 'ARRAY') {
34 # return @{$me->{'_' . $attr}};
35 #} elsif (ref $me->{'_' . $attr} eq 'HASH') {
36 # return %{$me->{'_' . $attr}};
37 #} elsif (ref $me->{'_' . $attr} eq 'SCALAR') {
38 # return ${$me->{'_' . $attr}};
39 #} else {
40 93 return $me->{'_' . $attr};
41 #}
42 }
43 } else {
44 7 croak "I have no method called '$attr()'!";
45 }
46 }
47  
48 16 1;
49 __END__
« WSDL/Type.pm ↑ Summary WSDL/Param.pm »