Branch Coverage

blib/lib/Novel/Robot/Parser.pm
Criterion Covered Total %
branch 34 138 24.6


line true false branch
74 0 0 unless $url =~ /^https?:/
80 0 0 $base_dom =~ /\./ ? :
87 0 2 if ($url and $url =~ /^https?:/)
89 0 0 if exists $SITE_DOM_NAME{$dom}
129 0 2 if $self->site_type eq "tiezi"
132 2 0 if (not $index_url =~ /^https?:/) { }
169 0 4 if exists $o{$k}
180 0 1 if exists $self->{'book_path'}
181 0 1 if exists $self->{'book_regex'}
182 0 1 if exists $self->{'writer_path'}
183 0 1 if exists $self->{'writer_regex'}
236 0 0 if exists $self->{'item_list_path'}
243 1 0 if exists $r->{'item_list'}
247 0 0 unless exists $path_r->{'path'}
258 0 0 if exists $_->{'url'}
260 0 0 if ($path_r->{'sort'})
281 0 0 unless $up_url =~ m[/]
291 0 0 if ($depth == $links[$i]{'depth'} and $parent eq $links[$i]{'parent'}) { }
301 0 0 if @temp_arr
314 0 0 if $opt{'chapter_url_regex'} and $x->{'url'} =~ /$opt{'chapter_url_regex'}/
315 0 0 if $opt{'chapter_title_regex'} and $x->{'title'} =~ /$opt{'chapter_title_regex'}/
317 0 0 if $x and $x->{'title'} =~ /$title_regex/ or $y and $y->{'title'} =~ /$title_regex/ or $z and $z->{'title'} =~ /$title_regex/
318 0 0 if $x->{'url'} =~ /$chap_num_regex/ || $z->{'url'} =~ /$chap_num_regex/ and scalar @$arr > 50
321 0 0 if $res_arr
328 0 0 if (defined $y->{'title'} and $y->{'title'} =~ /$title_regex/ and defined $y->{'url'} and $y->{'url'} =~ /\.html$/ and not $x->{'url'} =~ /\.html$/) { }
0 0 elsif (defined $y->{'title'} and $y->{'title'} =~ /$title_regex/ and defined $y->{'url'} and $y->{'url'} =~ /$chap_num_regex/ and not $x->{'url'} =~ /$chap_num_regex/) { }
338 0 0 if ($res_arr and defined $$res_arr[0]{'url'} and $$res_arr[0]{'url'} =~ /$chap_num_regex/)
341 0 0 if ($opt{'sort_chapter_url'}) { }
349 0 0 if $s[$i] > $s[$i + 1]
350 0 0 if $random_sort
352 0 0 if $random_sort == 0
361 0 1 if exists $self->{'content_path'}
362 0 1 if exists $self->{'content_regex'}
373 0 0 unless $r->{'content'}
381 0 0 if ($next_url)
406 0 0 if $r->{'content'} =~ m[]s
407 0 0 if $r->{'content'} =~ /^\s*
408 0 0 if $r->{'content'} =~ /(\x{4e0a}|\x{4e0b})\x{4e00}(\x{7ae0}|\x{9875}|\x{7bc7})/s
409 0 0 if $r->{'content'} =~ m[]s
410 0 0 if $r->{'content'} =~ /All rights reserved/s
411 0 0 if $r->{'content'} =~ m[(.+?){5,}]s
419 0 0 if $_->{'content'} =~ /(\x{4e0a}|\x{4e0b})\x{4e00}(\x{7ae0}|\x{9875}|\x{7bc7})/s
424 0 0 if $cc_n > 5 and $no_next_r->{'word_num'} > 50 or not @grep_next_r
462 0 0 if $topic->{'content'}
516 0 22 if ref $chap ne "HASH"
517 10 12 if ($chap->{'url'})
526 0 22 if ($chap->{'url'} and $rem{$chap->{'url'}} > 1) { }
533 22 0 unless $chap->{'content'} =~ /\x{6b63}\x{5728}\x{624b}\x{6253}\x{4e2d}/s
542 3 2 wantarray ? :
547 0 12 unless $base_url
548 2 10 unless $base_url =~ /^https?:/
560 2 0 if $o{'sub'}
569 2 0 unless $c
570 0 0 if exists $o{'sub'}
571 0 0 unless $c
579 0 2 if $o->{'regex'}
580 0 2 unless $o->{'path'}
586 0 2 $o->{'is_list'} ? :
588 2 0 unless defined $r->{'data'}
590 0 0 unless $o->{'sub'}
614 0 2 if $o{'min_content_word_num'}
617 0 2 if $o{'only_poster'}
620 0 2 if $o{'grep_content'}
623 0 2 if $o{'filter_content'}
625 6 0 if defined $_->{'content'}
634 0 6 if $f->{'word_num'}
644 0 0 unless defined $c
667 0 6 unless $c
697 0 0 unless $h