Postini/Assert.pm

filter: Statementstmt 100% 25 / 25 Branchbran 66.6% 4 / 6 Conditioncond 50.0% 3 / 6 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 83.3% 40 / 48 CC 6 SCAR 14.2
CC
6
Cov
86%
assert
6.8
BEGIN
1.0
BEGIN
1.0
CRAP 4.1
« Postini/Exception.pm ↑ Summary Postini/UserAgent.pm »
1 package WWW::Postini::Assert;
2
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5
6 1 ▶use WWW::Postini::Exception::AssertionFailure;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
8
9 1 ▶use vars qw( @ISA @EXPORT $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
10
11 1 @ISA = qw( Exporter );
12 1 @EXPORT = qw( assert );
13 1 $VERSION = '0.01';
14
15 515 ▶sub assert {
Subroutine assert: called CC=6 SCAR=19.1
Pod documented
16
17 515 my $value = shift;
18 515 ▶ my $description = shift if defined $_[0];
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[0] 515 0 515
19
20 515 ▶ unless (defined $value && $value) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $value and $value) 1 514 515
Condition66%2/3
defined $value and $value
!ll&&!rl&&r
01514
MC/DC50%1/2
defined $value and $value
defined $value $value
Truth table66%2/3
A and B
A= defined $valueB= $value
ABresult
0X0
100
111
21
22 1 ▶ my $description = sprintf 'Assertion%sfailed',
Branch: 1 branch
BranchTrueFalseTotal
defined $description && length $description ? : 1 0 1
Condition33%1/3
defined $description and length $description
!ll&&!rl&&r
001
MC/DC0%0/2
defined $description and length $description
defined $description length $description
Truth table33%1/3
A and B
A= defined $descriptionB= length $description
ABresult
0X0
100
111
23 defined $description && length $description ? " '$description' " : ' '
24 ;
25 1 throw WWW::Postini::Exception::AssertionFailure($description);
26
27 }
28
29 514 1;
30
31 }
32
33 1 1;
34
35 __END__
« Postini/Exception.pm ↑ Summary Postini/UserAgent.pm »