Condition Coverage

blib/lib/Acme/Tools.pm
Criterion Covered Total %
condition 332 658 50.4


and 2 conditions

line l !l condition
1283 0 86 $r = &$types($_) and @$r and $$ru = $_ and last
2142 0 0 push @$ar, $v and next
2143 0 3 unshift @$ar, $v and next
2324 26 1 @{$arefs[0];} != @{$arefs[$_];} and return undef
4918 4 2 shift() eq $uttrykk and return shift()
4919 0 0 not defined shift() and return shift()
4926 2 1 shift() == $uttrykk and return shift()
4927 0 0 not defined shift() and return shift()
5480 0 1 @res = grep({&$ar(@$_);} @res) and next
7158 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
1283 0 0 86 $r = &$types($_) and @$r
0 0 86 $r = &$types($_) and @$r and $$ru = $_
1291 39 4 0 $type eq 'money' and time >= $conv_prepare_money_time + $Currency_rates_expire
1296 9 21 1 $cf > 0 && $ct < 0
21 0 9 $cf < 0 && $ct > 0
1425 13 6 4 $s < 60 && int $s == $s
1480 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
1698 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)--
1742 1 0 24 $test >= $fom && $test <= $tom
0 0 2 $test >= $tom && $test <= $fom
2070 1 7086 0 defined $_ and !defined($min) || $_ < $min
2071 0 3 0 defined $_ and !defined($min) || $_ lt $min
2072 1 7092 0 defined $_ and !defined($max) || $_ > $max
2073 0 3 0 defined $_ and !defined($max) || $_ gt $max
2102 14 2 0 ref $_ ne 'ARRAY' and croak('ERROR: zip should have arrayrefs as arguments')
2103 3 2 0 @{$t[$_];} != @{$t[0];} and croak('ERROR: zip should have equal sized arrays')
2133 7666 901 2348 not defined $Pushsort_cmpsub and @$ar + @_ < 100
2213 7933 1 6677 defined $cmpsub and ref $cmpsub
7934 6677 0 defined $cmpsub and ref $cmpsub and ref $cmpsub ne 'CODE'
2214 7933 6677 1 defined $cmpsub and not ref $cmpsub
2228 45932 45453 37367 not $cmpsub and $search < $middle_value
45453 44292 1640 $cmpsub and &$cmpsub($search, $middle_value) < 0
44292 7031 38422 not $cmpsub and $search > $middle_value
7031 8 44284 $cmpsub and &$cmpsub($search, $middle_value) > 0
2230 37554 1453 0 $middle == $max and $min != $max
2236 69078 6107 7521 $middle == $min and $max != $min
2323 53 1 0 ref $_ ne 'ARRAY' and croak()
2329 0 272 0 ++$ant and $ant > 100
2360 99 1098 0 not $cmpsub and $a->[$_] > $$a[$_ + 1]
1098 99 0 $cmpsub and &$cmpsub($a->[$_], $$a[$_ + 1]) > 0
2523 4 15179 0 defined $_ and $sum += $_
2544 878 1 1 @_ == 1 and ref $_[0] eq 'ARRAY'
2602 0 8 5 @_ > 0 and not ref $_[0]
2850 11500 0 6502 $_ > $max and $max = $_
11500 0 0 $_ < 0 and croak('negative weight')
3037 1020 0 0 @_ == 1 and ref $_[0] eq 'ARRAY'
3104 1206 45 2264 /^[a-z].*[a-z\d]$/i and /[a-z]/
1251 52 2212 /^[a-z].*[a-z\d]$/i and /[a-z]/ and /[A-Z]/
97 726 1486 /^[a-z].*[a-z\d]$/i and /[a-z]/ and /[A-Z]/ and /\d/
3116 13907 0 1 ($d = time_fp() - $t) > $Pwgen_max_sec * $num and not $d =~ /^\d+$/
3709 2 0 0 not defined $query and $ENV{'REQUEST_METHOD'} eq 'POST'
3892 0 0 9 open WRITEFILE, '>', $filename and binmode WRITEFILE
3893 0 9 0 defined $text && ref $text
4069 1 0 1 defined $1 && length $1
4090 0 2 0 -f $file and -e $file
4132 0 0 12 chmod $mode, $_ and utime $atime, $mtime, $_
0 0 12 chmod $mode, $_ and utime $atime, $mtime, $_ and chown $uid, $gid, $_
4169 0 0 0 ($dd) = $d =~ m[^(.+)/+([^/]+)$] and makedir($dd, $p)
0 0 0 ($dd) = $d =~ m[^(.+)/+([^/]+)$] and makedir($dd, $p) and mkdir $d, $p
4265 33 0 12 $v =~ /^\{[^\}]*$/ and @l
4471 0 0 0 @_ == 1 and $_[0] =~ /^(\d{4})(\d\d)(\d\d)$/
4479 0 0 0 @_ == 1 and $_[0] =~ /^(\d{4})(\d\d)(\d\d)$/
4501 3 39 0 @_ > 1 and not defined $_[1]
4506 1 0 1 $_[0] =~ /$Re_isnum/ and @lt = localtime $_[0]
4510 2 3 36 @_ >= 2 and $format =~ /^[\d+\:\-\.]+$/
4739 11 2000 1 @$a > 1 and $$a[-2][0] == $$a[-1][0]
4837 0 0 0 not $l and 1000 < 0 + %ldist_cache
4866 23 0 15 defined $_[0] and length $_[0]
5325 2 0 0 $code and @_ < 6
5475 0 3 0 push @k, shift @ars and push @v, shift @ars
5707 120 0 0 /^\%/ and defined $opt_pro
5741 101 0 18 $c and not "$a[$_]$b[$_]" =~ /[iI][nN][fF]|\376/i
5816 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)
5824 33 8 169 not $hode and length $celle > 0
5832 1 146 89 $_ and not /^\s*[\-\+]?(\d+|\d*\.\d+)\s*\%?$/
147 52 37 $_ and not /^\s*[\-\+]?(\d+|\d*\.\d+)\s*\%?$/ and not $hode
5834 185 0 25 $hoeyde > 1 and not $ikke_space
5836 23 1 1 $i > 1 and $hoeyde[$i - 1] == 1
5865 210 0 0 $fjern_tom and not $ikketom[$y]
5868 210 0 0 !$overskrift_forrige && $nodup && $nodup[$x][$y]
5875 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
5895 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
5897 33 0 0 $fjern_tom and not $ikketom[$y]
6262 0 0 0 $p > 0 and not substr($s, $p - 1, 2) =~ /^\n/
6284 115 1 3 $m and $c ne '{'
6358 0 16 1 $inp and $bf =~ /,/
6712 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
6713 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
6720 12 8 0 exists $arg{'keys'} and ref $arg{'keys'} ne 'ARRAY'
6722 20 0 0 $arg{'adaptive'} and $arg{'counting_bits'} > 1
6775 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)
6791 10 0 1 @keys == 1 && ref $keys[0] eq 'ARRAY'
6795 15083 1 0 $bf->{'key_count'} >= $n and croak("Exceeded filter capacity $n")
6797 3973 0 11110 $cb == 1 and not $adaptive
6809 24 1 1 $bf->{'overflow'}{$pos}++ and keys %{$$bf{'overflow'};} > 10
6821 0 0 0 $_ >= $k - 1 and $bit == 0
6832 5 0 0 @keys == 1 && ref $keys[0] eq 'ARRAY'
6851 0 0 0 $_ > $k - 1 and $bit == 1
6852 0 0 0 $_ <= $k - 1 and $bit == 0
6864 0 0 8 @keys == 1 && ref $keys[0] eq 'ARRAY'
6877 0 0 1 @keys == 1 && ref $keys[0] eq 'ARRAY'
6890 1 1 1 @keys == 1 && ref $keys[0] eq 'ARRAY'
6895 501 0 0 $bf->{'key_count'} == 0 and croak('Deleted all and then some')
6904 585 0 918 $c == 1 and ++$ones
585 918 0 $c == 1 and ++$ones and $bf->{'overflow'}{$pos}
6933 0 0 0 0 < $p and $p < 1
6934 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, $_)
6975 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' : '')))))))
7122 0 0 0 $qrexcl and defined $File::Find::name
0 0 0 $qrexcl and defined $File::Find::name and $File::Find::name =~ /$qrexcl/
7216 0 7 1 $o{'v'} and @ARGV > 1
7228 11 0 0 $o{'k'} and $same
7229 11 0 0 not -e $_ and warn "$_ do not exists\n"
7230 11 0 0 not -r $_ and warn "$_ is not readable\n"
7231 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"
7267 0 7 1 $o{'v'} and @ARGV > 1

or 2 conditions

line l !l condition
1288 0 0 join(',', @{$types[0];}) || '?'
0 0 join(',', @{$types[1];}) || '?'
1383 7 25 shift() || 2
1960 1 1 $_[1] || 3
2290 5 5 $cmpsub ||= sub { $_[0] <=> $_[1]; }
2845 1 15000 $to || 1
2851 1 4000 $to || 1
3107 58 2 $len ||= 8
3108 57 3 $num ||= 1
3109 54 6 $chars ||= 'A-Za-z0-9,-./&%_!'
3110 0 6 $req[0] ||= \&Acme::Tools::pwgendefreq
3506 3 14 $dict || ''
3547 0 5 $dict || ''
3824 1 6 $r ||= sub { s/&(#160|nbsp);/ /g; s/&/&/g; s/^\s*(.*?)\s*$/$1/s; s/(\d) (\d)/$1$2/g if /^[\d \.\,]+$/; }
4089 1 1 $times ||= 3
4262 3 9 $hr->{$1} ||= {}
4594 4 0 $lt[2] || 12
4597 2 2 repl($time, qr/^[^\.]+/) || 0
4736 2009 3 $Eta{$id} ||= []
4802 0 0 $thr{$what} ||= []
5672 0 0 $opt{'prosent'} || 0
5673 0 4 $opt{'sortsub'} || \&Acme::Tools::_sortsub
5800 0 5 $o{'nodup'} || 0
5815 177 33 $bredde[$j] ||= 0
5816 0 0 $$tab[$i][$j] eq $$tab[$i - 1][$j] || ($nodup_rad = 0)
5874 235 26 shift @celle || ''
6005 0 0 shift() || 0
6010 1326 95 $level || 0
6252 94 27 $p || 0
6839 78165 11612 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0
78165 11612 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0 or last
6869 12919 2303 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0
12919 2303 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0 or last
6882 3000 0 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0
3000 0 vec $bf->{'filter'}, $h[$_] % $m, $cb or $match = 0 or last
6952 0 0 shift() || '/var/www/html/currency-rates'
6953 0 0 -x $_ or die
7232 6 5 {'gz', 'gunzip', 'bz2', 'bunzip2', 'xz', 'unxz'}->{$ext} || ''
7242 11 0 chall($_, $new) or die
7246 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
1259 0 0 0 not -e $fn or time - (stat $fn)[9] >= $Currency_rates_expire
1698 0 0 0 $l || recursed()
1766 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
1853 15 0 2 @_ < 3 or not length $p
1860 2 0 3 @_ < 3 or not length $p
1868 4 0 7 @_ < 3 or not length $p
2070 33 57 6996 !defined($min) || $_ < $min
2071 1 1 1 !defined($min) || $_ lt $min
2072 30 32 7030 !defined($max) || $_ > $max
2073 1 1 1 !defined($max) || $_ gt $max
2228 37367 0 91385 not $cmpsub and $search < $middle_value or $cmpsub and &$cmpsub($search, $middle_value) < 0
38422 0 51323 not $cmpsub and $search > $middle_value or $cmpsub and &$cmpsub($search, $middle_value) > 0
2330 2 0 270 $arefs[0][$_] ne $ar->[$_] or $arefs[0][$_] != $ar->[$_]
2360 0 0 1197 not $cmpsub and $a->[$_] > $$a[$_ + 1] or $cmpsub and &$cmpsub($a->[$_], $$a[$_ + 1]) > 0
2795 0 0 9 $_ < 0 or $_ > 100
2850 6502 11500 0 $_ > $max and $max = $_ or $_ < 0 and croak('negative weight')
3116 1 0 13908 ++$Pwgen_trials >= $Pwgen_max_trials or ($d = time_fp() - $t) > $Pwgen_max_sec * $num and not $d =~ /^\d+$/
3241 3 0 3 $notme{$_} || $seen{$_}++
3630 1 1 0 $IPADDR_memo{$ipnr} ||= gethostbyaddr(pack('C4', split(/\./, $ipnr, 0)), 2)
3817 1 1 7 1 > @_ or @_ > 3
4169 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
4267 27 0 6 length $section or $Read_conf_empty_section
4473 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]
4638 461 0 13042 $L > 28 || ($L > 27 ? 1 - (21 - $Y % 19) / 11 : 0)
4735 2003 9 0 $time_fp ||= time_fp()
4801 0 0 0 $what ||= join(':', @{[caller 1];}[3, 2])
4839 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)) }
4866 15 1 22 defined $_[0] and length $_[0] or @_ == 1
4918 0 4 0 shift() eq $uttrykk and return shift() or shift()
4919 0 0 0 not defined shift() and return shift() or shift()
4926 0 2 0 shift() == $uttrykk and return shift() or shift()
4927 0 0 0 not defined shift() and return shift() or shift()
5177 0 0 4 @_ != 3 or $jump == 0
5674 0 4 0 $opt{'sortsub_bortover'} || $sortsub
5675 0 4 0 $opt{'sortsub_nedover'} || $sortsub
5690 0 0 112 $opt_sum or defined $opt_pro
5852 0 0 5 $i == 0 or $venstretvang
5875 129 0 57 $x > 0 || $ikke_hodestrek
5895 0 0 28 $x % $pagesize == 0 || $nodup > 0 && !$nodup[$x + 1][$nodup - 1]
6055 0 0 188 not defined $level or $level >= 0
6092 0 0 0 $sub ne 'serialize' or $tilbake > 20
6281 0 0 2 $m or not @m
6734 1 1 18 $bf->{'error_rate'} <= 0 or $bf->{'error_rate'} >= 1
6934 0 0 0 !defined($flen) || $m < $flen
7115 0 0 0 $o{'M'} or $o{'P'}
7128 0 0 0 $o{'M'} or $o{'P'}
7151 0 0 0 $o{'M'} || $o{'P'}
7169 0 0 0 $m{$_} || chr $_
7192 0 0 0 not -e $fno or &$too_old($fno)
7410 0 0 0 $Wget ||= (grep((-x $_), map("$_/wget", '/usr/bin', '/bin', '/usr/local/bin', '.')))[0]
7414 0 0 0 $ARGV[0] || $Self_update_url