Branch Coverage

blib/lib/WWW/BookBot.pm
Criterion Covered Total %
branch 71 268 26.4


line true false branch
39 21 0 ref $_[1] ? :
108 21 0 if $$self{'language_encode'} ne ''
110 21 0 if $$self{'language_decode'} ne ''
120 0 21 if $@
127 0 21 if $$self{'get_from_file'} or $$self{'get_save_file'}
135 147 399 $self->can($sub) ? :
154 0 21 if $work_dir eq ''
191 0 0 unless defined $pattern
195 0 0 if ($_[0] ne '')
199 0 0 $result ? :
217 0 540 unless defined $str
225 4006 3 if $_ ne ''
236 10 530 if ($str =~ /^\(case\)\|/s) { }
245 717 4089 if $_ eq '['
246 717 4089 if $_ eq ']'
247 2208 2598 if $meet_left == 0 and not /^\\/
356 84 0 $_[0]{'language_encode'} ne '' ? :
360 636 0 $_[0]{'language_decode'} ne '' ? :
373 0 18 unless open WORK, ">$filename"
375 6 12 if $filetype eq 'result' and $$self{'result_no_crlf'} or $filetype eq 'debug'
376 0 18 unless print WORK @_
378 0 18 unless close WORK
384 0 42 unless open WORK, ">>$filename"
386 9 33 if $filetype eq 'result' and $$self{'result_no_crlf'} or $filetype eq 'debug'
387 0 42 unless print WORK @_
389 0 42 unless close WORK
395 0 6 unless sysopen WORK, $filename, 577
397 0 6 unless syswrite WORK, $_[0], 200000000
399 0 6 unless close WORK
475 18 9 if -f $$self{'file_DB'}
488 0 3 unless unlink $filename
495 0 24 unless open WORK, $filename
499 15 216 if (/(.)\$bot->go_([^\(]*)\((.*)\)/)
501 15 0 $1 eq '#' ? :
502 15 0 $3 =~ /url=>\'([^\']*)\'/ ? :
506 0 24 unless close WORK
511 0 3 unless defined $$pargs{'url'}
537 21 3 unless defined $$self{'get_lasturl'}
552 3 24 if $proxy_name eq 'No' or $proxy_name eq ''
555 3 21 if ($proxy_name ne 'Default')
564 0 21 if ($^O eq 'MSWin32')
566 0 0 unless $@
568 21 0 unless $ie_proxy_ok
572 0 0 unless $iekey = $RegHash{'CUser/Software/Microsoft/Windows/CurrentVersion/Internet Settings/'}
574 0 0 unless $ie_proxy_enable = $$iekey{'/ProxyEnable'}
575 0 0 unless $ie_proxy_server = $$iekey{'/ProxyServer'}
576 0 0 unless $ie_proxy_enable =~ /1$/
579 0 0 if ($ie_proxy_server =~ /;/) { }
582 0 0 if $_ eq ''
583 0 0 if /^(.*?)=(.*?)$/
605 9 0 if ($len < 1024) { }
0 0 elsif ($len < 10238976) { }
618 0 0 if (ord substr($str, $i, 1) >= 128) { }
619 0 0 if $j + 2 > $limit_len
622 0 0 if $j + 1 > $limit_len
656 0 0 if $res->is_success
657 0 0 if $res->code == 404
659 0 0 if ($$self{'get_delay_second'} > 0)
667 0 0 if $res->is_success or $res->code == 404
668 0 0 if $i > 1
677 0 0 unless ref $pargs
678 0 0 if $$self{'get_lasturl'} eq ''
680 0 0 if $$self{'get_from_file'}
682 0 0 defined $$pargs{'method'} ? :
702 0 0 if ($first_run)
706 0 0 if ($expected_length > 0)
708 0 0 if $expected_trunks > $screen_limit_trunk
711 0 0 if $expected_length > 0
718 0 0 if $trunk_ceil > $screen_limit_trunk
720 0 0 if $trunk_floor > $screen_limit_trunk - 1
723 0 0 if ($trunk_floor > $trunk_received)
726 0 0 if ($trunk_floor < $trunk_ceil and $bytes_received >= $trunk_refresh_now + $get_trunk_fresh_size)
727 0 0 if ++$trunk_status >= scalar @trunk_statuschar
731 0 0 if ($bytes_received >= $trunk_refresh_now + $get_trunk_fresh_size)
732 0 0 if ($expected_length > 0 and $trunk_ceil >= $screen_limit_trunk)
734 0 0 if $trunk_percent > 100
744 0 0 $method eq 'get' ? :
748 0 0 if $res->is_success
751 0 0 if $res->is_success
752 0 0 if ++$$self{'get_agent_cur'} >= @{$$self{'get_agent_array'};}
753 0 0 if ($res->is_success and $$self{'get_save_file'})
765 0 0 if defined $_[0]->request->uri
806 0 2 unless $entity2char{$2}
897 0 0 unless $$self{'space_leading_remove'}
901 0 0 if ($_[0] =~ /\n$spaces .*?\n$linefollow$linefollow$linefollow/o)
909 0 0 unless $$self{'space_inner_remove'}
912 0 0 unless $_[0] =~ /$pattern/o
942 0 0 unless ref $pargs
948 0 0 if ($$pargs{'url'} eq '')
953 0 0 unless ($res->is_success)
965 0 0 if $$self{'patterns'}{'catalog_head'} ne ''
966 0 0 if $$self{'patterns'}{'catalog_end'} ne ''
970 0 0 $$pargs{'book_num'} > 0 ? :
971 0 0 $$pargs{'book_num'} > 0 ? :
991 0 3 if $self->catalog_get_bookargs($pargs1, $1, $2, $3, $4, $5, $6, $7, $8, $9) eq 'Skip'
999 0 0 if $$self{'patterns'}{'catalog_get_next'} eq ''
1000 0 0 $_[0] =~ /$$self{'patterns'}{'catalog_get_next'}/so ? :
1004 0 0 if $$pargs{'level'} eq ''
1005 0 0 if $$pargs{'level'} == 0
1006 0 0 if $$pargs{'bpos'} eq ''
1014 0 0 if ($$pargs{'level'} > $$self{'book_max_levels'})
1016 0 0 if ($$pargs{'title'} eq '')
1018 0 0 if ($$pargs{'url'} eq '')
1020 0 0 if ($$self{'get_skip_zip'} and $$pargs{'url'} =~ /(?:$$self{'patterns'}{'postfix_zip'})$/i)
1022 0 0 if ($$self{'get_skip_media'} and $$pargs{'url'} =~ /(?:$$self{'patterns'}{'postfix_media'})$/i)
1024 0 0 if (defined $$self{'DB_visited_book'}{$$pargs{'url'}})
1029 0 0 unless ($res->is_success)
1030 0 0 if $$pargs{'level'} == 0
1042 0 0 $url1 =~ /\.([^\.]+)$/ ? :
1044 0 0 if ($$pargs{'ext_save'} =~ /^(?:$$self{'patterns'}{'postfix_free'}|)$/)
1047 0 0 if $$pargs{'ext_save'} eq ''
1052 0 0 if ($$pargs{'content_len'} > 0)
1053 0 0 if ($$pargs{'ext_real'} eq 'txt') { }
0 0 elsif ($$pargs{'content_type'} eq 'text/html') { }
1061 0 0 length $str == 0 ? :
0 0 if $$pargs{'level'} == 0
1073 0 0 if ($$pargs{'chapter_num'} == 0)
1105 0 0 if defined $result_time
1117 0 3 if $$pargs{'data_len'} == 0
1127 0 6 if defined $result_time
1132 0 6 if $$self{'book_has_chapters'} == 0
1133 0 6 if $$self{'patterns'}{'TOC_exists'} ne '' and not $str =~ /$$self{'patterns'}{'TOC_exists'}/so
1134 6 0 if $$self{'patterns'}{'chapters_head'} ne ''
1135 6 0 if $$self{'patterns'}{'chapters_end'} ne ''
1140 0 3 if $self->chapters_get_chapterargs($pargs1, $1, $2, $3, $4, $5, $6, $7, $8, $9) eq 'Skip'
1147 0 0 if $_[0]{'patterns'}{'TOC_head'} ne ''
1148 0 0 if $_[0]{'patterns'}{'TOC_end'} ne ''
1157 3 3 if ($$pargs{'level'} == 0 and $$pargs{'data_len'} > 0) { }
1164 0 3 if defined $result_time
1169 6 0 $$pargs{'data_len'} > 0 ? :
1170 3 3 if $$pargs{'level'} == 0 and $$pargs{'data_len'} > 0
1173 6 0 if $_[0]{'patterns'}{'chapter_head'} ne ''
1174 6 0 if $_[0]{'patterns'}{'chapter_end'} ne ''
1212 0 371 if $_ eq ''