Condition Coverage

blib/lib/Acme/Tools.pm
Criterion Covered Total %
condition 333 658 50.6


and 2 conditions

line l !l condition
1282 0 86 $r = &$types($_) and @$r and $$ru = $_ and last
2141 0 3 push @$ar, $v and next
2142 0 2 unshift @$ar, $v and next
2323 26 1 @{$arefs[0];} != @{$arefs[$_];} and return undef
4917 4 2 shift() eq $uttrykk and return shift()
4918 0 0 not defined shift() and return shift()
4925 2 1 shift() == $uttrykk and return shift()
4926 0 0 not defined shift() and return shift()
5479 0 1 @res = grep({&$ar(@$_);} @res) and next
7150 0 0 warn "xcat: cannot open $os ($!)\n" and next

and 3 conditions

line !l l&&!r l&&r condition
510 558 0 1 $fx =~ /x/ and $fx =~ m[^[ \(\)\.\d\+\-\*/x\=\^]+$]
531 57 117 7 $n > 3 and $x[$n + 1] == $x[$n]
174 6 1 $n > 3 and $x[$n + 1] == $x[$n] and $x[$n] == $x[$n - 1]
532 70 0 110 $n > 4 and $x[$n] != 0
70 97 13 $n > 4 and $x[$n] != 0 and abs 1 - $x[$n + 1] / $x[$n] < 1e-13
533 57 110 0 $n > 3 and ref $x[$n + 1] eq 'Math::BigFloat'
167 0 0 $n > 3 and ref $x[$n + 1] eq 'Math::BigFloat' and substr($x[$n + 1], 0, $ds) eq substr($x[$n], 0, $ds)
534 166 0 1 $sec > 0 and ($Resolve_time = time_fp() - $time_start) > $sec
1282 0 0 86 $r = &$types($_) and @$r
0 0 86 $r = &$types($_) and @$r and $$ru = $_
1290 39 4 0 $type eq 'money' and time >= $conv_prepare_money_time + $Currency_rates_expire
1295 9 21 1 $cf > 0 && $ct < 0
21 0 9 $cf < 0 && $ct > 0
1424 13 6 4 $s < 60 && int $s == $s
1479 1 0 914 $r =~ s/(C?)([DM])|(X?)([LCDM])|(I?)([VXLCDM])|(I)|(.)/croak("roman2int: Invalid number $r") if $8; $n += $c{$2 or $4 or $6 or $7} - $c{$1 or $3 or $5 or ''}; '';/eg && $n
1697 0 0 0 not $l || recursed() and $dec > 6
0 0 0 not $l || recursed() and $dec > 6 and substr $n, -1
0 0 0 not $l || recursed() and $dec > 6 and substr $n, -1 and substr($n, -1)--
1741 1 0 24 $test >= $fom && $test <= $tom
0 0 2 $test >= $tom && $test <= $fom
2069 1 7086 0 defined $_ and !defined($min) || $_ < $min
2070 0 3 0 defined $_ and !defined($min) || $_ lt $min
2071 1 7092 0 defined $_ and !defined($max) || $_ > $max
2072 0 3 0 defined $_ and !defined($max) || $_ gt $max
2101 14 2 0 ref $_ ne 'ARRAY' and croak('ERROR: zip should have arrayrefs as arguments')
2102 3 2 0 @{$t[$_];} != @{$t[0];} and croak('ERROR: zip should have equal sized arrays')
2132 7666 901 2348 not defined $Pushsort_cmpsub and @$ar + @_ < 100
2212 7931 1 6677 defined $cmpsub and ref $cmpsub
7932 6677 0 defined $cmpsub and ref $cmpsub and ref $cmpsub ne 'CODE'
2213 7931 6677 1 defined $cmpsub and not ref $cmpsub
2227 45940 45479 37316 not $cmpsub and $search < $middle_value
45479 44312 1628 $cmpsub and &$cmpsub($search, $middle_value) < 0
44312 7031 38448 not $cmpsub and $search > $middle_value
7031 8 44304 $cmpsub and &$cmpsub($search, $middle_value) > 0
2229 37494 1450 0 $middle == $max and $min != $max
2235 69139 6108 7505 $middle == $min and $max != $min
2322 53 1 0 ref $_ ne 'ARRAY' and croak()
2328 0 272 0 ++$ant and $ant > 100
2359 99 1098 0 not $cmpsub and $a->[$_] > $$a[$_ + 1]
1098 99 0 $cmpsub and &$cmpsub($a->[$_], $$a[$_ + 1]) > 0
2522 4 15179 0 defined $_ and $sum += $_
2543 878 1 1 @_ == 1 and ref $_[0] eq 'ARRAY'
2601 0 8 5 @_ > 0 and not ref $_[0]
2849 11737 0 6265 $_ > $max and $max = $_
11737 0 0 $_ < 0 and croak('negative weight')
3036 1020 0 0 @_ == 1 and ref $_[0] eq 'ARRAY'
3103 1090 43 2085 /^[a-z].*[a-z\d]$/i and /[a-z]/
1133 42 2043 /^[a-z].*[a-z\d]$/i and /[a-z]/ and /[A-Z]/
85 680 1363 /^[a-z].*[a-z\d]$/i and /[a-z]/ and /[A-Z]/ and /\d/
3115 12284 0 1 ($d = time_fp() - $t) > $Pwgen_max_sec * $num and not $d =~ /^\d+$/
3708 2 0 0 not defined $query and $ENV{'REQUEST_METHOD'} eq 'POST'
3891 0 0 9 open WRITEFILE, '>', $filename and binmode WRITEFILE
3892 0 9 0 defined $text && ref $text
4068 1 0 1 defined $1 && length $1
4089 0 2 0 -f $file and -e $file
4131 0 0 12 chmod $mode, $_ and utime $atime, $mtime, $_
0 0 12 chmod $mode, $_ and utime $atime, $mtime, $_ and chown $uid, $gid, $_
4168 0 0 0 ($dd) = $d =~ m[^(.+)/+([^/]+)$] and makedir($dd, $p)
0 0 0 ($dd) = $d =~ m[^(.+)/+([^/]+)$] and makedir($dd, $p) and mkdir $d, $p
4264 33 0 12 $v =~ /^\{[^\}]*$/ and @l
4470 0 0 0 @_ == 1 and $_[0] =~ /^(\d{4})(\d\d)(\d\d)$/
4478 0 0 0 @_ == 1 and $_[0] =~ /^(\d{4})(\d\d)(\d\d)$/
4500 3 39 0 @_ > 1 and not defined $_[1]
4505 1 0 1 $_[0] =~ /$Re_isnum/ and @lt = localtime $_[0]
4509 2 3 36 @_ >= 2 and $format =~ /^[\d+\:\-\.]+$/
4738 11 2000 1 @$a > 1 and $$a[-2][0] == $$a[-1][0]
4836 0 0 0 not $l and 1000 < 0 + %ldist_cache
4865 23 0 15 defined $_[0] and length $_[0]
5324 2 0 0 $code and @_ < 6
5474 0 3 0 push @k, shift @ars and push @v, shift @ars
5706 120 0 0 /^\%/ and defined $opt_pro
5740 99 0 18 $c and not "$a[$_]$b[$_]" =~ /[iI][nN][fF]|\376/i
5815 210 0 0 $nodup_rad and $i > 0
210 0 0 $nodup_rad and $i > 0 and $$tab[$i][$j] eq $$tab[$i - 1][$j] || ($nodup_rad = 0)
5823 33 8 169 not $hode and length $celle > 0
5831 1 146 89 $_ and not /^\s*[\-\+]?(\d+|\d*\.\d+)\s*\%?$/
147 52 37 $_ and not /^\s*[\-\+]?(\d+|\d*\.\d+)\s*\%?$/ and not $hode
5833 185 0 25 $hoeyde > 1 and not $ikke_space
5835 23 1 1 $i > 1 and $hoeyde[$i - 1] == 1
5864 210 0 0 $fjern_tom and not $ikketom[$y]
5867 210 0 0 !$overskrift_forrige && $nodup && $nodup[$x][$y]
5874 26 49 186 length $txt > 0 and not $venstre[$y]
75 186 0 length $txt > 0 and not $venstre[$y] and $x > 0 || $ikke_hodestrek
5894 28 0 0 $x % $pagesize == 0 || $nodup > 0 && !$nodup[$x + 1][$nodup - 1] and $x + 1 < @$tab
0 0 0 $x % $pagesize == 0 || $nodup > 0 && !$nodup[$x + 1][$nodup - 1] and $x + 1 < @$tab and not $ikke_hodestrek
5896 33 0 0 $fjern_tom and not $ikketom[$y]
6254 0 0 0 $p > 0 and not substr($s, $p - 1, 2) =~ /^\n/
6276 115 1 3 $m and $c ne '{'
6350 0 16 1 $inp and $bf =~ /,/
6704 21 0 2 @_ == 2 and 0 < $_[0]
21 0 2 @_ == 2 and 0 < $_[0] and $_[0] < 1
0 0 2 @_ == 2 and 0 < $_[0] and $_[0] < 1 and $_[1] > 1
6705 21 0 0 @_ == 2 and 0 < $_[1]
21 0 0 @_ == 2 and 0 < $_[1] and $_[1] < 1
0 0 0 @_ == 2 and 0 < $_[1] and $_[1] < 1 and $_[0] > 1
6712 12 8 0 exists $arg{'keys'} and ref $arg{'keys'} ne 'ARRAY'
6714 20 0 0 $arg{'adaptive'} and $arg{'counting_bits'} > 1
6767 0 0 0 $bf->{'overflow'}{$_} += $bf2->{'overflow'}{$_} and keys %{$$bf{'overflow'};} > 10
0 0 0 $bf->{'overflow'}{$_} += $bf2->{'overflow'}{$_} and keys %{$$bf{'overflow'};} > 10 and croak("Too many overflows, concider doubling counting_bits from $cb to " . 2 * $cb)
6783 10 0 1 @keys == 1 && ref $keys[0] eq 'ARRAY'
6787 15083 1 0 $bf->{'key_count'} >= $n and croak("Exceeded filter capacity $n")
6789 3973 0 11110 $cb == 1 and not $adaptive
6801 24 1 1 $bf->{'overflow'}{$pos}++ and keys %{$$bf{'overflow'};} > 10
6813 0 0 0 $_ >= $k - 1 and $bit == 0
6824 5 0 0 @keys == 1 && ref $keys[0] eq 'ARRAY'
6843 0 0 0 $_ > $k - 1 and $bit == 1
6844 0 0 0 $_ <= $k - 1 and $bit == 0
6856 0 0 8 @keys == 1 && ref $keys[0] eq 'ARRAY'
6869 0 0 1 @keys == 1 && ref $keys[0] eq 'ARRAY'
6882 1 1 1 @keys == 1 && ref $keys[0] eq 'ARRAY'
6887 501 0 0 $bf->{'key_count'} == 0 and croak('Deleted all and then some')
6896 585 0 918 $c == 1 and ++$ones
585 918 0 $c == 1 and ++$ones and $bf->{'overflow'}{$pos}
6925 0 0 0 0 < $p and $p < 1
6926 0 0 0 $m = -1 * $_ * $n / log(1 - $p ** (1 / $_)) and !defined($flen) || $m < $flen
0 0 0 $m = -1 * $_ * $n / log(1 - $p ** (1 / $_)) and !defined($flen) || $m < $flen and ($flen, $k) = ($m, $_)
6967 0 0 0 -e $f and -f $f ? 'file' : (-d $f ? 'dir' : (-l $f ? 'symlink' : (-p $f ? 'pipe' : (-S $f ? 'socket' : (-b $f ? 'blockfile' : (-c $f ? 'charfile' : (-t $f ? 'ttyfile' : '')))))))
7114 0 0 0 $qrexcl and defined $File::Find::name
0 0 0 $qrexcl and defined $File::Find::name and $File::Find::name =~ /$qrexcl/
7208 0 7 1 $o{'v'} and @ARGV > 1
7220 11 0 0 $o{'k'} and $same
7221 11 0 0 not -e $_ and warn "$_ do not exists\n"
7222 11 0 0 not -r $_ and warn "$_ is not readable\n"
7223 11 0 0 -e $new and not $o{'o'}
11 0 0 -e $new and not $o{'o'} and warn "$new already exists, skipping (use -o to overwrite)\n"
7259 0 7 1 $o{'v'} and @ARGV > 1

or 2 conditions

line l !l condition
1287 0 0 join(',', @{$types[0];}) || '?'
0 0 join(',', @{$types[1];}) || '?'
1382 7 25 shift() || 2
1959 1 1 $_[1] || 3
2289 5 5 $cmpsub ||= sub { $_[0] <=> $_[1]; }
2844 1 15000 $to || 1
2850 1 4000 $to || 1
3106 58 2 $len ||= 8
3107 57 3 $num ||= 1
3108 54 6 $chars ||= 'A-Za-z0-9,-./&%_!'
3109 0 6 $req[0] ||= \&Acme::Tools::pwgendefreq
3505 3 14 $dict || ''
3546 0 5 $dict || ''
3823 1 6 $r ||= sub { s/&(#160|nbsp);/ /g; s/&/&/g; s/^\s*(.*?)\s*$/$1/s; s/(\d) (\d)/$1$2/g if /^[\d \.\,]+$/; }
4088 1 1 $times ||= 3
4261 3 9 $hr->{$1} ||= {}
4593 4 0 $lt[2] || 12
4596 2 2 repl($time, qr/^[^\.]+/) || 0
4735 2009 3 $Eta{$id} ||= []
4801 0 0 $thr{$what} ||= []
5671 0 0 $opt{'prosent'} || 0
5672 0 4 $opt{'sortsub'} || \&Acme::Tools::_sortsub
5799 0 5 $o{'nodup'} || 0
5814 177 33 $bredde[$j] ||= 0
5815 0 0 $$tab[$i][$j] eq $$tab[$i - 1][$j] || ($nodup_rad = 0)
5873 235 26 shift @celle || ''
6004 0 0 shift() || 0
6009 1326 95 $level || 0
6244 94 27 $p || 0
6831 78165 11612 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0
78165 11612 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0 or last
6861 12919 2303 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0
12919 2303 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0 or last
6874 3000 0 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0
3000 0 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0 or last
6944 0 0 shift() || '/var/www/html/currency-rates'
6945 0 0 -x $_ or die
7224 6 5 {'gz', 'gunzip', 'bz2', 'bunzip2', 'xz', 'unxz'}->{$ext} || ''
7234 11 0 chall($_, $new) or die
7238 0 0 rename $new, replace($new, qr/.tmp$/) or die

or 3 conditions

line l !l&&r !l&&!r condition
498 0 0 16 $iters < 0 or $sec < 0
1258 0 0 0 not -e $fn or time - (stat $fn)[9] >= $Currency_rates_expire
1697 0 0 0 $l || recursed()
1765 2 0 127 @_ != 3 or not defined $min
2 1 126 @_ != 3 or not defined $min or not defined $max
1 0 126 @_ != 3 or not defined $min or not defined $max or not defined $val
1 0 126 @_ != 3 or not defined $min or not defined $max or not defined $val or $min > $max
1852 15 0 2 @_ < 3 or not length $p
1859 2 0 3 @_ < 3 or not length $p
1867 4 0 7 @_ < 3 or not length $p
2069 33 57 6996 !defined($min) || $_ < $min
2070 1 1 1 !defined($min) || $_ lt $min
2071 30 30 7032 !defined($max) || $_ > $max
2072 1 1 1 !defined($max) || $_ gt $max
2227 37316 0 91419 not $cmpsub and $search < $middle_value or $cmpsub and &$cmpsub($search, $middle_value) < 0
38448 0 51343 not $cmpsub and $search > $middle_value or $cmpsub and &$cmpsub($search, $middle_value) > 0
2329 2 0 270 $arefs[0][$_] ne $ar->[$_] or $arefs[0][$_] != $ar->[$_]
2359 0 0 1197 not $cmpsub and $a->[$_] > $$a[$_ + 1] or $cmpsub and &$cmpsub($a->[$_], $$a[$_ + 1]) > 0
2794 0 0 9 $_ < 0 or $_ > 100
2849 6265 11737 0 $_ > $max and $max = $_ or $_ < 0 and croak('negative weight')
3115 1 0 12285 ++$Pwgen_trials >= $Pwgen_max_trials or ($d = time_fp() - $t) > $Pwgen_max_sec * $num and not $d =~ /^\d+$/
3240 3 0 3 $notme{$_} || $seen{$_}++
3629 1 1 0 $IPADDR_memo{$ipnr} ||= gethostbyaddr(pack('C4', split(/\./, $ipnr, 0)), 2)
3816 1 1 7 1 > @_ or @_ > 3
4168 0 0 0 $MAKEDIR{$d} or -d $d
0 0 0 $MAKEDIR{$d} or -d $d or mkdir $d, $p
0 0 0 $MAKEDIR{$d} or -d $d or mkdir $d, $p or ($dd) = $d =~ m[^(.+)/+([^/]+)$] and makedir($dd, $p) and mkdir $d, $p
4266 27 0 6 length $section or $Read_conf_empty_section
4472 0 0 0 $m < 1 or $m > 12
0 0 0 $m < 1 or $m > 12 or $d < 1
0 0 0 $y % 4 || $y % 100 == 0 && $y % 400
0 0 0 $m < 1 or $m > 12 or $d < 1 or $d > (31, $y % 4 || $y % 100 == 0 && $y % 400 ? 28 : 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)[$m - 1]
4637 461 0 13042 $L > 28 || ($L > 27 ? 1 - (21 - $Y % 19) / 11 : 0)
4734 2003 9 0 $time_fp ||= time_fp()
4800 0 0 0 $what ||= join(':', @{[caller 1];}[3, 2])
4838 0 0 0 $ldist_cache{join $;, $s, $t} ||= do { my($s1, $t1) = (substr($s, 1), substr($t, 1)); substr($s, 0, 1) eq substr($t, 0, 1) ? ldist($s1, $t1) : 1 + min(ldist($s1, $t1, 1 + $l), ldist($s, $t1, 1 + $l), ldist($s1, $t, 1 + $l)) }
4865 15 1 22 defined $_[0] and length $_[0] or @_ == 1
4917 0 4 0 shift() eq $uttrykk and return shift() or shift()
4918 0 0 0 not defined shift() and return shift() or shift()
4925 0 2 0 shift() == $uttrykk and return shift() or shift()
4926 0 0 0 not defined shift() and return shift() or shift()
5176 0 0 4 @_ != 3 or $jump == 0
5673 0 4 0 $opt{'sortsub_bortover'} || $sortsub
5674 0 4 0 $opt{'sortsub_nedover'} || $sortsub
5689 0 0 112 $opt_sum or defined $opt_pro
5851 0 0 5 $i == 0 or $venstretvang
5874 129 0 57 $x > 0 || $ikke_hodestrek
5894 0 0 28 $x % $pagesize == 0 || $nodup > 0 && !$nodup[$x + 1][$nodup - 1]
6054 0 0 188 not defined $level or $level >= 0
6091 0 0 0 $sub ne 'serialize' or $tilbake > 20
6273 0 0 2 $m or not @m
6726 1 1 18 $bf->{'error_rate'} <= 0 or $bf->{'error_rate'} >= 1
6926 0 0 0 !defined($flen) || $m < $flen
7107 0 0 0 $o{'M'} or $o{'P'}
7120 0 0 0 $o{'M'} or $o{'P'}
7143 0 0 0 $o{'M'} || $o{'P'}
7161 0 0 0 $m{$_} || chr $_
7184 0 0 0 not -e $fno or &$too_old($fno)
7402 0 0 0 $Wget ||= (grep((-x $_), map("$_/wget", '/usr/bin', '/bin', '/usr/local/bin', '.')))[0]
7406 0 0 0 $ARGV[0] || $Self_update_url