Condition Coverage

blib/lib/Net/DirectConnect/pslib/psmisc.pm
Criterion Covered Total %
condition 5 547 0.9


and 3 conditions

line !l l&&!r l&&r condition
254 0 0 0 $_[0] < 8 && $_[0] - int($_[0])
350 0 0 0 not $string and $ENV{'CONTENT_LENGTH'}
370 0 0 0 eval 'use ' . $module . ' qw(' . join(' ', @_) . ');1;' and $INC{$path}
380 0 0 0 @_ == 1 && !defined($_[0])
414 0 0 0 defined $mask and not $mask
424 0 0 0 defined $mask and not $mask
455 0 0 0 $fh{$_} and not @_
484 0 0 0 defined $config{'log_' . $_[0]} and not $config{'log_' . $_[0]}
0 0 0 defined $config{'log_' . $_[0]} and not $config{'log_' . $_[0]} and not $config{'log_all'}
513 0 0 0 ($html || $xml) && !$file
529 0 0 0 @_ and $config{'log_screen'}
0 0 0 @_ and $config{'log_screen'} and not $noscreen
0 0 0 @_ and $config{'log_screen'} and not $noscreen and !utf8::is_utf8($string) || utf8::valid($string)
568 0 0 0 $nologbody and not $handler
574 0 0 0 ref $handler eq 'CODE' and $ret = &$handler($_)
585 0 0 0 $^O =~ /^(?:(ms)?(dos|win(32|nt)?))/i and not $^O =~ /^cygwin/i
719 0 0 0 $ip =~ /^(?:0|127)\./ and !$host =~ /^(?:0|127)\./
720 0 0 0 $config{'norm_skip_host'} and ref $config{'norm_skip_host'} eq 'Regexp' ? $host =~ /$config{'norm_skip_host'}/ : $host =~ /$config{'norm_skip_host'}/i
764 0 0 0 $_[0]{'port'} && (!$static{'port2prot'}{$_[0]{'port'}} || $static{'port2prot'}{$_[0]{'port'}} ne $_[0]{'prot'})
803 0 0 0 $_{'port'} and !$static{'port2prot'}{$_{'port'}} || $static{'port2prot'}{$_{'port'}} ne $_{'prot'}
808 0 0 0 $_{'path'} =~ s[^/?$][] and $_{'name'} =~ s/(.+)//
0 0 0 $_{'path'} =~ s[^/?$][] and $_{'name'} =~ s/(.+)// and $dcuser = $1
0 0 0 $_{'path'} =~ s[^/?$][] and $_{'name'} =~ s/(.+)// and $dcuser = $1 and $_{'ext'} =~ s/(.*)//
0 0 0 $_{'path'} =~ s[^/?$][] and $_{'name'} =~ s/(.+)// and $dcuser = $1 and $_{'ext'} =~ s/(.*)// and $dcuser .= $1 ? ".$1" : ''
0 0 0 $_{'path'} =~ s[^/([^/]+)][] and $dcuser = $1
840 0 0 0 $_[0]{'port'} && (!$static{'port2prot'}{$_[0]{'port'}} || $static{'port2prot'}{$_[0]{'port'}} ne $_[0]{'prot'}) && (!%{{} unless $config{'sql'}{'table'}{$table}{'port'};} || $_[0]{'prot'} eq 'dchub')
894 0 0 0 $cfrom eq 'utf-8' and $config{'trans'}{$cto}
895 0 0 0 $cto eq 'utf-8' and $config{'trans'}{$cfrom}
897 0 0 0 $config{'trans'}{$cfrom} and $config{'trans'}{$cto}
1021 0 0 0 $cp_to eq 'utf-8' and utf8::decode($$string)
1024 0 0 0 not hconfig('no_cp_detect', $host) and ++$$data{'tries'} < 20 || !$$data{'cp'}
1042 0 0 0 $cp_default and $cp_default ne $cp_to
1054 0 0 0 $config{'trans_up'}{$cp} and $config{'trans_lo'}{$cp}
1061 0 0 0 $config{'trans_up'}{$cp} and $config{'trans_lo'}{$cp}
1134 0 0 0 $timeout and $@
1158 0 0 0 defined $int and length $int
1165 0 0 0 defined $min and $int < $min
1167 0 0 0 defined $max and $int > $max
1221 0 0 0 $_[0] > 1 and $config{'system'} eq 'win'
1313 0 0 0 $static{'config_read'}{$ENV{'SCRIPT_FILENAME'} . $file}++ and not $_[0]
1317 0 0 0 not $ENV{'SERVER_PORT'} || -e $file and -e $file . '.dist'
0 0 0 not $ENV{'SERVER_PORT'} || -e $file and -e $file . '.dist' and use_try 'File::Copy'
1436 0 0 0 $asfile and $asfile != 1
1438 0 0 0 $config{'cache_http'} and -e $c
0 0 0 $config{'cache_http'} and -e $c and -M $c < $config{'cache_http'}
1601 0 0 0 $$p{'wait'} and not $schedule{$$p{'id'}}{'last'}
1603 0 0 0 $schedule{$$p{'id'}}{'last'} + $$p{'every'} < time and !$$p{'runs'} || $schedule{$$p{'id'}}{'runs'} < $$p{'runs'}
0 0 0 $schedule{$$p{'id'}}{'last'} + $$p{'every'} < time and !$$p{'runs'} || $schedule{$$p{'id'}}{'runs'} < $$p{'runs'} and !(ref $$p{'cond'} eq 'CODE') || $$p{'cond'}($p, $schedule{$$p{'id'}}, @_)
0 0 0 $schedule{$$p{'id'}}{'last'} + $$p{'every'} < time and !$$p{'runs'} || $schedule{$$p{'id'}}{'runs'} < $$p{'runs'} and !(ref $$p{'cond'} eq 'CODE') || $$p{'cond'}($p, $schedule{$$p{'id'}}, @_) and ref $schedule{$$p{'id'}}{'func'} eq 'CODE'
1655 0 0 0 length $name and lockfile $name ne $_
1747 0 0 0 $program{$current}{'func'} and not $program{$current}{'disabled'}
1764 0 0 0 $current eq 'default' and not $n
1767 0 0 0 !($program{$current}{'notmask'} && $par =~ /$program{$current}{'notmask'}/i) && $par =~ /$program{$current}{'mask'}/i || $program{$current}{'force'} and not $program{$current}{'runned'}
1778 0 0 0 defined $$param{$par} && $$param{$par} ne ''
1786 0 0 0 $r[0] and not ref $r[0]
1854 0 0 0 !$$self{'connect_tries'} || $$self{'connect_tried'}++ <= $$self{'connect_tries'} and !$$self{'connect_chain_tries'} || $$self{'connect_chain_tried'}++ <= $$self{'connect_chain_tries'}
1918 0 0 0 $$self{'connected'} and not $$self{'connect_check'}

or 2 conditions

line l !l condition
139 0 0 $config{'stderr_redirect'} ||= '2>&1'
141 0 0 $config{'trans'}{'cp1251'} ||= "\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\250\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\270\262\263\257\277\252\272"
143 0 0 $config{'trans'}{'koi8-r'} ||= "\341\342\367\347\344\345\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\377\371\370\374\340\361\263\301\302\327\307\304\305\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\337\331\330\334\300\321\243\266\246\267\247\264\244"
145 0 0 $config{'trans'}{'iso8859-5'} ||= "\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\241\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\361\246\366\247\367\244\364"
147 0 0 $config{'trans'}{'cp866'} ||= "\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\360\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\361\366\367\370\371\364\365"
149 0 0 $config{'trans'}{'utf-8'} ||= "\320\321"
198 0 0 $config{'trans_name'}{'win1251'} ||= 'cp1251'
199 0 0 $config{'trans_name'}{'windows1251'} ||= 'cp1251'
200 0 0 $config{'trans_name'}{'windows-1251'} ||= 'cp1251'
201 0 0 $config{'trans_name'}{'win'} ||= 'cp1251'
202 0 0 $config{'trans_name'}{'1251'} ||= 'cp1251'
204 0 0 $config{'trans_name'}{'koi8r'} ||= 'koi8-r'
205 0 0 $config{'trans_name'}{'koi8'} ||= 'koi8-r'
206 0 0 $config{'trans_name'}{'koi'} ||= 'koi8-r'
208 0 0 $config{'trans_name'}{'iso88595'} ||= 'iso8859-5'
209 0 0 $config{'trans_name'}{'iso8859'} ||= 'iso8859-5'
210 0 0 $config{'trans_name'}{'iso'} ||= 'iso8859-5'
212 0 0 $config{'trans_name'}{'866'} ||= 'cp866'
213 0 0 $config{'trans_name'}{'dos'} ||= 'cp866'
215 0 0 $config{'trans_name'}{'utf8'} ||= 'utf-8'
216 0 0 $config{'trans_name'}{'utf'} ||= 'utf-8'
217 0 0 $config{'cp_detect_strings'} ||= 0
218 0 0 $config{'cp_detect_letters'} ||= 2
219 0 0 $config{'cp_detect_length'} ||= 10000
220 0 0 $config{'kilo'} ||= 8
221 0 0 $config{'lng'}{'en'}{'months'} ||= ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
222 0 0 $config{'lng'}{'ru'}{'months'} ||= ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек']
227 0 0 $config{'lng'}{'en'}{'wdays'} ||= ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
228 0 0 $config{'log_screen'} ||= 1
233 0 0 ($1 // $0) // 'log'
237 0 0 $config{'encode_url_file_mask'} ||= '[^a-zA-Z0-9\\-.()_]'
241 0 0 $_[1] || '/'
244 0 0 $config{'human'}{'date'} ||= sub { my $d = $_[1] || '/'; return strftime("%Y$d%m$d%d", localtime($_[0] || time)); }
247 0 0 $_[1] || ':'
249 0 0 $config{'human'}{'time'} ||= sub { my $d = $_[1] || ':'; return strftime("%H$d%M$d%S", localtime($_[0] || time)); }
252 0 0 $_[1] || '-'
0 0 $config{'human'}{'date_time'} ||= sub { return human('date', $_[0] || time, $_[2]) . ($_[1] || '-') . human('time', $_[0] || time, $_[3]); }
257 0 0 $config{'human'}{'float'} ||= sub { return $_[0] < 8 && $_[0] - int($_[0]) ? sprintf('%.' . ($_[0] < 1 ? 3 : ($_[0] < 3 ? 2 : 1)) . 'f', $_[0]) : int $_[0]; }
261 0 0 $now || ''
262 0 0 $config{'human'}{'micro_time'} ||= sub { my $now = time; ($now = human('float', abs int($now) - $now)) =~ s/^0//; return $now || ''; }
270 0 0 $config{'human'}{'rfc822_date_time'} ||= sub { my($day_of_month, $month, $year, $wday) = (localtime($_[0] || time))[3..6]; return sprintf($config{'lng'}{'en'}{'wdays'}[$wday] . ', %02d ' . $config{'lng'}{'en'}{'months'}[$month] . ' %02d', $day_of_month, $year + 1900) . ' ' . $config{'human'}{'time'}($_[0] || time) . ' +0300'; }
274 0 0 $unit //= 'B'
275 0 0 $config{'kilo'} || 8
282 0 0 $config{'human'}{'size'} ||= sub { my($size, $sp, $unit, $kilo) = @_; $sp //= $ENV{'SERVER_PORT'} ? ' ' : ' '; $unit //= 'B'; $kilo //= $config{'kilo'} || 8; return int($size / 1099511627776) . $sp . 'T' . $unit if $size >= $kilo * 1099511627776; return int($size / 1073741824) . $sp . 'G' . $unit if $size >= $kilo * 1073741824; return int($size / 1048576) . $sp . 'M' . $unit if $size >= $kilo * 1048576; return int($size / 1024) . $sp . 'K' . $unit if $size >= $kilo * 1024; return human('float', $size) . $sp . $unit if $size > 0; return $size; }
290 0 0 $config{'human'}{'number_k'} ||= sub { local $_ = $_[0]; $_ *= 1024 if $_ =~ s/kb?$//gi; $_ *= 1048576 if $_ =~ s/mb?$//gi; $_ *= 1073741824 if $_ =~ s/gb?$//gi; $_ *= 1099511627776 if $_ =~ s/tb?$//gi; return $_; }
293 0 0 $config{'human'}{'procent'} ||= sub { return sprintf('%' . ($_[0] < 10 ? '.3f' : 'd'), $_[0]) . '%'; }
311 0 0 $config{'human'}{'time_period'} ||= sub { my($tim, $delim, $sign) = @_; $sign = '-', $tim = -$tim if $tim < 0; return '' if $tim == 0 or $tim > 1000000000; return $sign . human('float', $tim) . $delim . 's' if $tim < 60; $tim = $tim / 60; return $sign . int($tim) . $delim . 'm' if $tim < 60; $tim = $tim / 60; return $sign . int($tim) . $delim . 'h' if $tim < 24; $tim = $tim / 24; return $sign . int($tim) . $delim . 'd' if $tim <= 31; $tim = $tim / 30.5; return $sign . int($tim) . $delim . 'M' if $tim < 12; $tim = $tim / 12; return $sign . int($tim) . $delim . 'Y'; }
318 0 0 $config{'human'}{'number'} ||= sub { return local $_ = reverse(join(' ', grep({length $_;} split(/(\d{3})/, reverse($_[0]), 0)))); }
321 0 0 $_[1] || 20
328 0 0 $config{'human'}{'string_long'} ||= sub { my $maxlen = $_[1] || 20; html_chars(\$_[0]); return $_[0] if length $_[0] <= $maxlen; my $print = substr($_[0], 0, $maxlen); $print =~ s/[\xD0\xD1]$//; $_[0] =~ s/\"/"/g; return '$print...]; }
349 0 0 $delim ||= '&'
415 0 0 $mask ||= '[^a-zA-Z0-9\\-.()_!,]'
435 0 0 $mask ||= '[^a-zA-Z0-9\\-.()_\\:@\\/!,=]'
502 0 0 $config{'log_delim'} || ' '
586 0 0 $config{'starter'} ||= 'cmd /c'
587 0 0 $config{'spawn_prefix'} ||= 'start /min /low'
589 0 0 $config{'spawn_postfix'} ||= '&'
645 0 0 (caller $_)[2] || (last)
798 0 0 $_{'path'} ||= '/'
1003 0 0 $data ||= {}
1004 0 0 cp_normalize($cp_to || hconfig('cp_db', $host)) || 'utf-8'
1053 0 0 shift() || 'cp1251'
1060 0 0 shift() || 'cp1251'
1201 0 0 $_[0] || 5
1235 0 0 $min ||= 0.5
1300 0 0 $root_path //= './'
1304 0 0 $config{'config_file'} // 'config.pl'
1435 0 0 $config{'cachedir'} || '.'
1457 0 0 hconfig('timeout', $url{'host'}, $url{'prot'}) || 10
1469 0 0 $method ||= 'GET'
1522 0 0 $method || 'GET'
1533 0 0 $ret || undef
1612 0 0 $config{'lock_dir'} || './'
0 0 $config{'lock_ext'} || '.lock'
1618 0 0 $config{'lock_sleep'} // 1
1619 0 0 $config{'lock_timeout'} // 600
1620 0 0 $config{'lock_old'} // 3600

or 3 conditions

line l !l&&r !l&&!r condition
229 0 0 0 $config{'log_dir'} ||= $config{'root_path'}
233 0 0 0 $1 // $0
0 0 0 $config{'log_default'} ||= (($1 // $0) // 'log') . '.log'
242 0 0 0 $_[0] || time
248 0 0 0 $_[0] || time
252 0 0 0 $_[0] || time
0 0 0 $_[0] || time
264 0 0 0 $_[0] || time
265 0 0 0 $_[0] || time
273 0 0 0 $sp //= $ENV{'SERVER_PORT'} ? ' ' : ' '
275 0 0 0 $kilo //= $config{'kilo'} || 8
298 0 0 0 $tim == 0 or $tim > 1000000000
494 0 0 0 $file =~ s/^[\-_]// or not $file
499 0 0 0 $ENV{'SERVER_PORT'} or $config{'view'} eq 'html'
0 0 0 $ENV{'SERVER_PORT'} or $config{'view'} eq 'html' or $config{'view'} =~ /http/i
529 0 0 0 !utf8::is_utf8($string) || utf8::valid($string)
622 0 0 0 $work{'$0'} || $0
645 0 0 0 (caller $_ + 1)[3] || (caller $_)[0]
650 0 0 0 $work{'$0'} ||= $0
667 0 0 0 $_ ||= $_[0]
754 0 0 0 $_[0] || time
757 0 0 0 $_[0] || time
764 0 0 0 !$_[0]{'path'} || $_[0]{'path'} =~ m[^/]
0 0 0 !($_[0]{'path'} || $_[0]{'host'} && ($_[0]{'name'} || $_[0]{'ext'})) || $_[0]{'path'} =~ m[/$]
788 0 0 0 $_[1] || $config{'sql_tresource'}
798 0 0 0 $_{'name'} or $_{'ext'}
803 0 0 0 !$static{'port2prot'}{$_{'port'}} || $static{'port2prot'}{$_{'port'}} ne $_{'prot'}
829 0 0 0 $_[1] || $config{'sql_tresource'}
844 0 0 0 $config{'trans_name'}{lc $_[0]} || lc $_[0]
850 0 0 0 not $cto or $cto eq 'utf-8'
870 0 0 0 $cto eq $cfrom or not length $string
0 0 0 $cto eq $cfrom or not length $string or not $cfrom
0 0 0 $cto eq $cfrom or not length $string or not $cfrom or not $cto
887 0 0 0 $cto eq $cfrom or not length $string
0 0 0 $cto eq $cfrom or not length $string or not $cfrom
0 0 0 $cto eq $cfrom or not length $string or not $cfrom or not $cto
907 0 0 0 $cto ||= $config{'cp_db'}
935 0 0 0 $cfrom ||= $config{'cp_db'}
1022 0 0 0 $cp_default || hconfig('cp_res', $host, $prot)
1024 0 0 0 ++$$data{'tries'} < 20 || !$$data{'cp'}
1079 0 0 0 $work{'lang'} || $config{'lang'}
0 0 0 $lang ||= $work{'lang'} || $config{'lang'}
1147 0 0 0 shift() // $_
1214 0 0 0 $static{'no_sig_log'} or $ENV{'SERVER_PORT'}
1230 0 0 0 $where ||= join('', caller)
1231 0 0 0 not $max or $ENV{'SERVER_PORT'}
1237 0 0 0 $work{'sleeper'}{$where} ||= $min
1257 0 0 0 $_[0] || *STDOUT
1295 0 0 0 $ENV{'SCRIPT_FILENAME'} || $work{'$0'} || $0
1317 0 0 0 $ENV{'SERVER_PORT'} || -e $file
1326 0 0 0 $_ or $_[1]
1369 0 0 0 $files || ()
1390 0 0 0 $INC{$file} || $file
1404 0 0 1 $ENV{'SCRIPT_FILENAME'} || $work{'$0'} || $0
1415 1 0 0 $order || ($conf{'conf_count'}{$id} += 10)
1457 0 0 0 $config{'useragent'} || $config{'crawler_name'}
1522 0 0 0 $config{'useragent'} || $config{'crawler_name'}
1596 0 0 0 $$p{'every'} ||= $every
1597 0 0 0 $$p{'id'} ||= join(';', caller)
1600 0 0 0 not $schedule{$$p{'id'}}{'func'} or $$p{'update'}
1603 0 0 0 !$$p{'runs'} || $schedule{$$p{'id'}}{'runs'} < $$p{'runs'}
0 0 0 !(ref $$p{'cond'} eq 'CODE') || $$p{'cond'}($p, $schedule{$$p{'id'}}, @_)
1618 0 0 0 $p{'sleep'} //= $config{'lock_sleep'} // 1
1619 0 0 0 $p{'timeout'} //= $config{'lock_timeout'} // 600
1620 0 0 0 $p{'old'} //= $config{'lock_old'} // 3600
1684 1 4 0 $setorder || ($order += $config{'order_step'} || 10)
0 5 0 $program{$current = $name}{'order'} ||= $setorder || ($order += $config{'order_step'} || 10)
1760 0 0 0 $program{$current}{'mask'} ||= "^-?$current\\d*\$"
1767 0 0 0 !($program{$current}{'notmask'} && $par =~ /$program{$current}{'notmask'}/i) && $par =~ /$program{$current}{'mask'}/i || $program{$current}{'force'}
1787 0 0 0 $program{$current}{'once'} or $program{$current}{'force'}
1821 0 0 0 $$self{$_} //= $_{$_}
1848 0 0 0 $$self{'in_connect'} or $$self{'in_disconnect'}
1854 0 0 0 !$$self{'connect_tries'} || $$self{'connect_tried'}++ <= $$self{'connect_tries'}
0 0 0 !$$self{'connect_chain_tries'} || $$self{'connect_chain_tried'}++ <= $$self{'connect_chain_tries'}