lib/MetaPOD/Format/JSON/does/v1.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran 75.0% 3 / 4 Conditioncond 50.0% 3 / 6 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 81.8% 36 / 44 CC 5 SCAR 12.0
CC
5
Cov
85%
add_does
5.6
BEGIN
1.0
BEGIN
1.0
CRAP 3.3
« lib/MetaPOD/Format/JSON/interface/v1_1.pm ↑ Summary lib/MetaPOD/Format/JSON/inherits/v1.pm »
1 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package MetaPOD::Format::JSON::does::v1;
5 6 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 $MetaPOD::Format::JSON::does::v1::AUTHORITY = 'cpan:KENTNL';
7 }
8 {
9 6 $MetaPOD::Format::JSON::does::v1::VERSION = '0.3.0';
10 }
11  
12 # ABSTRACT: Implementation of JSON/does format component
13  
14  
15 6 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 6 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18  
19 3 ▶sub add_does {
Subroutine add_does: called CC=5 SCAR=17.3
Pod documented
20 3 my ( $self, $does, $result ) = @_;
21 3 ▶ if ( defined $does and not ref $does ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $does and not ref $does) 1 2 3
Condition66%2/3
defined $does and not ref $does
!ll&&!rl&&r
021
MC/DC50%1/2
defined $does and not ref $does
defined $does not ref $does
Truth table66%2/3
A and not(B)
A= defined $doesB= not ref $does
ABresult
0X0
100
111
22 1 return $result->add_does($does);
23 }
24 2 ▶ if ( defined $does and ref $does eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $does and ref $does eq "ARRAY") 2 0 2
Condition33%1/3
defined $does and ref $does eq "ARRAY"
!ll&&!rl&&r
002
MC/DC0%0/2
defined $does and ref $does eq "ARRAY"
defined $does ref $does eq "ARRAY"
Truth table33%1/3
A and B
A= defined $doesB= ref $does eq "ARRAY"
ABresult
0X0
100
111
25 2 return $result->add_does( @{$does} );
26 }
27 0 croak 'Unsupported reftype ' . ref $does;
28 }
29  
30 6 1;
31  
32 __END__
« lib/MetaPOD/Format/JSON/interface/v1_1.pm ↑ Summary lib/MetaPOD/Format/JSON/inherits/v1.pm »