Branch Coverage

blib/lib/Mail/SpamAssassin/Plugin/Check.pm
Criterion Covered Total %
branch 196 460 42.6


line true false branch
57 0 96 if (ref $suppl_attrib and ref $suppl_attrib->{'rule_hits'})
61 0 0 if ref $caller_rule_hit ne "HASH"
66 0 0 !defined($score) ? :
0 0 !defined($defscore) ? :
0 0 !defined($value) ? :
0 0 !defined($tflags) ? :
0 0 !defined($description) ? :
91 96 0 if $master_deadline
99 0 258 unless $pms->{'conf'}{'priorities'}{$priority} > 0
101 0 258 if ($pms->{'deadline_exceeded'}) { }
0 258 elsif ($master_deadline and &Mail::SpamAssassin::Plugin::Check::time() > $master_deadline) { }
0 258 elsif ($self->{'main'}->call_plugins('have_shortcircuited', {'permsgstatus', $pms})) { }
121 81 81 if ($priority >= 500 and $needs_dnsbl_harvest_p and not $self->{'main'}->call_plugins("have_shortcircuited", {"permsgstatus", $pms}))
133 1 80 if $pms->{'resolver'}
144 0 258 if $pms->{'deadline_exceeded'}
148 0 258 if $pms->{'deadline_exceeded'}
152 0 258 if $pms->{'deadline_exceeded'}
156 0 258 if $pms->{'deadline_exceeded'}
160 0 258 if $pms->{'deadline_exceeded'}
164 0 258 if $pms->{'deadline_exceeded'}
168 0 258 if $pms->{'deadline_exceeded'}
172 0 258 if $pms->{'deadline_exceeded'}
176 0 258 if $pms->{'deadline_exceeded'}
180 0 258 if $pms->{'deadline_exceeded'}
186 0 258 if $pms->{'deadline_exceeded'}
191 15 81 if ($needs_dnsbl_harvest_p)
192 15 0 unless ($self->{'main'}->call_plugins("have_shortcircuited", {"permsgstatus", $pms}))
202 0 15 if $pms->{'resolver'}
205 0 96 if ($pms->{'deadline_exceeded'})
216 0 96 if ($pms->{'deadline_exceeded'}) { }
0 96 elsif ($master_deadline and &Mail::SpamAssassin::Plugin::Check::time() > $master_deadline) { }
228 0 96 if ($self->{'done_user_rules'})
231 0 0 if ($counters->{$type} > 0)
258 92 4 if ($self->{'main'}{'local_tests_only'})
265 0 0 unless $score
270 0 0 unless (exists $pms->{'conf'}{'eval_plugins'}{$function})
278 0 0 unless (eval {
279 0 0 $@ ne '' ? :
280 0 0 if $eval_stat =~ /__alarm__ignore__/
295 0 1548 if ($pms->{'deadline_exceeded'}) { }
0 1548 elsif ($master_deadline and &Mail::SpamAssassin::Plugin::Check::time() > $master_deadline) { }
0 1548 elsif ($self->{'main'}->call_plugins('have_shortcircuited', {'permsgstatus', $pms})) { }
312 0 1548 if ($doing_user_rules)
320 150 1398 if (not defined &{$methodname;} or $doing_user_rules)
346 75 75 if (defined $opts{'pre_loop_body'})
354 50 100 if (defined $opts{'post_loop_body'})
401 0 150 unless ($eval_result)
402 0 0 $@ ne '' ? :
418 0 0 if ($t->timed_out and $master_deadline and &Mail::SpamAssassin::Plugin::Check::time() > $master_deadline)
427 300 0 if ($self->{'evalstr_chunk_methodnames'})
463 0 81 if ($r)
0 81 if ($r)
465 0 150 if (not $eval_result) { }
466 0 0 $@ ne '' ? :
494 124 150 if (defined $str and $str ne "")
499 0 124 if ($self->{'evalstr_l'} > 60000)
508 281 0 if (defined $str)
532 0 0 if (exists $pms->{'ruleglob_cache'}{$ruleglob}) { }
539 0 0 if /^$reglob$/
540 0 0 if (@rules) { }
546 0 0 $expanded eq '0' ? :
581 40 56 if ($token =~ /^(?^:[_a-zA-Z][_a-zA-Z0-9]{0,127})$/) { }
587 0 40 if (not exists $conf->{'scores'}{$token}) { }
0 40 elsif ($conf->{'scores'}{$token} == 0) { }
594 0 0 unless (($conf->get_score_set & 1) == 0 and ($conf->{'tflags'}{$token} || '') =~ /\bnet\b/)
603 0 40 if exists $conf->{'meta_tests'}{$opts{'priority'}}{$token}
639 0 16 if grep $metas{$_}, @{$rule_deps{$metas[$i]};}
643 0 16 unless (defined $conf->{'meta_dependencies'}{$metas[$i]})
650 0 16 if ($alldeps ne "")
673 0 0 if ($self->{'main'}{'lint_rules'}) { }
705 8 64 if (exists $conf->{'test_opt_exists'}{$rulename}) { }
707 0 8 if (exists $conf->{'test_opt_neg'}{$rulename}) { }
715 16 48 $conf->{'test_opt_neg'}{$rulename} ? :
719 56 16 !defined($def) ? :
723 0 72 if $opts{'doing_user_rules'} and not $self->is_user_rule_sub($rulename . "_head_test")
741 40 16 !defined($def) ? :
749 72 0 if defined $tc_ref
758 8 64 if (not $op_infix) { }
763 0 64 if (($conf->{'tflags'}{$rulename} || '') =~ /\bmultiple\b/)
767 0 0 if ($conf->{'tflags'}{$rulename} =~ /\bmaxhits=(\d+)\b/)
771 0 64 if ($matchg) { }
813 0 28 if (would_log("dbg", "rules-all") == 2)
819 0 28 if ($nosubject)
824 0 28 if (($conf->{'tflags'}{$rulename} || '') =~ /\bmultiple\b/) { }
834 0 0 if ($nosubject)
839 0 0 $max ? :
856 0 28 if ($nosubject)
879 0 28 if $opts{'doing_user_rules'} and not $self->is_user_rule_sub($rulename . "_body_test")
898 0 8 if (would_log("dbg", "rules-all") == 2)
903 0 8 if (($conf->{'tflags'}{$rulename} || '') =~ /\bmultiple\b/) { }
907 0 0 $max ? :
939 0 8 if $opts{'doing_user_rules'} and not $self->is_user_rule_sub($rulename . "_uri_test")
958 0 0 if (would_log("dbg", "rules-all") == 2)
963 0 0 if (($pms->{'conf'}{'tflags'}{$rulename} || '') =~ /\bmultiple\b/) { }
969 0 0 $max ? :
1002 0 0 if $opts{'doing_user_rules'} and not $self->is_user_rule_sub($rulename . "_rawbody_test")
1053 96 162 unless defined $pms->{'conf'}{'head_evals'}{$priority}
1061 177 81 unless defined $pms->{'conf'}{'body_evals'}{$priority}
1069 258 0 unless defined $pms->{'conf'}{'rawbody_evals'}{$priority}
1077 177 81 unless defined $pms->{'conf'}{'full_evals'}{$priority}
1087 0 324 if ($pms->{'deadline_exceeded'}) { }
0 324 elsif ($master_deadline and &Mail::SpamAssassin::Plugin::Check::time() > $master_deadline) { }
0 324 elsif ($self->{'main'}->call_plugins('have_shortcircuited', {'permsgstatus', $pms})) { }
1100 0 324 if ($doing_user_rules)
1115 126 198 if (defined &{"${package_name}::$methodname";} and not $doing_user_rules)
1125 0 0 if ($t->timed_out and $master_deadline and &Mail::SpamAssassin::Plugin::Check::time() > $master_deadline)
1145 0 198 if (would_log("dbg"))
1150 1297 523 if ($tflagsref->{$rulename})
1152 400 897 if ($tflagsref->{$rulename} =~ /\bnet\b/)
1153 390 10 if ($scoreset & 1) == 0
1156 78 829 if ($tflagsref->{$rulename} =~ /\blearn\b/)
1157 78 0 if ($scoreset & 2) == 0
1162 0 1352 unless $scoresref->{$rulename}
1165 0 1352 unless ($function)
1170 0 1352 unless (exists $conf->{'eval_plugins'}{$function})
1182 1352 0 if ($eval_pluginsref->{$function})
1193 0 1352 if ($have_start_rules)
1215 0 1352 if ($have_ran_rule)
1236 77 121 unless $evalstr
1263 0 0 if $@ =~ /__alarm__ignore__/
0 30 unless (eval {
1 24 if ($result)
0 13 if $@ =~ /__alarm__ignore__/
0 25 unless (eval {
4 21 if ($result)
13 0 if $@ =~ /__alarm__ignore__/
0 30 unless (eval {
18 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
5 7 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
1 11 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
0 0 if $@ =~ /__alarm__ignore__/
0 12 unless (eval {
0 12 if ($result)
1265 0 121 if (not $eval_result) { }
1266 0 0 $@ ne '' ? :
1279 0 0 if ($t->timed_out and $master_deadline and &Mail::SpamAssassin::Plugin::Check::time() > $master_deadline)
1301 0 0 if eval "defined &" . $package_name . "::" . $subname
1309 0 132 if ($self->{'main'}->have_plugin("start_rules"))
1331 7 88 if ($matching_string_unavailable) { }
1339 0 95 if (exists $pms->{'should_log_rule_hits'})
1347 0 95 if ($pms->{'save_pattern_hits'})
1356 32 63 if ($loop_break_directive and not +($pms->{'conf'}{'tflags'}{$rulename} || '') =~ /\bmultiple\b/)
1367 95 0 unless $self->{'main'}->have_plugin("ran_rule")
1380 0 132 if $pms->{'conf'}{'allow_user_rules'}
1383 132 0 if (exists $pms->{'conf'}{$type . "_tests"}{$pri})