| 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
Condition66%2/3
defined $inherits and not ref $inherits
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
| |||||||||||||||||||||||||||||
| 22 | 5 | return $result->add_inherits($inherits); | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | 2 | ▶ | if ( defined $inherits and ref $inherits eq 'ARRAY' ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $inherits and ref $inherits eq "ARRAY"
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"
| |||||||||||||||||||||||||||||
| 25 | 2 | return $result->add_inherits( @{$inherits} ); | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | 0 | croak 'Unsupported reftype ' . ref $inherits; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 6 | 1; | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | __END__ | ||||||||||||||||||||||||||||