Compare/THRESHOLD_COUNT.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 2 / 2 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 6 / 6 Podpod 100% 3 / 3 totaltotal 100% 32 / 32 CC 3 SCAR 4.1
CC
3
Cov
100%
accumulate
2.0
get_result
2.0
BEGIN
1.0
CRAP 1.5
« Compare/IMAGE.pm ↑ Summary Compare/EXACT.pm »
1 package Image::Compare::THRESHOLD_COUNT;
2  
3 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 8 ▶use base qw/Image::Compare::THRESHOLD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 ▶sub setup {
Subroutine setup: called CC=1 SCAR=0.0
Pod documented
9 3 my $self = shift;
10 3 $self->{count} = 0;
11 }
12  
13 11 ▶sub accumulate {
Subroutine accumulate: called CC=2 SCAR=6.9
Pod documented
14 11 my $self = shift;
15 # The superclass returns 0 if it's over the threshold and undef otherwise.
16 # Not really optimal return values, but we're kind of cheating by looking
17 # at it in this context, so hey.
18 11 ▶ if (defined($self->SUPER::accumulate(@_))) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->SUPER::accumulate(@_)) 4 7 11
19 4 $self->{count}++;
20 }
21 # Always continue.
22 11 return undef;
23 }
24  
25 3 ▶sub get_result {
Subroutine get_result: called CC=2 SCAR=6.9
Pod documented
26 3 my $self = shift;
27 3 ▶ return $self->{count} || 0;
Condition100%2/2
$self->{'count'} || 0
l!l
12
MC/DC100%1/1
$self->{'count'} || 0
$self->{'count'}
Truth table100%2/2
A
A= $self->{'count'}
Aresult
11
00
28 }
29  
30 8 1;
31  
32 __END__
« Compare/IMAGE.pm ↑ Summary Compare/EXACT.pm »