Condition Coverage

blib/lib/Mail/DKIM/Iterator.pm
Criterion Covered Total %
condition 77 163 47.2


and 3 conditions

line !l l&&!r l&&r condition
108 24 0 22 $self->{'extract_sig'} and my(@sig) = _parse_header($self->{'header'})
163 0 0 0 $self->{'header'} and $self->{'sig'}
226 96 0 1 $sig->{'x'} and $sig->{'x'} < time
233 78 0 18 $txt and !ref($txt) || ref $txt eq 'ARRAY'
77 0 1 exists $self->{'records'}{$dns} and not $txt
268 67 2 0 $v->{'l'} and not $v->{'l'} =~ /^\d{1,76}\z/
299 46 2 0 defined $v->{'x'} and not $v->{'x'} =~ /^\+?\d{1,12}\z/
303 0 0 21 $v->{'b'} && ($v->{'b:bin'} = _decode64($v->{'b'}))
0 0 21 $v->{'bh'} && ($v->{'bh:bin'} = _decode64($v->{'bh'}))
21 0 0 $v->{'t'} and not $v->{'t'} =~ /^\d{1,12}\z/
310 1 0 0 $v->{'t'} and $v->{'x'} < $v->{'t'}
355 0 1 17 $v and %$v
395 0 2 22 ref $sig and $sig->{'h_auto'}
406 132 0 22 exists $oh{$k} and --$oh{$k} == 0
415 0 24 0 not $sig{'t'} and exists $sig{'t'}
417 23 1 0 $sig{'x'} and $sig{'x'} =~ /^\+(\d+)$/
478 0 0 24 $dkh =~ /\n([^\n]+)\z/ && length $1
495 38 57 1 defined $sig->{'bh:computed'} and $sig->{'bh:computed'} ne $sig->{'bh:bin'}
512 17 0 0 $param->{'t'}{'s'} and $sig->{'i:domain'}
0 0 0 $param->{'t'}{'s'} and $sig->{'i:domain'} and $sig->{'i:domain'} ne $sig->{'d'}
515 17 0 0 $param->{'g'} and not $sig->{'i'} =~ /$param->{'g'}/
726 1 0 45 not $sig->{'error'} and my $digest = $digest{$sig->{'a:hash'}}()
1 0 45 not $sig->{'error'} and my $digest = $digest{$sig->{'a:hash'}}() and my $transform = $bodyc{$sig->{'c:body'}}()
869 0 0 0 defined $self->[3] and $self->[3] ne ""

or 2 conditions

line l !l condition
65 0 46 $args{'dns'} || {}
75 2 22 $_->{'h'} //= "from"
78 2 22 $s->{'h_auto'} //= 1
113 0 22 $self->{'sig'} ||= []
202 0 1 $sig->{'s'} // "UNKNOWN"
0 1 $sig->{'d'} // "UNKNOWN"
261 22 0 $v = parse_taglist($v, $error) or return
265 24 24 $v->{'v'} //= 1
268 70 0 $v->{'v'} // ""
269 1 0 $v->{'v'} || ''
279 45 24 $v->{'q'} // "dns/txt"
287 59 10 $v->{'a'} // "rsa-sha256"
288 59 10 $v->{'c'} // "simple/simple"
304 0 0 $v->{'b'} || ''
306 0 0 $v->{'bh'} || ''
322 0 0 $$error ||= "[i]dentity does not match [d]omain"
335 57 12 $bodyc ||= "simple"
354 18 0 $v = parse_taglist($v, $error) or return
360 17 0 $v->{'v'} ||= "DKIM1"
0 17 $v->{'k'} //= "rsa"
375 0 17 $v->{'t'} || ''
376 0 17 $v->{'h'} || 'sha1:sha256'
377 0 17 $v->{'s'} || '*'
400 22 0 $sig->{'h'} || ''
430 194 118 delete $sig{$_} // (next)
435 24 0 delete $sig{$_} // (next)
583 39 0 $sig_prefix{$algo} || die("unsupport digest $algo")
636 157 310 $kv{$k} ||= [$hdr =~ /^($k:[^\n]*\n(?:[ \t][^\n]*\n)*)/mig]
639 175 292 pop @$v // ""
870 0 0 $self->[0]{'d'} // "unknown"
884 0 0 $sig->{'s'} || 'UNKNOWN'
0 0 $sig->{'d'} || 'UNKNOWN'

or 3 conditions

line l !l&&r !l&&!r condition
233 18 0 0 !ref($txt) || ref $txt eq 'ARRAY'
333 0 0 0 $$error ||= "invalid canonicalization $v->{'c'}"
337 0 0 0 $$error ||= "unsupported algorithm $v->{'a'}"
378 17 0 0 $v->{'s'}{'*'} or $v->{'s'}{'email'}
417 0 0 0 $sig{'t'} || time
425 24 0 0 $sig{'bh:computed'} || $sig{'bh:bin'}
725 41 46 0 $sig->{'bh:collecting'} ||= do { if (not $sig->{'error'} and my $digest = $digest{$sig->{'a:hash'}}() and my $transform = $bodyc{$sig->{'c:body'}}()) { +{"digest", $digest, "transform", $transform, $sig->{'l'} ? ("l", $sig->{'l'}) : (defined $sig->{'l'} ? ("l", \$sig->{'l'}) : ())}; } else { +{"done", 1}; } }
758 0 1 0 $bh->{'_data_after_l'} ||= substr($tbuf, $bh->{'l'}, -$bh->{'l'}, "") =~ /\S/ & 1
761 0 0 0 $bh->{'_data_after_l'} ||= $tbuf =~ /\S/ & 1