Branch Coverage

blib/lib/SVN/Notify.pm
Criterion Covered Total %
branch 223 284 78.5


line true false branch
687 346 3060 if (my $handler = delete $params{'handler'})
689 346 0 unless ($subclass eq $class)
690 0 346 unless eval "require $subclass"
697 716 2344 if (ref $params{'filters'} eq 'ARRAY')
700 777 1 unless $pkg =~ /::/
701 308 470 if ($filters{$pkg}) { }
707 0 470 unless eval "require $pkg"
711 116 769 unless my $code = *{$v;}{'CODE'}
722 966 2094 unless ref $params{'to'}
725 3 3057 if $params{'verbose'}
727 1 3059 unless $params{'repos_path'}
729 1 3058 unless $params{'revision'}
740 3050 8 unless $params{'smtp'}
743 0 3058 unless $params{'sendmail'} or $params{'smtp'}
747 210 2848 if ($params{'language'} and not $ENV{'LANG'})
751 0 420 if uc $encoding ne 'UTF-8'
760 0 3058 if ($params{'revision_url'} and not $params{'revision_url'} =~ /%s/)
767 77 2981 if ($params{'ticket_regex'})
773 283 11949 if ($params{$param})
775 0 283 unless $$track{$system} =~ /%s/
779 77 2981 if $track
782 3 3055 if $params{'verbose'}
830 665 0 if (my $opt = shift())
917 0 4 unless Getopt::Long::GetOptions('repos-path|p=s', \$$opts{'repos_path'}, 'revision|r=s', \$$opts{'revision'}, 'to|t=s@', \$$opts{'to'}, 'to-regex-map|x=s%', \$$opts{'to_regex_map'}, 'to-email-map=s%', \$$opts{'to_email_map'}, 'from|f=s', \$$opts{'from'}, 'user-domain|D=s', \$$opts{'user_domain'}, 'svnlook|l=s', \$$opts{'svnlook'}, 'sendmail|s=s', \$$opts{'sendmail'}, 'set-sender|E', \$$opts{'set_sender'}, 'smtp=s', \$$opts{'smtp'}, 'smtp-port=i', \$$opts{'smtp_port'}, 'smtp-tls!', \$$opts{'smtp_tls'}, 'encoding|charset|c=s', \$$opts{'encoding'}, 'diff-encoding=s', \$$opts{'diff_encoding'}, 'svn-encoding=s', \$$opts{'svn_encoding'}, 'language|g=s', \$$opts{'language'}, 'with-diff|d', \$$opts{'with_diff'}, 'attach-diff|a', \$$opts{'attach_diff'}, 'diff-switches|w=s', \$$opts{'diff_switches'}, 'diff-content-type=s', \$$opts{'diff_content_type'}, 'reply-to|R=s', \$$opts{'reply_to'}, 'subject-prefix|P=s', \$$opts{'subject_prefix'}, 'subject-cx|C', \$$opts{'subject_cx'}, 'strip-cx-regex|X=s@', \$$opts{'strip_cx_regex'}, 'no-first-line|O', \$$opts{'no_first_line'}, 'max-sub-length|i=i', \$$opts{'max_sub_length'}, 'max-diff-length|e=i', \$$opts{'max_diff_length'}, 'handler|H=s', \$$opts{'handler'}, 'filter|F=s@', \$$opts{'filters'}, 'author-url|A=s', \$$opts{'author_url'}, 'ticket-regex=s', \$$opts{'ticket_regex'}, 'ticket-map=s%', \$$opts{'ticket_map'}, 'verbose|V+', \$$opts{'verbose'}, 'help|h', \$$opts{'help'}, 'man|m', \$$opts{'man'}, 'version|v', \$$opts{'version'}, 'header=s', \$$opts{'header'}, 'footer=s', \$$opts{'footer'}, 'smtp-user=s', \$$opts{'smtp_user'}, 'smtp-pass=s', \$$opts{'smtp_pass'}, 'smtp-authtype=s', \$$opts{'smtp_authtype'}, 'add-header=s%', sub { shift(); push @{$$opts{'add_headers'}{shift()};}, shift(); } , 'revision-url|U|svnweb-url|S|viewcvs-url=s', \$$opts{'revision_url'}, 'rt-url|T|bugzilla-url|B|jira-url|J|gnats-url|G|ticket-url=s', \$$opts{'ticket_url'})
923 1 3 if (my $hand = $$opts{'handler'})
924 0 1 unless eval 'require SVN::Notify' . "::$hand"
925 0 1 if ($hand eq 'Alternative')
930 0 0 unless $$opts{'alternatives'}
931 0 0 unless eval 'require SVN::Notify' . "::$alt"
937 1 3 if ($$opts{'filters'})
939 1 0 unless $pkg =~ /::/
940 0 1 unless eval "require $pkg"
947 2 2 if (%OPTS) { }
988 26 58 if $$opts{$opt}
1047 1 2 if -f $file and -x _
1083 1 0 unless @{$$self{'to'};} or $$self{'to_regex_map'} or $$self{'to_email_map'}
1085 0 2707 unless @{$$self{'to'};}
1114 3 2796 if $$self{'verbose'}
1115 2493 231 unless ($$self{'to_regex_map'} or $$self{'subject_cx'} or $$self{'to_email_map'})
1130 71 160 $$self{'to_email_map'} ? :
75 231 $$self{'to_regex_map'} ? :
0 306 $$self{'to_regex_map'} && $$self{'to_email_map'} ? :
1133 146 160 if ($regexen) { }
1134 0 146 if $$self{'verbose'} > 1
1137 0 438 if $$self{'verbose'} > 2
1146 0 306 if $$self{'svn_env_lang'}
1163 2448 6192 if (/$rx/)
1164 0 2448 if $$self{'verbose'} > 2
1165 288 2160 unless $seen{$email}++
1169 2113 2880 if ($$self{'subject_cx'})
1176 0 300 if $$self{'subject_cx'} and $$self{'verbose'} > 1
1178 0 300 unless close $fh
1181 0 300 if $$self{'verbose'} > 1
1200 3 2790 if $$self{'verbose'}
1201 210 2583 if $$self{'svn_env_lang'}
1210 2709 0 unless ($$self{'from'})
1211 43 2666 $$self{'user_domain'} ? :
1216 2 2707 if ($$self{'verbose'} > 1)
1243 2 2707 if $$self{'verbose'}
1245 207 2502 if $$self{'svn_env_lang'}
1258 46761 0 if (s/^(.)(.)\s+//)
1259 0 46761 if $$self{'verbose'} > 2
1261 2404 44357 if $2 ne ' ' and $1 ne '_'
1265 51 2574 if ($$self{'subject_cx'} and $. == 1)
1269 0 51 if $$self{'verbose'} > 1
1274 0 2625 unless close $fh
1298 1 2624 if $$self{'verbose'}
1303 127 2498 if (defined $$self{'subject_prefix'}) { }
1304 59 68 if (index($$self{'subject_prefix'}, '%d') > 0) { }
1316 148 2477 if ($$self{'cx'})
1317 42 106 if (my $rx = $$self{'strip_cx_regex'})
1320 42 106 $$self{'no_first_line'} ? :
1321 148 0 if $$self{'cx'}
1325 2583 42 unless ($$self{'no_first_line'})
1328 2583 0 if $min > 10
1330 2538 45 $i > 0 ? :
1336 45 2580 if $$self{'max_sub_length'} and length $$self{'subject'} > $$self{'max_sub_length'}
1342 1 2624 if $$self{'verbose'}
1362 1 2624 if $$self{'verbose'}
1364 0 2625 unless @{$$self{'to'};}
1366 4 2621 $$self{'smtp'} ? :
1367 204 2417 if $$self{'env_lang'}
1368 0 2621 $$self{'set_sender'} ? :
1379 0 2514 unless close $out
1380 1 2513 if $$self{'verbose'}
1424 1 2661 if $$self{'verbose'} > 1
1425 2434 228 unless $no_headers
1431 704 1958 if ($$self{'with_diff'}) { }
1434 155 520 if ($$self{'attach_diff'}) { }
1462 0 2543 if $$self{'verbose'} > 2
1481 64 2479 if $$self{'reply_to'}
1483 1 2542 if (my $heads = $$self{'add_headers'})
1485 1 1 ref $v ? :
1514 0 2662 if $$self{'verbose'} > 2
1516 159 2503 if ($$self{'attach_diff'})
1524 159 2503 if $$self{'attach_diff'}
1525 201 2461 $$self{'language'} ? :
1545 15 1570 $$self{'header'} ? :
1547 62 1523 if $start and @$start
1567 103 1507 if (my $url = $$self{'revision_url'})
1573 32 1578 if (my $url = $$self{'author_url'})
1595 1 1584 if $$self{'verbose'} > 1
1603 103 1482 if (my $url = $$self{'revision_url'})
1604 103 0 if (my(@matches) = $msg =~ /\b(?:(?:rev(?:ision)?\s*#?\s*|r)(\d+))\b/gi)
1611 26 1559 if (my $map = $self->ticket_map)
1616 26 208 unless ($has_header)
1642 0 1607 unless my $files = $$self{'files'}
1643 1 1606 if $$self{'verbose'} > 1
1650 369 6059 unless $$files{$type}
1651 0 6059 if $$self{'verbose'} > 2
1682 0 1576 if $$self{'verbose'} > 2
1683 15 1561 $$self{'footer'} ? :
1685 62 1514 if $end and @$end
1702 0 228 if $$self{'verbose'} > 1
1719 0 155 if $$self{'verbose'} > 2
1720 75 80 $$self{'language'} ? :
1743 155 2478 if $$self{'attach_diff'}
1763 0 65 unless my $map = $self->ticket_map
1784 36852 1329 unless my $filters = $$self{'filters'}{$type}
1825 48 0 if defined $_
1831 48 656 $$self{'diff_switches'} ? :
1851 12 371 if (my $max = $$self{'max_diff_length'}) { }
1855 276 12 if (($length += length $_) < $max) { }
1872 0 383 unless close $diff
1933 32729 53 unless @_
1951 156 0 unless @_
1952 0 0 if (my $url = shift()) { }
1966 117 0 wantarray ? :
117 0 unless @_
2310 5 9128 if $$self{'verbose'}
2324 0 9133 unless defined $pid
2326 8848 285 if ($pid) { }
2328 8848 0 if $encode
2332 0 0 unless exec @_
2348 0 2709 unless close $fh
2367 3 0 unless $0 =~ /\bsvnnotify(?:[.]bat)?$/
2390 1 3 $$notifier{'smtp_port'} ? :
0 4 $$notifier{'smtp_tls'} ? :
1 3 $$notifier{'smtp_user'} ? :
1 3 $$notifier{'smtp_pass'} ? :
1 3 $$notifier{'verbose'} ? :
0 4 unless my $smtp = 'Net::SMTP::TLS'->new($$notifier{'smtp'}, 'Hello', Sys::Hostname::hostname(), $$notifier{'smtp_port'} ? ('Port', $$notifier{'smtp_port'}) : (), $$notifier{'smtp_tls'} ? () : ('NoTLS', 1), $$notifier{'smtp_user'} ? ('User', $$notifier{'smtp_user'}) : (), $$notifier{'smtp_pass'} ? ('Password', $$notifier{'smtp_pass'}) : (), $$notifier{'verbose'} ? ('Debug', 1) : ())