« 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
| |||||||||||||||||||||||
| 11 | |||||||||||||||||||||||
| 12 | # Use $ORS (Output Record Separator) or newline as fallback | ||||||||||||||||||||||
| 13 | 11 | ▶ | my $sep = defined($\) ? $\ : "\n"; | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 14 | 11 | ▶ | return join($sep, map { $_->message } @{$self->{failures} || []}); | ||||||||||||||||||||
|
Condition50%1/2
$self->{'failures'} || []
MC/DC0%0/1
$self->{'failures'} || []
$self->{'failures'}
Truth table50%1/2
A
A= $self->{'failures'}
| |||||||||||||||||||||||
| 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
$args{'failures'} || []
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'}
Truth table50%1/2
A
A= $args{'failures'}
| |||||||||||||||||||||||
| 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'} || []
MC/DC0%0/1
$self->{'failures'} || []
$self->{'failures'}
Truth table50%1/2
A
A= $self->{'failures'}
| |||||||||||||||||||||||
| 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'} || []
MC/DC0%0/1
$self->{'failures'} || []
$self->{'failures'}
Truth table50%1/2
A
A= $self->{'failures'}
| |||||||||||||||||||||||
| 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'} || []
MC/DC0%0/1
$self->{'failures'} || []
$self->{'failures'}
Truth table50%1/2
A
A= $self->{'failures'}
| |||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||
| 41 | |||||||||||||||||||||||
| 42 | 27 | 1; | |||||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||||||