blib/lib/GDPR/IAB/TCFv2/Validator/Result.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 4 / 4 Conditioncond 58.3% 7 / 12 MC/DCmcdc 16.6% 1 / 6 Subroutinesub 100% 10 / 10 Podpod 100% 5 / 5 totaltotal 85.2% 58 / 68 CC 9 SCAR 8.5
CC
9
Cov
89%
__ANON__
4.0
new
3.0
failures
2.0
CRAP 2.3
« blib/lib/GDPR/IAB/TCFv2/Validator/Reason.pm ↑ Summary blib/lib/GDPR/IAB/TCFv2/Validator/Failure.pm »
1 package GDPR::IAB::TCFv2::Validator::Result 0.530;
2  
3 27 ▶use v5.12;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 27 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 use overload
7 42 ▶ bool => sub { $_[0]->{ok} },
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
8 13 ▶ '""' => sub {
Subroutine __ANON__: called CC=4 SCAR=13.9
9 13 my $self = shift;
10 13 ▶ return '' if $self->{ok};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"ok"} 2 11 13
11  
12 # Use $ORS (Output Record Separator) or newline as fallback
13 11 ▶ my $sep = defined($\) ? $\ : "\n";
Branch: 1 branch
BranchTrueFalseTotal
defined $\ ? : 1 10 11
14 11 ▶ return join($sep, map { $_->message } @{$self->{failures} || []});
Condition50%1/2
$self->{'failures'} || []
l!l
110
MC/DC0%0/1
$self->{'failures'} || []
$self->{'failures'}
Truth table50%1/2
A
A= $self->{'failures'}
Aresult
11
00
15 27 };
16  
17 9282 ▶sub new {
Subroutine new: called CC=3 SCAR=11.1
Pod documented
18 9282 my ($klass, %args) = @_;
19  
20 9282 ▶ my $self = {ok => $args{ok} || 0, failures => $args{failures} || [],};
Condition75%3/4
$args{'ok'} || 0
l!l
59793303
$args{'failures'} || []
l!l
92820
MC/DC100%1/1
$args{'ok'} || 0
$args{'ok'}
MC/DC0%0/1
$args{'failures'} || []
$args{'failures'}
Truth table100%2/2
A
A= $args{'ok'}
Aresult
11
00
Truth table50%1/2
A
A= $args{'failures'}
Aresult
11
00
21  
22 9282 return bless $self, $klass;
23 }
24  
25 9251 ▶sub is_valid { $_[0]->{ok} }
Subroutine is_valid: called CC=1 SCAR=0.0
Pod documented
26  
27 9 ▶sub failures {
Subroutine failures: called CC=2 SCAR=7.1
Pod documented
28 9 my $self = shift;
29 9 ▶ return @{$self->{failures} || []};
Condition50%1/2
$self->{'failures'} || []
l!l
90
MC/DC0%0/1
$self->{'failures'} || []
$self->{'failures'}
Truth table50%1/2
A
A= $self->{'failures'}
Aresult
11
00
30 }
31  
32 4 ▶sub reason_codes {
Subroutine reason_codes: called CC=2 SCAR=7.0
Pod documented
33 4 my $self = shift;
34 4 ▶ return map { $_->code } @{$self->{failures} || []};
Condition50%1/2
$self->{'failures'} || []
l!l
40
MC/DC0%0/1
$self->{'failures'} || []
$self->{'failures'}
Truth table50%1/2
A
A= $self->{'failures'}
Aresult
11
00
35 }
36  
37 9233 ▶sub reasons {
Subroutine reasons: called CC=2 SCAR=7.0
Pod documented
38 9233 my $self = shift;
39 9233 ▶ return map { $_->message } @{$self->{failures} || []};
Condition50%1/2
$self->{'failures'} || []
l!l
92330
MC/DC0%0/1
$self->{'failures'} || []
$self->{'failures'}
Truth table50%1/2
A
A= $self->{'failures'}
Aresult
11
00
40 }
41  
42 27 1;
43 __END__
« blib/lib/GDPR/IAB/TCFv2/Validator/Reason.pm ↑ Summary blib/lib/GDPR/IAB/TCFv2/Validator/Failure.pm »