Branch Coverage

blib/lib/Scriptalicious.pm
Criterion Covered Total %
branch 109 362 30.1


line true false branch
54 5 0 if ($_[$i] =~ /^-(.*)/)
56 0 5 unless *{uc $1;}{'SCALAR'}
57 0 5 if $x eq 'VERSION'
76 0 18 if $closure
95 0 3 if $#ARGV >= 0 and $ARGV[0] eq '--'
104 0 3 if $#ARGV >= 0 and $ARGV[0] =~ /^-/
108 0 0 unless $gotconf
109 0 0 unless $VERBOSE < 0
110 0 0 if $VERBOSE
111 0 10 if $VERBOSE > 1
112 0 1 unless $gotconf
117 0 0 if ($^S) { }
130 0 0 if (/[\s\']/)
150 66 35 if @output
151 101 0 if $start < 0
152 0 0 ref $_[0] ? :
0 0 $? >> 8 ? :
0 0 $start != 0 ? :
0 0 $start != 0 ? :
0 0 $VERBOSE >= $SHOW_CMD_VERBOSE || $next_cmd_no_hide ? :
0 101 if $?
170 0 153 if (not $next_cmd_capture and $VERBOSE >= $SHOW_CMD_VERBOSE || $next_cmd_no_hide) { }
175 30 123 if (defined $pid and not $pid)
185 0 123 if (not $next_cmd_capture and $VERBOSE >= $SHOW_CMD_VERBOSE || $next_cmd_no_hide) { }
197 273 36 if defined &gettimeofday
200 0 36 unless defined &gettimeofday
202 0 36 unless defined &tv_interval
210 45 0 $1 eq 'out' ? :
105 45 $1 eq 'in' ? :
213 45 105 $fd_desc ? :
216 0 153 if ($VERBOSE >= $SHOW_CMD_VERBOSE)
217 0 0 $next_cmd_capture ? :
0 0 $fd_desc ? :
0 0 unless ref $_[0]
229 123 30 if (my $pid = do_fork()) { }
235 0 30 unless defined $pid
236 19 11 if $fd_desc
237 0 21 if (ref $_[0]) { }
242 0 0 unless exec @_
247 0 123 if ($VERBOSE >= $SHOW_CMD_VERBOSE)
258 7 92 wantarray ? :
272 0 39 if $l
274 0 39 if $@
283 0 0 if $SYNOPSIS
285 0 0 unless open SCR_POD, $0
291 0 0 if (not /^=/ and $targ)
294 0 0 if (/^=encoding (\w+)/) { }
0 0 elsif (/^=head\w\s+SYNOPSIS\s*$/) { }
0 0 elsif (/^=head\w\s+DESCRIPTION\s*$/) { }
0 0 elsif (/^=head\w\s+NAME\s*$/) { }
0 0 elsif (/^=head\w\s+COMMAND[\- ]LINE OPTIONS\s*$/) { }
0 0 elsif ($in_options) { }
311 0 0 if (/^=over/) { }
0 0 elsif (/^=item\s+(.*)/) { }
0 0 elsif (/^=back/) { }
315 0 0 unless $level == 1
326 0 0 if (length $switch > length $longest)
339 0 0 if (--$level == 0)
345 0 0 if ($name_desc)
358 0 0 $SHORT_DESC ? :
368 0 0 unless ($SHORT_DESC)
371 0 0 unless exec 'perldoc', $0
376 0 0 unless defined &wrap
377 0 0 unless defined &fill
381 0 0 if (defined &GetTerminalSize)
451 0 0 defined $main::VERSION ? :
468 3 153 if (not defined wantarray) { }
495 1 11 if ($neg)
499 0 12 if ($scalar == 0)
507 23 32 if ($rv or $$unit[1] <= $rem)
509 14 9 $x ? :
511 0 23 if ($last and $new_rem >= $$unit[1] / 2)
514 10 13 if (not $last and $$unit[2]) { }
5 8 elsif (defined $$unit[2] and not $$unit[2]) { }
520 4 1 if ($prec >= 1) { }
531 7 11 if $last
535 1 11 $neg ? :
543 0 0 $scalar < 0 ? :
544 0 0 if ($neg)
555 0 0 if (exists $prefixes{$e}) { }
557 0 0 if $d < 0
569 0 0 if ($@)
580 0 0 unless defined $loc
584 0 0 if ($@) { }
585 0 0 if ($@ =~ /^no such config/) { }
595 0 0 if (wantarray) { }
605 1 1 if ($@)
612 0 1 if ($filename eq 'POD') { }
614 0 0 if $@
619 0 0 unless $conf
623 0 1 unless -f $filename
625 0 1 unless open CONF, "<$filename"
631 0 1 if $@
640 0 1 if wantarray
649 8 0 if (exists $$conf_obj{$name})
656 2 6 if ($type =~ /\@$/) { }
1 5 elsif ($type =~ /\%$/) { }
1 4 elsif ($type =~ /^=s/) { }
1 3 elsif ($type =~ /^=i/) { }
0 3 elsif ($type =~ /^=f/) { }
2 1 elsif ($type =~ /!/) { }
657 0 2 unless ref $target eq 'ARRAY'
661 0 0 $name ne $names[0] ? :
0 2 unless ref $val eq 'ARRAY'
671 0 1 unless ref $target eq 'HASH'
675 0 0 $name ne $names[0] ? :
0 1 unless ref $val eq 'HASH'
690 0 1 unless $val =~ /^\d+$/
695 0 0 unless $val =~ /^[+-]?(\d+\.?|\d*\.)(\d+)/
702 0 2 unless my($is_true, $is_false) = $val =~ /^(?:(y|yes|true|on|1|yang) |(n|no|false|off|0|yin|))$/xi
710 1 1 $is_true ? :
717 0 5 unless ref $target and ref($target) =~ /CODE|SCALAR|REF/
722 0 5 if (ref $target eq 'CODE') { }
733 0 1 if (wantarray) { }
746 0 0 unless -t STDIN
0 0 unless eval { do { die unless -t STDIN; require Term::ReadLine; 'Term::ReadLine'->new('Scriptalicious') } }
779 0 0 if $@
785 0 0 if $@
792 0 0 unless $prompt =~ /\s$/
796 0 0 if ($sub) { }
797 0 0 if (defined(my $res = &$sub($_))) { }
814 0 0 if (my($match) = /$re/) { }
815 0 0 defined $match ? :
819 0 0 ref $re eq 'CODE' ? :
824 0 0 if (@_ > 1 and $_[0] =~ /^-(.*)/)
826 0 0 unless my $ref = __package__()->can("prompt_$type")
838 0 0 defined $default ? :
0 0 unless $_ or $default
846 0 0 defined $default ? :
0 0 length $_ ? :
0 0 defined $i ? :
852 0 0 $2 ? :
0 0 /^\s*(?: (?:(y.*))? | (n.*))\s*$/xi ? :
859 0 0 $1 ? :
0 0 $2 ? :
0 0 /^\s*(?: (y.*) | (n.*))\s*$/xi ? :
868 0 0 $1 ? :
0 0 /^\s*(?: (y.*)? | (?:(n.*))? )\s*$/xi ? :
878 0 0 -e $_ ? :
883 0 0 if ($term->can('Attribs'))
887 0 0 if ($term =~ /Stub/) { }
0 0 elsif ($term =~ /HASH/ and $$term{'gnu_readline_p'}) { }
897 0 0 if ($attr)
910 0 0 defined $1 ? :
911 0 0 unless (defined $dir and length $dir)
917 0 0 if (-d $dir)
918 0 0 unless opendir DIR, $dir
919 0 0 if not /^\.\.?$/
923 0 0 if (@files == 1 and -d $files[0]) { }
940 6 13 if $fds[$#fds] > 2
948 0 15 if (fileno BAM) { }
952 0 15 if (fileno BAM)
962 5 22 if (not ref $where) { }
2 20 elsif (ref $where eq 'GLOB') { }
20 0 elsif (ref $where eq 'CODE') { }
963 0 5 unless open $fd, "$mode$where"
967 0 2 unless open $fd, "$mode&" . fileno($where)
973 11 9 if (my $pid = fork) { }
0 9 elsif (not defined $pid) { }
974 3 8 $mode eq '>' ? :
975 3 8 $mode eq '>' ? :
976 0 11 unless open $fd, "$mode&FD${fnum}_$rw"
982 7 2 if ($mode eq '<') { }
1004 0 18 unless (fileno \*{"FD$fnum";} == $fnum)
1016 0 0 unless &templater->process($template, $data)
1020 0 0 if ($@)
1045 0 0 if $@
1046 0 0 unless not ref $var or ref !($var =~ /^(ARRAY|HASH)$/)
1050 0 0 unless (eval { do { eval 'use YAML'; die $@ if $@; local $YAML::UseHeader = 0 unless not ref $var or ref !($var =~ /^(ARRAY|HASH)$/); local $YAML::UseVersion = 0; return YAML::Dump($var) } })
1051 0 0 if $@
1065 0 0 if (not $@) { }
1079 0 0 if ($template_ok)
1096 0 0 unless ($rc)
1117 0 0 if (open my $script, $0)
1121 0 0 if (/^__\Q$name\E__$/ .. /^__(?!\Q$name\E)(\w+)__$/ || eof $script)
1122 0 0 unless $found++
1123 0 0 if $1
1129 0 0 if (not $found and -e $name)
1131 0 0 if (open TEMPLATE, $name) { }
1140 0 0 if (@ISA) { }
1144 0 0 $found ? :