Branch Coverage

blib/lib/Novel/Robot/Parser.pm
Criterion Covered Total %
branch 35 144 24.3


line true false branch
74 0 0 unless $url =~ /^https?:/
80 0 0 $base_dom =~ /\./ ? :
87 0 2 if ($s and $s =~ /^https?:/)
89 0 0 if exists $SITE_DOM_NAME{$dom}
93 0 2 if ($s and -f $s)
95 0 0 if lc $suffix eq "txt"
132 0 2 if $self->site_type eq "tiezi"
135 2 0 if (not $index_url =~ /^https?:/) { }
172 0 4 if exists $o{$k}
183 0 1 if exists $self->{'book_path'}
184 0 1 if exists $self->{'book_regex'}
185 0 1 if exists $self->{'writer_path'}
186 0 1 if exists $self->{'writer_regex'}
239 0 0 if exists $self->{'item_list_path'}
246 1 0 if exists $r->{'item_list'}
250 0 0 unless exists $path_r->{'path'}
261 0 0 if exists $_->{'url'}
263 0 0 if ($path_r->{'sort'})
284 0 0 unless $up_url =~ m[/]
294 0 0 if ($depth == $links[$i]{'depth'} and $parent eq $links[$i]{'parent'}) { }
304 0 0 if @temp_arr
317 0 0 if $opt{'chapter_url_regex'} and $x->{'url'} =~ /$opt{'chapter_url_regex'}/
318 0 0 if $opt{'chapter_title_regex'} and $x->{'title'} =~ /$opt{'chapter_title_regex'}/
320 0 0 if $x and $x->{'title'} =~ /$title_regex/ or $y and $y->{'title'} =~ /$title_regex/ or $z and $z->{'title'} =~ /$title_regex/
321 0 0 if $x->{'url'} =~ /$chap_num_regex/ || $z->{'url'} =~ /$chap_num_regex/ and scalar @$arr > 50
324 0 0 if $res_arr
331 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/) { }
341 0 0 if ($res_arr and defined $res_arr->[0]{'url'} and $res_arr->[0]{'url'} =~ /$chap_num_regex/)
344 0 0 if ($opt{'sort_chapter_url'}) { }
352 0 0 if $s[$i] > $s[$i + 1]
353 0 0 if $random_sort
355 0 0 if $random_sort == 0
364 0 1 if exists $self->{'content_path'}
365 0 1 if exists $self->{'content_regex'}
376 0 0 unless $r->{'content'}
384 0 0 if ($next_url)
409 0 0 if $r->{'content'} =~ m[]s
410 0 0 if $r->{'content'} =~ /^\s*
411 0 0 if $r->{'content'} =~ /(\x{4e0a}|\x{4e0b})\x{4e00}(\x{7ae0}|\x{9875}|\x{7bc7})/s
412 0 0 if $r->{'content'} =~ m[]s
413 0 0 if $r->{'content'} =~ /All rights reserved/s
414 0 0 if $r->{'content'} =~ m[(.+?){5,}]s
422 0 0 if $_->{'content'} =~ /(\x{4e0a}|\x{4e0b})\x{4e00}(\x{7ae0}|\x{9875}|\x{7bc7})/s
427 0 0 if $cc_n > 5 and $no_next_r->{'word_num'} > 50 or not @grep_next_r
438 0 0 $self->{'site'} ne 'default' ? :
480 0 0 if $topic->{'content'}
530 0 22 if ref $chap ne "HASH"
531 10 12 if ($chap->{'url'})
540 0 22 if ($chap->{'url'} and $rem{$chap->{'url'}} > 1) { }
547 22 0 unless $chap->{'content'} =~ /\x{6b63}\x{5728}\x{624b}\x{6253}\x{4e2d}/s
556 3 2 wantarray ? :
561 0 12 unless $base_url
562 2 10 unless $base_url =~ /^https?:/
574 2 0 if $o{'sub'}
583 2 0 unless $c
584 0 0 if exists $o{'sub'}
585 0 0 unless $c
593 0 2 if $o->{'regex'}
594 0 2 unless $o->{'path'}
600 0 2 $o->{'is_list'} ? :
602 2 0 unless defined $r->{'data'}
604 0 0 unless $o->{'sub'}
628 0 2 if $o{'min_content_word_num'}
631 0 2 if $o{'only_poster'}
634 0 2 if $o{'grep_content'}
637 0 2 if $o{'filter_content'}
639 6 0 if defined $_->{'content'}
648 0 6 if $f->{'word_num'}
658 0 0 unless defined $c
681 0 6 unless $c
711 0 0 unless $h