lib/WebService/CIA/Source.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 4 / 4 Conditioncond 66.6% 4 / 6 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 100% 5 / 5 Podpod 100% 3 / 3 totaltotal 91.4% 43 / 47 CC 5 SCAR 7.5
CC
5
Cov
94%
value
3.0
new
2.0
all
2.0
CRAP 2.1
« lib/WebService/CIA/Source/DBM.pm ↑ Summary lib/WebService/CIA.pm »
1 package WebService::CIA::Source;
2  
3 4 require 5.005_62;
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 our $VERSION = '1.4';
8  
9  
10 # Preloaded methods go here.
11  
12 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.1
Pod documented
13  
14 2 my $proto = shift;
15 2 my $source = shift;
16 2 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
020
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
17 2 my $self = {};
18  
19 2 bless ($self, $class);
20 2 return $self;
21  
22 }
23  
24 8 ▶sub value {
Subroutine value: called CC=3 SCAR=11.0
Pod documented
25  
26 8 my $self = shift;
27 8 my ($cc, $f) = @_;
28 8 ▶ if ($cc eq 'testcountry' and $f eq 'Test') {
Branch: 1 branch
BranchTrueFalseTotal
if ($cc eq 'testcountry' and $f eq 'Test') { } 4 4 8
Condition100%3/3
$cc eq "testcountry" and $f eq "Test"
!ll&&!rl&&r
314
MC/DC100%2/2
$cc eq "testcountry" and $f eq "Test"
$cc eq "testcountry" $f eq "Test"
Truth table100%3/3
A and B
A= $cc eq "testcountry"B= $f eq "Test"
ABresult
0X0
100
111
29 4 return 'Wombat';
30 } else {
31 4 return;
32 }
33  
34 }
35  
36 7 ▶sub all {
Subroutine all: called CC=2 SCAR=6.9
Pod documented
37  
38 7 my $self = shift;
39 7 my $cc = shift;
40 7 ▶ if ($cc eq 'testcountry') {
Branch: 1 branch
BranchTrueFalseTotal
if ($cc eq 'testcountry') { } 5 2 7
41 5 return {'Test' => 'Wombat'};
42 } else {
43 2 return {};
44 }
45  
46 }
47  
48  
49 4 1;
50 __END__
« lib/WebService/CIA/Source/DBM.pm ↑ Summary lib/WebService/CIA.pm »