lib/MetaPOD/Format/JSON/inherits/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_inherits
5.6
BEGIN
1.0
BEGIN
1.0
CRAP 3.3
« lib/MetaPOD/Format/JSON/does/v1.pm ↑ Summary blib/lib/MetaPOD/Format/JSON/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::inherits::v1;
5 6 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 $MetaPOD::Format::JSON::inherits::v1::AUTHORITY = 'cpan:KENTNL';
7 }
8 {
9 6 $MetaPOD::Format::JSON::inherits::v1::VERSION = '0.3.0';
10 }
11  
12 # ABSTRACT: Implementation of JSON/inherits 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 7 ▶sub add_inherits {
Subroutine add_inherits: called CC=5 SCAR=17.3
Pod documented
20 7 my ( $self, $inherits, $result ) = @_;
21 7 ▶ if ( defined $inherits and not ref $inherits ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $inherits and not ref $inherits) 5 2 7
Condition66%2/3
defined $inherits and not ref $inherits
!ll&&!rl&&r
025
MC/DC50%1/2
defined $inherits and not ref $inherits
defined $inherits not ref $inherits
Truth table66%2/3
A and not(B)
A= defined $inheritsB= not ref $inherits
ABresult
0X0
100
111
22 5 return $result->add_inherits($inherits);
23 }
24 2 ▶ if ( defined $inherits and ref $inherits eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $inherits and ref $inherits eq "ARRAY") 2 0 2
Condition33%1/3
defined $inherits and ref $inherits eq "ARRAY"
!ll&&!rl&&r
002
MC/DC0%0/2
defined $inherits and ref $inherits eq "ARRAY"
defined $inherits ref $inherits eq "ARRAY"
Truth table33%1/3
A and B
A= defined $inheritsB= ref $inherits eq "ARRAY"
ABresult
0X0
100
111
25 2 return $result->add_inherits( @{$inherits} );
26 }
27 0 croak 'Unsupported reftype ' . ref $inherits;
28 }
29  
30 6 1;
31  
32 __END__
« lib/MetaPOD/Format/JSON/does/v1.pm ↑ Summary blib/lib/MetaPOD/Format/JSON/v1.pm »