Data/Printer/Filter/Digest.pm

filter: Statementstmt 100% 23 / 23 Branchbran 83.3% 5 / 6 Conditioncond 50.0% 3 / 6 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 83.7% 36 / 43 CC 6 SCAR 15.0
CC
6
Cov
89%
_print_digest
6.2
BEGIN
1.0
BEGIN
1.0
CRAP 4.5
« Data/Printer/Filter/REF.pm ↑ Summary Data/Printer/Filter/CODE.pm »
1 package Data::Printer::Filter::Digest;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Data::Printer::Filter;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 filter 'Digest::base' => \&_print_digest;
7  
8 # these modules don't inherit from Digest::base but have the same interface:
9 1 filter 'Digest::MD2' => \&_print_digest;
10 1 filter 'Digest::MD4' => \&_print_digest;
11  
12 9 ▶sub _print_digest {
Subroutine _print_digest: called CC=6 SCAR=18.3
13 9 my ($obj, $ddp) = @_;
14 9 my $digest = $obj->clone->hexdigest;
15 9 my $str = $digest;
16 9 my $ref = ref $obj;
17  
18 9 ▶ if ( !exists $ddp->extra_config->{filter_digest}{show_class_name}
Branch: 1 branch
BranchTrueFalseTotal
if (not exists $ddp->extra_config->{"filter_digest"}{"show_class_name"} or $ddp->extra_config->{"filter_digest"}{"show_class_name"}) 6 3 9
Condition66%2/3
not exists $ddp->extra_config->{"filter_digest"}{"show_class_name"} or $ddp->extra_config->{"filter_digest"}{"show_class_name"}
l!l&&r!l&&!r
603
MC/DC50%1/2
not exists $ddp->extra_config->{"filter_digest"}{"show_class_name"} or $ddp->extra_config->{"filter_digest"}{"show_class_name"}
not exists $ddp->extra_config->{"filter_digest"}{"show_class_name"} $ddp->extra_config->{"filter_digest"}{"show_class_name"}
Truth table66%2/3
not(A) or B
A= not exists $ddp->extra_config->{"filter_digest"}{"show_class_name"}B= $ddp->extra_config->{"filter_digest"}{"show_class_name"}
ABresult
1X1
011
000
19 || $ddp->extra_config->{filter_digest}{show_class_name} ) {
20 6 $str .= " ($ref)";
21 }
22  
23 9 ▶ if( !exists $ddp->extra_config->{filter_digest}{show_reset}
Branch: 1 branch
BranchTrueFalseTotal
if (not exists $ddp->extra_config->{"filter_digest"}{"show_reset"} or $ddp->extra_config->{"filter_digest"}{"show_reset"}) 9 0 9
Condition33%1/3
not exists $ddp->extra_config->{"filter_digest"}{"show_reset"} or $ddp->extra_config->{"filter_digest"}{"show_reset"}
l!l&&r!l&&!r
900
MC/DC0%0/2
not exists $ddp->extra_config->{"filter_digest"}{"show_reset"} or $ddp->extra_config->{"filter_digest"}{"show_reset"}
not exists $ddp->extra_config->{"filter_digest"}{"show_reset"} $ddp->extra_config->{"filter_digest"}{"show_reset"}
Truth table33%1/3
not(A) or B
A= not exists $ddp->extra_config->{"filter_digest"}{"show_reset"}B= $ddp->extra_config->{"filter_digest"}{"show_reset"}
ABresult
1X1
011
000
24 || $ddp->extra_config->{filter_digest}{show_reset}
25 ) {
26 9 ▶ if ($digest eq $ref->new->hexdigest) {
Branch: 1 branch
BranchTrueFalseTotal
if ($digest eq $ref->new->hexdigest) 3 6 9
27 3 $str .= ' [reset]';
28 }
29 }
30  
31 9 return $ddp->maybe_colorize($str, 'datetime', '#ffaaff');
32 }
33  
34 1 1;
35  
36 __END__
« Data/Printer/Filter/REF.pm ↑ Summary Data/Printer/Filter/CODE.pm »