Branch Coverage

File:blib/lib/Email/Abuse/Investigator.pm
Coverage:65.6%

line%coveragebranch
63750TFif ($HAS_CHI and not $_cache)
100TFif ($HAS_CHI and not $_cache)
75750TFif ref $text eq "SCALAR"
50TFif ref $text eq "SCALAR"
760100TFif ref $text
100TFif ref $text
764100TFif defined $text
0TFif defined $text
781100TFif defined $text and $text =~ /\S/
50TFif defined $text and $text =~ /\S/
1071100TFif $dom and not $seen{$dom}++
100TFif $dom and not $seen{$dom}++
1077100TFif $dom and not $seen{$dom}++
100TFif $dom and not $seen{$dom}++
114450TFunless ($dom)
100TFunless ($dom)
114850TFif $dom
100TFif $dom
1154100TFif $u->{'abuse'} and $u->{'abuse'} ne "(unknown)"
50TFif $u->{'abuse'} and $u->{'abuse'} ne "(unknown)"
1162100TFif $covered{$bare}
100TFif $covered{$bare}
1163100TFif $self->_provider_abuse_for_host($bare)
0TFif $self->_provider_abuse_for_host($bare)
1164100TFif $seen{"url:$bare"}++
0TFif $seen{"url:$bare"}++
1176100TFif $source =~ /^(?:From:|Return-Path:|Sender:) header$/
50TFif $source =~ /^(?:From:|Return-Path:|Sender:) header$/
1177100TFif $covered{lc $dom}
50TFif $covered{lc $dom}
117850TFif $self->_provider_abuse_for_host($dom)
50TFif $self->_provider_abuse_for_host($dom)
117950TFif $seen{"dom:$dom"}++
50TFif $seen{"dom:$dom"}++
1388100TFif $self->{'_risk'}
50TFif $self->{'_risk'}
1407100TF$score >= $SCORE_LOW ? :
100TF$score >= $SCORE_MEDIUM ? :
100TF$score >= $SCORE_HIGH ? :
0TF$score >= $SCORE_LOW ? :
50TF$score >= $SCORE_MEDIUM ? :
50TF$score >= $SCORE_HIGH ? :
1782100TFif (@{$risk->{'flags'};})
0TFif (@{$risk->{'flags'};})
1792100TFif ($orig)
0TFif ($orig)
1801100TFif (@urls)
0TFif (@urls)
180650TFif $u->{'host'}
0TFif $u->{'host'}
1807100TFif $u->{'ip'} and $u->{'ip'} ne "(unresolved)"
0TFif $u->{'ip'} and $u->{'ip'} ne "(unresolved)"
1808100TFif $u->{'org'} and $u->{'org'} ne "(unknown)"
0TFif $u->{'org'} and $u->{'org'} ne "(unknown)"
180950TFif @meta
0TFif @meta
1816100TFif (@contacts)
0TFif (@contacts)
1823100TFif (my(@form_cs) = $self->form_contacts)
0TFif (my(@form_cs) = $self->form_contacts)
182950TFif $c->{'form_domain'}
0TFif $c->{'form_domain'}
183050TFif $c->{'form_paste'}
0TFif $c->{'form_paste'}
183150TFif $c->{'form_upload'}
0TFif $c->{'form_upload'}
2273100TFunless $form
0TFunless $form
2274100TFif $seen{$form}++
0TFif $seen{$form}++
2280100TFif ($orig)
0TFif ($orig)
2282100TFif ($pa and $pa->{'form'})
0TFif ($pa and $pa->{'form'})
2297100TFif $url_host_seen{$u->{'host'}}++
0TFif $url_host_seen{$u->{'host'}}++
2299100TFif ($pa and $pa->{'form'})
0TFif ($pa and $pa->{'form'})
2316100TFif ($pa and $pa->{'form'})
0TFif ($pa and $pa->{'form'})
2329100TFif ($d->{'registrar_abuse'} and $d->{'registrar_abuse'} =~ /\@([\w.-]+)/)
0TFif ($d->{'registrar_abuse'} and $d->{'registrar_abuse'} =~ /\@([\w.-]+)/)
2332100TFif ($rpa and $rpa->{'form'})
0TFif ($rpa and $rpa->{'form'})
2349100TF$val =~ /<([^>]*)>\s*$/ ? :
0TF$val =~ /<([^>]*)>\s*$/ ? :
2351100TFunless $addr_domain
0TFunless $addr_domain
2353100TFif $addr_spec =~ /\+SRS[0-9]?=/i
0TFif $addr_spec =~ /\+SRS[0-9]?=/i
2355100TFif ($pa and $pa->{'form'})
0TFif ($pa and $pa->{'form'})
2356100TF$addr_spec =~ /@/ ? :
0TF$addr_spec =~ /@/ ? :
2371100TFif ($auth->{'dkim_domain'})
0TFif ($auth->{'dkim_domain'})
2373100TFif ($pa and $pa->{'form'})
0TFif ($pa and $pa->{'form'})
2387100TFif ($unsub)
0TFif ($unsub)
2394100TFif ($pa and $pa->{'form'})
0TFif ($pa and $pa->{'form'})
2477100TFunless defined $v
0TFunless defined $v
2480100TF$decoded ne $v ? :
0TF$decoded ne $v ? :
2488100TFif (@{$risk->{'flags'};}) { }
0TFif (@{$risk->{'flags'};}) { }
2499100TFif (my $orig = $self->originating_ip) { }
0TFif (my $orig = $self->originating_ip) { }
2501100TFif $orig->{'rdns'}
0TFif $orig->{'rdns'}
2502100TFif $orig->{'country'}
0TFif $orig->{'country'}
2503100TFif $orig->{'org'}
0TFif $orig->{'org'}
250450TFif $orig->{'abuse'}
0TFif $orig->{'abuse'}
2506100TFif $orig->{'note'}
0TFif $orig->{'note'}
2514100TFif (@sw)
0TFif (@sw)
2524100TFunless defined $_->{'id'}
0TFunless defined $_->{'id'}
2526100TFif (@trail)
0TFif (@trail)
2532100TFif $hop->{'for'}
0TFif $hop->{'for'}
2533100TFif $hop->{'id'}
0TFif $hop->{'id'}
2541100TFif (@urls) { }
2546100TFunless (exists $host_order{$h})
0TFunless (exists $host_order{$h})
2563100TF$URL_SHORTENERS{$bare} || $self->{'url_shorteners'}{$bare} ? :
2565100TFif $m->{'ip'}
2566100TFif $m->{'country'}
256750TFif $m->{'org'}
256850TFif $m->{'abuse'}
2570100TFif (@paths == 1) { }
2586100TFif (@mdoms) { }
2590100TFif ($d->{'recently_registered'})
2593100TFif $d->{'registered'}
2594100TFif $d->{'expires'}
2595100TFif $d->{'registrar'}
2596100TFif $d->{'registrar_abuse'}
2597100TFif ($d->{'web_ip'}) { }
2599100TFif $d->{'web_org'}
2600100TFif $d->{'web_abuse'}
2604100TFif ($d->{'mx_host'}) { }
260650TFif $d->{'mx_ip'}
260750TFif $d->{'mx_org'}
260850TFif $d->{'mx_abuse'}
2612100TFif ($d->{'ns_host'})
261450TFif $d->{'ns_ip'}
261550TFif $d->{'ns_org'}
261650TFif $d->{'ns_abuse'}
2628100TFif (@contacts) { }
263250TFif $c->{'note'}
2643100TFif (@form_cs)
265150TFif $c->{'form_domain'}
265250TFif $c->{'note'}
265350TFif ($c->{'form_paste'})
2659100TFif (defined $line and length "$line $w" > $ROLE_WRAP_LEN) { }
2663100TFdefined $line ? :
266650TFif defined $line
266750TFif @lines
267050TFif $c->{'form_upload'}
3726100TFif $host =~ /^\d{1,3}(?:\.\d{1,3}){3}$/
3729100TFif ($_cache)
373150TFif defined $cached_ip
3736100TFif ($HAS_NET_DNS) { }
3745100TFif ($query)
3747100TFif ($rr->type eq 'A') { }
100TFelsif ($rr->type eq 'AAAA') { }
3756100TFif defined $ip
3761100TF$packed ? :
3765100TFif ($_cache)
3786100TFunless $ip
378850TFif ($HAS_NET_DNS)
379150TFif ($query)
3793100TFif $rr->type eq "PTR"
3824100TFif ($_cache)
382650TFif $cached
3829100TF$HAS_LWP ? :
3832100TFunless ($result->{'org'})
3834100TFif ($raw)
3836100TF$ref ? :
3837100TFif $detail
3842100TFif $_cache and $result
3863100TFunless $server
3925100TFunless $HAS_LWP
3928100TFunless (defined $ua)
3934100TFif ($HAS_CONN_CACHE)
3948100TFunless ($safe_ip =~ /\A\d{1,3}(?:\.\d{1,3}){3}\z/ or $safe_ip =~ /\A[0-9a-fA-F:]+\z/)
3957100TFunless $res and $res->is_success
3963100TFif ($j =~ /"name"\s*:\s*"([^"]+)"/)
3964100TFif ($j =~ /"handle"\s*:\s*"([^"]+)"/)
396750TFif ($j =~ /"abuse".*?"email"\s*:\s*"([^"]+)"/s) { }
50TFelsif ($j =~ /"email"\s*:\s*"([^\@"]+\@[^"]+)"/) { }
397450TFif ($j =~ /"country"\s*:\s*"([A-Z]{2})"/)
4020100TFunless length $safe_query
4027100TF$HAS_IO_SOCKET_IP ? :
4038100TFunless $sock
4041100TFunless ($sock->print("$safe_query\r\n"))
4053100TFif ($@ or not defined $n or $n <= 0)
4054100TFif $@
4057100TFif not defined $n or $n <= 0
437950TFunless defined $params and defined $params->{'name'}
438050TFif ref $params->{'name'}