Branch Coverage

blib/lib/Sphinx/Config.pm
Criterion Covered Total %
branch 129 184 70.1


line true false branch
63 2 0 if @_
83 0 7 unless -f $filename
86 0 7 unless open $fh, "<$filename"
137 15 0 if ($input =~ / $/) { }
146 103 302 if ($state eq 'outer') { }
302 0 elsif ($state eq 'inner') { }
152 8 211 unless length $tok
153 54 157 if ($seq eq 'section') { }
43 114 elsif ($seq eq 'name') { }
43 71 elsif ($seq eq 'openorinherit') { }
17 54 elsif ($seq eq 'inherit') { }
54 0 elsif ($seq eq 'openblock') { }
154 43 11 if ($tok =~ /^(?:source|index)$/o) { }
11 0 elsif ($tok =~ /^(?:indexer|searchd|search|common)$/o) { }
173 17 26 if ($tok eq ':') { }
182 0 17 if $tok eq $$current{'_name'}
184 0 17 unless ($self->_setup_inherit($current, $tok, \@config))
190 0 54 unless $tok eq '{'
200 54 248 if ($input =~ s/^\s*\}//o) { }
244 4 elsif ($input =~ s/^\s*([\w]+)\s*=\s*(.*)\s*$//o) { }
4 0 elsif ($input =~ s/^\s+$//o) { }
208 13 231 if (exists $$current{'_data'}{$k} and not $$current{'_inherited'}{$k}) { }
209 0 13 if (ref $$current{'_data'}{$k} eq 'ARRAY') { }
239 43 11 $$_{'_name'} ? :
252 17 3 if ($config) { }
256 0 31 unless $$c{'_name'}
257 17 14 if ($$c{'_name'} eq $name and $$c{'_type'} eq $type)
264 3 0 if $name
278 0 20 unless defined $base and $base != $current
282 3 17 if ($$current{'_inherit'})
286 2 10 unless $v
299 2 148 if exists $$out{$f}
365 40 3 if $name
368 2 41 unless $current
369 34 7 if ($var)
370 3 31 if ($var =~ /^_/) { }
432 18 1 if $name
434 1 18 unless ($$self{'_keys'}{$key})
437 1 0 if $name
444 2 17 if (not defined $var and $value) { }
14 3 elsif (not ref $var) { }
3 0 elsif (ref $var eq 'HASH') { }
446 0 2 unless ($self->_change_inherit($key, $value))
451 2 12 if (not defined $var) { }
0 12 elsif ($var =~ /^_/) { }
453 2 0 if (my $entry = delete $$self{'_keys'}{$key})
455 2 0 if ($i >= 0)
465 0 0 if (defined $value) { }
479 1 2 if ($value)
481 0 1 unless ($self->_change_inherit($key, $value))
499 15 1 if $name
501 15 1 if (defined $value) { }
509 3 13 if ($$self{'_keys'}{$key}{'_inherit'})
513 12 4 unless $$self{'_keys'}{$key}{'_children'}
515 0 8 unless my $c = $$self{'_keys'}{$ckey}
516 4 4 if ($$self{'_bestow'}) { }
517 4 0 if ($$c{'_inherited'}{$var})
518 2 2 if (defined $value) { }
538 2 1 if $name
553 3 0 if $$section{'_inherited'}{$sk}
584 8 2 if (not $last or $$pos[1] > $$last[1])
591 5 4 if (not $last) { }
607 13 2 if (not ref $value) { }
635 0 19 unless $section
638 12 7 unless ($$section{'_pos'}{$var})
640 3 9 if $$section{'_new'}
667 0 3 unless $section
668 0 3 if $$section{'_new'}
674 0 7 unless defined $$file[$line]
675 7 0 if ($was) { }
0 0 elsif ($$file[$line] =~ s/\{/$base_name {/) { }
676 3 4 if ($$file[$line] =~ s/(:\s*)$was/$1$base_name/ or $$file[$line] =~ s/^(\s*)$was(\s*(\{|\Z))/$1$base_name$2/)
693 0 3 unless $self->_setup_inherit($section, $base_name)
714 0 0 unless ($filename or $$self{'_filename'})
721 0 3 unless open $fh, ">$filename"
798 0 6 unless ($$self{'_file'} and @{$$self{'_file'};})
806 1 32 unless ($$section{'_lines'})
810 7 25 if ($$section{'_append'})
816 50 1 unless $$file[$line] =~ /(\s*)#\s*$var/
824 7 0 if (%$A)
833 2 4 $comment ? :
835 15 2116 unless defined $line
841 0 1 if $s =~ /}$/
842 1 0 $$c{'_name'} ? :
844 0 1 if ($$c{'_inherit'} and $$self{'_bestow'})
850 0 2 if $$self{'_bestow'} and $$c{'_inherited'}{$k}
863 0 7 if (ref $value eq 'ARRAY') { }
889 0 0 $comment ? :
891 0 0 $$c{'_name'} ? :
893 0 0 if ($$c{'_inherit'} and $$self{'_bestow'})
899 0 0 if $$self{'_bestow'} and $$c{'_inherited'}{$k}
900 0 0 if (ref $$data{$k} eq 'ARRAY') { }