Branch Coverage

blib/lib/Pod/Perldoc.pm
Criterion Covered Total %
branch 18 632 2.8


line true false branch
20 1 0 unless (defined &Pod::Perldoc::DEBUG)
21 0 1 if (($ENV{'PERLDOCDEBUG'} || '') =~ /^(\d+)/) { }
23 0 0 if $@
37 0 0 if defined &Pod::Perldoc::DEBUG
42 0 0 unless $self->debugging
65 0 1 $^O eq 'VMS' ? :
1 0 unless defined &Pod::Perldoc::is_vms
66 0 1 $^O eq 'MSWin32' ? :
1 0 unless defined &Pod::Perldoc::is_mswin32
67 0 1 $^O eq 'dos' ? :
1 0 unless defined &Pod::Perldoc::is_dos
68 0 1 $^O eq 'os2' ? :
1 0 unless defined &Pod::Perldoc::is_os2
69 0 1 $^O eq 'cygwin' ? :
1 0 unless defined &Pod::Perldoc::is_cygwin
70 1 0 $^O eq 'linux' ? :
1 0 unless defined &Pod::Perldoc::is_linux
71 0 1 $^O =~ /hpux/ ? :
1 0 unless defined &Pod::Perldoc::is_hpux
72 0 1 $^O eq 'amigaos' ? :
1 0 unless defined &Pod::Perldoc::is_amigaos
109 0 0 if ($value =~ /^([-_a-zA-Z][-_a-zA-Z0-9]*)(?:[=\:](.*?))?$/s) { }
111 0 0 defined $2 ? :
122 0 0 unless defined $classes and length $classes
126 0 0 unless $classname =~ /\S/
127 0 0 if ($classname =~ /^(\w+(::\w+)+)$/s) { }
146 0 0 defined &Win32::BuildNumber && defined &Win32::BuildNumber() ? :
161 0 0 if @_ and $_[0]
167 0 0 if @_ and $_[0]
174 0 0 if @_ and $_[0]
180 0 0 unless defined $rest and length $rest
181 0 0 if ($rest =~ /^(\w+)$/s) { }
245 0 0 if ($self->opt_D)
265 0 0 if @_
330 0 0 if (my $link = readlink $0)
356 0 0 if $untainted
375 0 0 if $untainted
421 0 0 if (@_ > 2) { }
437 0 0 if ($] < 5.008) { }
456 0 0 unless exists $self->{'pagers'}
457 0 0 unless exists $self->{'bindir'}
458 0 0 unless exists $self->{'pod2man'}
459 0 0 unless exists $self->{'search_path'}
492 0 0 unless $self->is_mswin32 or $self->is_dos or $self->is_amigaos or not $ENV{'TERM'} && !(($ENV{'TERM'} || '') =~ /dumb|emacs|none|unknown/i)
521 0 0 unless @{$self->{'args'};}
525 0 0 unless $self->opt_U or $self->opt_F
536 0 0 if ($self->opt_f) { }
0 0 elsif ($self->opt_q) { }
0 0 elsif ($self->opt_v) { }
0 0 elsif ($self->opt_a) { }
545 0 0 unless @pages
554 0 0 $self->is_vms ? :
0 0 unless @found
556 0 0 if ($self->opt_l and not $self->opt_q)
564 0 0 if $self->opt_m
576 0 0 unless $self->{'formatter_classes'}
577 0 0 unless @class_list
580 0 0 if $INC[-1] eq '.'
585 0 0 if ($class_loaded{$c})
591 0 0 if ($class_seen{$c})
599 0 0 if ($c->can('parse_from_file')) { }
0 0 elsif ($self->is_os2 || $self->is_mswin32 || $self->is_dos || $self->is_os2 and $class_seen{lc "~$c"}++) { }
615 0 0 if ($self->opt_D) { }
624 0 0 if ($@)
630 0 0 if ($c->can('parse_from_file')) { }
633 0 0 defined $v && length $v ? :
642 0 0 unless $good_class_found
659 0 0 if (not $self->opt_T and $formatter_class->can('is_pageable') and not $formatter_class->is_pageable and not $formatter_class->can('page_for_perldoc'))
668 0 0 if length $ext
688 0 0 if ($self->opt_d) { }
0 0 elsif ($formatter->can('page_for_perldoc') and do { $self->aside(qq[Going to call $formatter->page_for_perldoc("$out")\n]); if ($formatter->page_for_perldoc($out, $self)) { $self->aside("page_for_perldoc returned true, so NOT paging with $self.\n"); 1; } else { $self->aside("page_for_perldoc returned false, so paging with $self instead.\n"); ''; } }) { }
692 0 0 unless -s $out
699 0 0 if ($formatter->page_for_perldoc($out, $self)) { }
713 0 0 if (-s $out) { }
736 0 0 if (defined $ENV{'PERLDOC'} and length $ENV{'PERLDOC'}) { }
751 0 0 unless Pod::Perldoc::GetOptsOO::getopts($self, $self->{'args'}, 'YES')
757 0 0 if $self->opt_h
767 0 0 if ($self->opt_X)
769 0 0 unless -f $podidx and -r _ and -M _ <= 7
773 0 0 if $self->opt_T or not -t STDOUT
779 0 0 if ($self->opt_n)
784 0 0 if (not $self->opt_L and $ENV{'PERLDOC_POD2'})
785 0 0 if ($ENV{'PERLDOC_POD2'} eq '1') { }
794 0 0 if $self->opt_L
819 0 0 if ($self->opt_f or $self->opt_q or $self->opt_a)
821 0 0 if $self->opt_f
822 0 0 if $self->opt_q
823 0 0 if $self->opt_a
824 0 0 if $count > 1
830 0 0 if @{$self->{'args'};}
841 0 0 if (m[^http(s)?://])
845 0 0 if ($response->{'success'}) { }
849 0 0 m[.*/([^/#?]+)] ? :
854 0 0 $self->opt_m ? :
859 0 0 if ($self->{'podidx'} and open PODIDX, $self->{'podidx'})
865 0 0 if m[/$searchfor(?:\.(?:pod|pm))?\z]i
867 0 0 unless close PODIDX
873 0 0 if ($self->opt_F)
874 0 0 unless -r $_
875 0 0 if $self->opt_l or $self->opt_m or $self->containspod($_)
887 0 0 unless ($self->opt_m)
888 0 0 if ($self->is_vms) { }
901 0 0 if (@files) { }
0 0 elsif (not /\W/ and @files = $self->searchfor(0, "perl$_", @searchdirs)) { }
911 0 0 if $self->opt_r
912 0 0 if (@files) { }
916 0 0 $self->opt_m ? :
918 0 0 if (@{$self->{'found'};})
922 0 0 unless opendir DIR, $dir
924 0 0 if $file =~ /^\./s
928 0 0 unless closedir DIR
944 0 0 if $self->opt_a
946 0 0 if $self->opt_f
948 0 0 if $self->opt_v
950 0 0 if $self->opt_q
952 0 0 if (not $self->opt_f || $self->opt_q || $self->opt_v || $self->opt_a) { }
0 0 elsif (@dynamic_pod) { }
957 0 0 if ($] >= 5.008 and $self->opt_L)
967 0 0 if $in_list
968 0 0 unless print $buffd @dynamic_pod
969 0 0 if $in_list
971 0 0 unless close $buffd
991 0 0 if @_ == 2
999 0 0 if @_
1014 0 0 if $INC[-1] eq '.'
1017 0 0 if (not $@ and $pack->can('new'))
1022 0 0 if $@
1033 0 0 if (defined $tr) { }
1052 0 0 unless open my $fh, $op, $path
1059 0 0 if ($encoding =~ /utf-?8/i) { }
1066 0 0 if ($] < 5.008) { }
1081 0 0 unless ($opt =~ /^ (?: [\@\%\$]\S+ | [A-Z]\w* ) $/x)
1090 0 0 if ($opt ne '$0' and $opt =~ /^\$\d+$/)
1102 0 0 if /^=encoding\s+(\S+)/
1103 0 0 if /^=over 8/
1106 0 0 if $enc
1113 0 0 if /^=head2 Error Indicators/
1115 0 0 if (/^=item\s+$search_re\s/) { }
0 0 elsif (/^=item/) { }
0 0 elsif (not /^\s+$/) { }
1119 0 0 if $found and not $inheader and not $inlist
1122 0 0 if ($found) { }
1132 0 0 if (/^=over/) { }
0 0 elsif (/^=back/) { }
1136 0 0 if $found and not $inheader and not $inlist
1142 0 0 unless $found
1143 0 0 unless (@$pod)
1146 0 0 unless close $fh
1172 0 0 if $line =~ /^=encoding\s+(\S+)/
1174 0 0 if ($line =~ /^X/)
1178 0 0 if $skip
1187 0 0 if ($line =~ /X<+\s*\Q$thing\E\s*>+/) { }
0 0 elsif ($push and $line =~ /^=item\s*.*$/) { }
0 0 elsif ($push and $seen_item and $line =~ /^X<+\s*[ a-z,?-]+\s*>+/) { }
0 0 elsif ($push) { }
1188 0 0 if ($previous_line)
1215 0 0 if (scalar @$pod) { }
1255 0 0 if /^=encoding\s+(\S+)/
1257 0 0 if (/^=item\s+$search_re\b/) { }
0 0 elsif (@related > 1 and /^=item/) { }
0 0 elsif (/^=item/) { }
0 0 elsif ($found and /^X<[^>]+>/) { }
1262 0 0 if (/^=item\s+(?:$related_re)\b/) { }
1270 0 0 if $found > 1 and not $inlist
1275 0 0 unless $found
1276 0 0 if (/^=over/) { }
0 0 elsif (/^=back/) { }
1280 0 0 if $found > 1 and not $inlist
1284 0 0 if /^\w/
1287 0 0 unless (@$pod)
1293 0 0 unless close $fh
1309 0 0 $self->opt_f =~ /^-[rwxoRWXOeszfdlpSbctugkTBMAC]$/ ? :
1318 0 0 if ($self->opt_L and defined $self->{'translators'}[0])
1320 0 0 if $tr->can('search_perlfunc_re')
1321 0 0 if ($] < 5.008)
1329 0 0 if /^=encoding\s+(\S+)/
1330 0 0 if /^=head2 (?:$re|Alphabetical Listing of Perl Functions)/
1342 0 0 if grep {$self->opt_f eq $_;} @perlops
1344 0 0 if (/^=over/ and not $found) { }
0 0 elsif (/^=back/ and not $found and $inlist) { }
1352 0 0 if (/^=item\s+$search_re\b/ and $inlist < 2) { }
0 0 elsif (@related > 1 and /^=item/) { }
0 0 elsif (/^=item|^=back/) { }
0 0 elsif ($found and /^X<[^>]+>/) { }
1357 0 0 if (/^=item\s+(?:$related_re)\b/) { }
1361 0 0 if $found > 1 and $inlist < 2
1365 0 0 if $found > 1 and $inlist < 2
1370 0 0 unless $found
1371 0 0 if (/^=over/) { }
0 0 elsif (/^=back/) { }
1378 0 0 if /^\w/
1381 0 0 unless (@$pod)
1385 0 0 unless (@$pod)
1391 0 0 unless close $fh
1405 0 0 unless my $rx = eval { do { qr/$search_key/ } }
1415 0 0 if $file =~ /[<>|]/
1418 0 0 if /^=encoding\s+(\S+)/
1419 0 0 if (/^=head2\s+.*(?:$search_key)/i) { }
0 0 elsif (/^=head[12]/) { }
1421 0 0 unless $found_in{$file}++
1426 0 0 unless $found
1431 0 0 unless @$pod
1434 0 0 if ($self->opt_l)
1450 0 0 $formatter_class->can('new') ? :
1455 0 0 if (not @$found_things) { }
0 0 elsif (@$found_things > 1) { }
1472 0 0 if (ref $formatter)
1473 0 0 unless $self->{'formatter_switches'}
1475 0 0 if ($formatter->can($switch)) { }
1476 0 0 defined $value ? :
1477 0 0 if $@
1480 0 0 if ($silent_fail or $switch =~ /^__/s) { }
1492 0 0 if ($self->{'podnames'} and exists $self->{'podnames'}{$file} and $formatter->can('name'))
1506 0 0 if ($self->opt_D) { }
1517 0 0 if $@
1520 0 0 unless close $out_fh
1528 0 0 unless (-s $out)
1529 0 0 if ($formatter->can('if_zero_length')) { }
1540 0 0 if wantarray
1553 0 0 unless defined $file and length $file
1556 0 0 if (grep(($_ eq $file), @$temp_file_list)) { }
1558 0 0 unless unlink $file
1570 0 0 if $self->is_vms
1571 0 0 if $self->is_mswin32
1572 0 0 if $self->is_dos
1573 0 0 if $self->is_os2
1590 0 0 if -f $path and -r _
1592 0 0 if (not $self->opt_i or $self->is_vms or $self->is_mswin32 or $self->is_dos or $self->is_os2)
1598 0 0 if -f _
1609 0 0 if (-d _) { }
0 0 elsif (-f _ and -r _ and lc $try eq lc $path) { }
0 0 elsif (-f _) { }
0 0 elsif (-d catdir(@p)) { }
1611 0 0 if ($p eq $self->{'target'})
1615 0 0 if $_ eq $tmp_path
1617 0 0 unless $path_f
1631 0 0 unless opendir DIR, $p_dirspec
1633 0 0 if (lc $cip eq $lcp)
1638 0 0 unless closedir DIR
1639 0 0 unless $found
1643 0 0 if -f $p_filespec and -r _
1644 0 0 if -f _
1662 0 0 if ($self->is_mswin32) { }
0 0 elsif ($self->is_vms) { }
0 0 elsif ($self->is_dos) { }
0 0 elsif ($self->is_amigaos) { }
1664 0 0 if $ENV{'PAGER'}
1671 0 0 if $ENV{'PAGER'}
1675 0 0 if $ENV{'PAGER'}
1678 0 0 if ($self->is_os2)
1682 0 0 if $ENV{'PAGER'}
1685 0 0 if ($self->is_cygwin)
1686 0 0 if ($pagers[0] eq 'less' or $pagers[0] eq '/usr/bin/less')
1688 0 0 if $ENV{'PAGER'}
1692 0 0 if ($self->opt_m) { }
1694 0 0 if $ENV{'PERLDOC_SRC_PAGER'}
1696 0 0 if $ENV{'MANPAGER'}
1697 0 0 if $ENV{'PERLDOC_PAGER'}
1722 0 0 if (@found > 1)
1739 0 0 unless (ref $self)
1750 0 0 if (length $dir and not -d $dir)
1756 0 0 $self->opt_m ? :
0 0 if (length $path and $self->opt_m ? $self->isprintable($path) : $self->containspod($path))
1772 0 0 if not $readit and $file =~ /\.(?:pl|pm|pod|cmd|com|bat)\z/i
1788 0 0 if not $readit and $file =~ /\.pod\z/i
1804 0 0 if ($self->is_cygwin and -x $file and -f "$file.exe")
1806 0 0 if $self->opt_D
1813 0 0 if (/^=head/)
1814 0 0 unless close $fh
1818 0 0 unless close $fh
1829 0 0 if (-f 'Makefile.PL' or -f 'Build.PL')
1834 0 0 if ($< and $> and -d 'blib')
1836 0 0 if $@ and $self->opt_D
1850 0 0 unless defined $outspec and length $outspec
1858 0 0 if $self->{'output_is_binary'}
1876 0 0 unless @$pages
1879 0 0 unless defined $chunk
1882 0 0 if ($chunk =~ m[([^\#\\:/\$]+)$]s) { }
1888 0 0 if length $chunk > 10
1907 0 0 if ($output_to_stdout) { }
1912 0 0 unless print $_
1914 0 0 unless close $fh
1920 0 0 if $self->is_vms
1922 0 0 if $self->is_mswin32 or $self->is_dos
1928 0 0 if $self->is_amigaos
1932 0 0 if ($self->is_vms) { }
0 0 elsif ($self->is_amigaos) { }
1933 0 0 if system("$pager $output") == 0
1935 0 0 if system($pager, $output) == 0
1937 0 0 if ($self->{'formatter_class'} =~ /ToTerm/i)
1941 0 0 defined $ENV{'LESS'} ? :
1943 0 0 unless ($self->is_mswin32 and $self->is_dos)
1945 0 0 defined $ENV{'MORE'} ? :
1947 0 0 if $ENV{'LESS'}
1948 0 0 if $ENV{'MORE'}
1950 0 0 if system(qq[$pager "$output"]) == 0
1962 0 0 if $self->is_vms
1963 0 0 if -f $s and $self->containspod($s)
1971 0 0 unless -d $dir
1972 0 0 if $self->is_vms
1973 0 0 if (not $self->opt_m and $ret = $self->check_file($dir, "$s.pod") or $ret = $self->check_file($dir, "$s.pm") or $ret = $self->check_file($dir, $s) or $self->is_vms and $ret = $self->check_file($dir, "$s.com") or $self->is_os2 and $ret = $self->check_file($dir, "$s.cmd") or $self->is_mswin32 || $self->is_dos || $self->is_os2 and $ret = $self->check_file($dir, "$s.bat") or $ret = $self->check_file("$dir/pod", "$s.pod") or $ret = $self->check_file("$dir/pod", $s) or $ret = $self->check_file("$dir/pods", "$s.pod") or $ret = $self->check_file("$dir/pods", $s))
1991 0 0 if ($recurse)
1992 0 0 unless opendir D, $dir
1994 0 0 if not /^\.\.?\z/s || /^auto\z/s
1998 0 0 unless closedir D
1999 0 0 unless @newdirs
2001 0 0 if $self->is_vms
2015 0 0 if $already_asserted
2020 0 0 if $@
2030 0 0 if ($self->is_mswin32)
2043 0 0 unless keys %ENV
2066 0 0 if (not $self->is_vms || $self->is_mswin32 || $self->is_dos || $self->is_os2 and $> == 0 || $< == 0 and not $self->am_taint_checking)
2073 0 0 unless defined $id
2074 0 0 unless defined $id
2099 0 0 if (not $@ and $< and $>) { }
0 0 elsif ($self->opt_U) { }