lib/MetaPOD/Format/JSON/interface/v1_1.pm

filter: Statementstmt 61.2% 19 / 31 Branchbran 16.6% 1 / 6 Conditioncond 16.6% 1 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 75.0% 6 / 8 Podpod 100% 3 / 3 totaltotal 51.7% 30 / 58 CC 7 SCAR 20.8
CC
7
Cov
49%
add_interface
13.8
check_interface
12.0
supported_interfaces
2.0
CRAP 8.0
↑ Summary lib/MetaPOD/Format/JSON/does/v1.pm »
1 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package MetaPOD::Format::JSON::interface::v1_1;
5 5 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 $MetaPOD::Format::JSON::interface::v1_1::AUTHORITY = 'cpan:KENTNL';
7 }
8 {
9 5 $MetaPOD::Format::JSON::interface::v1_1::VERSION = '0.3.0';
10 }
11  
12 # ABSTRACT: Implementation of JSON/interface format component
13  
14  
15 5 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 5 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18  
19 0 ▶sub supported_interfaces {
Subroutine supported_interfaces: not called CC=1 SCAR=6.9
Pod documented
20 0 return qw( class role type_library exporter single_class function );
21 }
22  
23  
24 0 ▶sub check_interface {
Subroutine check_interface: not called CC=3 SCAR=24.8
Pod documented
25 0 my ( $self, @ifs ) = @_;
26 0 my $supported = { map { ( $_, 1 ) } $self->supported_interfaces_v1_1 };
27 0 for my $if (@ifs) {
28 0 ▶ if ( not exists $supported->{$if} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $supported->{$if}) 0 0 0
29 0 croak("interface type $if unsupported in v1.1.0");
30 }
31 }
32 0 return $self;
33 }
34  
35  
36 9 ▶sub add_interface {
Subroutine add_interface: called CC=5 SCAR=26.2
Pod documented
37 9 my ( $self, $interface, $result ) = @_;
38 9 ▶ if ( defined $interface and not ref $interface ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $interface and not ref $interface) 9 0 9
Condition33%1/3
defined $interface and not ref $interface
!ll&&!rl&&r
009
MC/DC0%0/2
defined $interface and not ref $interface
defined $interface not ref $interface
Truth table33%1/3
A and not(B)
A= defined $interfaceB= not ref $interface
ABresult
0X0
100
111
39 9 return $result->add_interface($interface);
40 }
41 0 ▶ if ( defined $interface and ref $interface eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $interface and ref $interface eq "ARRAY") 0 0 0
Condition0%0/3
defined $interface and ref $interface eq "ARRAY"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $interface and ref $interface eq "ARRAY"
defined $interface ref $interface eq "ARRAY"
Truth table0%0/3
A and B
A= defined $interfaceB= ref $interface eq "ARRAY"
ABresult
0X0
100
111
42 0 return $result->add_interface( @{$interface} );
43 }
44 0 croak 'Unsupported reftype ' . ref $interface;
45 }
46  
47 5 1;
48  
49 __END__
↑ Summary lib/MetaPOD/Format/JSON/does/v1.pm »