Branch Coverage

blib/lib/Script/Toolbox/Util.pm
Criterion Covered Total %
branch 76 296 25.6


line true false branch
76 0 8 if defined $ops and not defined $self->{'ops'}
80 3 5 if (defined $logdir)
95 0 8 unless defined $self->{'ops'}
99 0 28 if (defined $self->{$key})
138 0 0 if defined $line and defined $file
149 0 0 if $^S
172 0 0 if (not defined $canal) { }
174 0 0 if (defined $Script::Toolbox::Util{'_logFH'})
177 0 0 if (ref $canal eq 'IO::File') { }
0 0 elsif ($canal eq 'STDERR') { }
0 0 elsif ($canal eq 'STDOUT') { }
0 0 elsif ($canal eq 'syslog') { }
195 0 0 unless ($canal =~ /^\s*>/ or $canal =~ /^\s*[|]/)
199 0 0 if (not defined $fh) { }
228 0 10 if (ref $self ne 'Script::Toolbox')
249 0 0 if ref $param ne 'HASH'
250 0 0 if ref $param->{'data'} eq 'HASH'
251 0 0 if ref $param->{'data'} eq 'ARRAY'
253 0 0 unless (defined $param->{'data'}[0])
275 0 0 if (ref $param eq 'HASH')
280 0 0 if &_isTitleHead($param)
281 0 0 if &_isCSV($param, $separator)
304 0 0 if ref \$param->[0] eq 'SCALAR' and ref $param->[1] eq 'ARRAY'
337 0 0 if ref $param ne 'ARRAY'
339 0 0 unless defined $separator
340 0 0 if $param->[0] =~ /$separator/
354 0 0 unless defined $separator
380 0 10 unless defined $self->{'ops'}
394 0 0 if (not defined $newContent) { }
0 0 elsif (ref $newContent eq 'CODE') { }
398 0 0 if defined $f
412 4 10 if (not defined $newContent) { }
1 9 elsif (ref $newContent eq 'CODE') { }
430 2 0 if (not defined $newContent) { }
0 0 elsif (ref $newContent eq 'CODE') { }
446 0 0 unless defined $fieldSep
469 0 0 if (ref $newContent->{$k} ne 'HASH')
487 1 1 unless defined $$fieldSep
497 0 2 if ($scalar_code) { }
1 1 elsif ($scalar_undef) { }
0 1 elsif ($code_scalar) { }
1 0 elsif ($code_undef) { }
518 1 1 if (defined $callBack) { }
540 0 8 unless defined $k
541 2 6 if (ref $P->{$k} eq 'HASH')
545 4 2 if (@v == 1) { }
566 0 9 if (ref $file eq 'IO::File') { }
572 7 2 unless $file =~ /^[|>]/
575 6 3 if (ref $newContent eq '') { }
1 2 elsif (&_simpleArray($newContent)) { }
1 1 elsif (&_simpleHash($newContent)) { }
591 0 3 defined $recSep ? :
603 0 3 defined $recSep ? :
604 0 3 defined $fieldSep ? :
616 0 2 if ref $content ne 'HASH'
619 1 4 if ref $content->{$key} ne ''
630 2 1 if ref $content ne 'ARRAY'
633 0 3 if ref $line ne ''
648 0 5 if (ref $file eq 'IO::File') { }
656 1 4 if defined $callBack
657 0 5 unless defined $rf
671 1 1 if (ref $file eq 'IO::File') { }
687 0 7 unless defined $d
692 30 37 if &_toSkip($_, $searchPattern)
705 14 53 if $line =~ /^[.]{1,2}$/
706 31 22 unless defined $pattern
708 4 18 if ($pattern =~ /^\s*!/) { }
711 2 2 if $line =~ /$pattern/
713 14 4 if not $line =~ /$pattern/
731 0 1 unless defined $self->{'ops'}
732 0 1 unless ref $self->{'ops'} eq 'Script::Toolbox::Util::Opt'
744 26 28 if ($x =~ /Script::Toolbox/)
746 26 0 if $_[0]->isa('Script::Toolbox::Util')
766 0 0 if /^__RC__/
767 0 0 if /^\s*$/
773 0 0 if $rc == 0
789 1 2 unless $rtime =~ /^[0-9]+$/
819 2 5 defined $opt->{'offset'} ? :
822 3 4 if $opt->{'diff'}
828 2 2 if defined $opt->{'format'}
840 0 0 unless defined $head
848 0 0 unless defined $foot
862 0 0 unless $op->{'label'}
863 0 0 if $o == $curr
881 0 0 if defined $l->{'header'}
882 0 0 if defined $l->{'footer'}
883 0 0 if defined $l->{'label'}
885 0 0 $head eq '' ? :
886 0 0 $foot eq '' ? :
897 0 0 if (defined $def)
928 0 0 unless $op->{'label'}
953 0 0 if ref $line ne 'HASH'
954 0 0 unless defined $line - {'label'}
955 0 0 unless defined $line - {'value'}
969 0 0 if ref $opts->{$l} ne ''
973 0 0 unless defined $frame
975 0 0 if defined $frame->{'header'}
976 0 0 if defined $frame->{'footer'}
993 0 0 unless defined $frame
994 0 0 if defined $frame->{'header'}
995 0 0 if defined $frame->{'footer'}
1009 0 0 if ref $opts eq 'ARRAY'
1010 0 0 if ref $opts eq 'HASH'
1011 0 0 if ref $opts eq ''
1031 0 0 if defined $_->{'value'}
1045 0 0 if (defined $_->{'value'} and defined $_->{'label'})
1067 0 0 if $o == 0
1069 0 0 if $format eq 'ARRAY'
1070 0 0 if $format eq 'SCALAR'
1071 0 0 if $format eq 'HASH'
1120 0 0 unless defined $menu->[$o]{'jump'}
1123 0 0 defined $menu->[$o]{'argv'} ? :
1125 0 0 if (ref $call eq 'CODE')
1139 0 0 unless defined $op->{'label'}
1141 0 0 $len < $l ? :
1154 0 0 if defined $op->{'value'}
1156 0 0 defined $def ? :
0 0 if ($op->{'readOnly'}) { }
1157 0 0 defined $def ? :
1187 0 0 if $$o =~ s/^\n$/0/
1188 0 0 if $$o * 10 > $maxNum
1196 0 0 if $o =~ /^\n$/
1197 0 0 if $o <= $maxNum
1212 0 0 if &_invalid($o, $maxNum)
1213 0 0 if &_unique(\$o, $maxNum)
1215 0 0 if ($maxNum > 9)
1218 0 0 if $oo eq "\n"
1221 0 0 if $o <= $maxNum and $o > -1
1239 0 0 if $key =~ /$patt/
1240 0 0 if $key =~ /\n/
1256 0 0 unless defined $opts->[$o]{'value'}
1259 0 0 defined $op->{'value'} ? :
1261 0 0 if $op->{'readOnly'}
1267 0 0 if $resp eq ''
1268 0 0 if defined $op->{'default'} and $resp eq ' '
1281 0 0 if ref $opt eq 'ARRAY'
1302 0 0 $x =~ /$defaults/ ? :
0 0 if defined $defaults
1324 0 0 if defined $name
1334 0 0 if ref $m eq 'Script::Toolbox::Util::Menus'
1370 0 0 if @{$l;} > 0
1383 0 0 if $cl eq 'RETURN' and &_isOneSelected($m, $name)
1395 0 0 unless $x =~ /^TMP_[0-9]+/
1420 0 0 if (ref $options eq 'ARRAY')
1423 0 0 if @label + 0
1441 0 0 unless (defined $m->{'def'}{$menuName})
1446 0 0 if $radio
1448 0 0 if ($radio) { }