blib/lib/MARC/Spec/Subspec.pm

filter: Statementstmt 100% 17 / 17 Branchbran 50.0% 2 / 4 Conditioncond 50.0% 3 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 76.3% 29 / 38 SCAR 16.4
CC
5
Cov
81%
__ANON__
4.1
__ANON__
3.3
BEGIN
1.0
CRAP 5.2
« blib/lib/MARC/Spec.pm ↑ Summary blib/lib/MARC/Spec/Comparisonstring.pm »
1 package MARC::Spec::Subspec;
2  
3 13 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 13 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 13 our $VERSION = '1.0.0';
7  
8 has left => (
9 is => 'rw',
10 isa => sub {
11 92 ▶ croak ('Left subterm is not an instance of MARC::Spec or MARC::Spec::Comparisonstring.')
Subroutine __ANON__: called CC=3 SCAR=14.2
Branch: 1 branch
BranchTrueFalseTotal
unless ref $_[0] eq "MARC::Spec" or ref $_[0] eq "MARC::Spec::Comparisonstring" 0 92 92
Condition33%1/3
ref $_[0] eq "MARC::Spec" or ref $_[0] eq "MARC::Spec::Comparisonstring"
l!l&&r!l&&!r
9200
MC/DC0%0/2
ref $_[0] eq "MARC::Spec" or ref $_[0] eq "MARC::Spec::Comparisonstring"
ref $_[0] eq "MARC::Spec" ref $_[0] eq "MARC::Spec::Comparisonstring"
Truth table33%1/3
A or B
A= ref $_[0] eq "MARC::Spec"B= ref $_[0] eq "MARC::Spec::Comparisonstring"
ABresult
1X1
011
000
12 unless(ref $_[0] eq 'MARC::Spec' or ref $_[0] eq 'MARC::Spec::Comparisonstring')
13 }
14 13 );
15  
16 has right => (
17 is => 'rw',
18 isa => sub {
19 100 ▶ croak ('Right subterm is not an instance of MARC::Spec or MARC::Spec::Comparisonstring.')
Subroutine __ANON__: called CC=3 SCAR=12.0
Branch: 1 branch
BranchTrueFalseTotal
unless ref $_[0] eq "MARC::Spec" or ref $_[0] eq "MARC::Spec::Comparisonstring" 0 100 100
Condition66%2/3
ref $_[0] eq "MARC::Spec" or ref $_[0] eq "MARC::Spec::Comparisonstring"
l!l&&r!l&&!r
15850
MC/DC0%0/2
ref $_[0] eq "MARC::Spec" or ref $_[0] eq "MARC::Spec::Comparisonstring"
ref $_[0] eq "MARC::Spec" ref $_[0] eq "MARC::Spec::Comparisonstring"
Truth table66%2/3
A or B
A= ref $_[0] eq "MARC::Spec"B= ref $_[0] eq "MARC::Spec::Comparisonstring"
ABresult
1X1
011
000
20 unless(ref $_[0] eq 'MARC::Spec' or ref $_[0] eq 'MARC::Spec::Comparisonstring')
21 }
22 13 );
23  
24 has operator => (
25 is => 'rw',
26 100 ▶ default => sub { "?" }
Subroutine __ANON__: called CC=1 SCAR=0.0
27 13 );
28  
29  
30 sub to_string {
31 4 ▶ my ($self) = @_;
Subroutine to_string: called CC=1 SCAR=0.0
Pod documented
32 4 my $string = $self->left->to_string().$self->operator.$self->right->to_string();
33 4 return $string;
34 }
35 13 1;
36  
37 __END__
« blib/lib/MARC/Spec.pm ↑ Summary blib/lib/MARC/Spec/Comparisonstring.pm »