API/Cache.pm

filter: Statementstmt 100% 26 / 26 Branchbran 50.0% 1 / 2 Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 7 / 7 Podpod 100% 3 / 3 totaltotal 84.7% 39 / 46 CC 4 SCAR 8.5
CC
4
Cov
88%
new
4.4
BEGIN
1.0
BEGIN
1.0
CRAP 2.3
« API.pm ↑ Summary API/RSS.pm »
1 package XML::API::Cache;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use overload '""' => \&content;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '0.30';
8  
9 1 ▶sub new {
Subroutine new: called CC=4 SCAR=14.8
Pod documented
10 1 my $proto = shift;
11 1 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
010
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
12 1 ▶ my $x = shift || croak 'XML::API::Cache->new($x)';
Condition50%1/2
shift() || croak('XML::API::Cache->new($x)')
l!l
10
MC/DC0%0/1
shift() || croak('XML::API::Cache->new($x)')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
13 1 ▶ $x->isa('XML::API') || croak 'argument must be XML::API derived object';
Branch: 1 branch
BranchTrueFalseTotal
$x->isa("XML::API") or croak("argument must be XML::API derived object") 1 0 1
14  
15 1 my $self = {
16 content => $x->_fast_string,
17 langs => [ $x->_langs ],
18 };
19  
20 1 bless( $self, $class );
21 1 return $self;
22 }
23  
24 2 ▶sub langs {
Subroutine langs: called CC=1 SCAR=0.0
Pod documented
25 2 my $self = shift;
26 2 return @{ $self->{langs} };
27 }
28  
29 2 ▶sub content {
Subroutine content: called CC=1 SCAR=0.0
Pod documented
30 2 my $self = shift;
31 2 return $self->{content};
32 }
33  
34 2 1;
35 __END__
« API.pm ↑ Summary API/RSS.pm »