Branch Coverage

blib/lib/Search/ContextGraph.pm
Criterion Covered Total %
branch 100 250 40.0


line true false branch
195 0 12 unless exists $check{$k}
197 0 15 if (@forbidden)
220 1 14 if ($$obj{'use_file'})
225 1 0 unless $$obj{'neighbors'} = tie(%neighbors, 'MLDBM', $$obj{'use_file'})
252 0 0 unless -d $dir
255 0 0 unless (defined $code and ref $code and ref $code eq 'CODE')
276 0 0 if /^\./
277 0 0 unless -f $_
278 0 0 unless open my $fh, $_
282 0 0 unless close $fh
307 0 0 unless -f $file
308 0 0 if $$self{'loaded'}
323 0 0 unless defined $old and defined $new
325 0 0 unless exists $$self{'neighbors'}{_nodeify('D', $old)}
331 0 0 if exists $$self{'neighbors'}{$good}
356 0 0 unless $file
358 0 0 unless -f $file
382 1 2 unless $threshold
384 1 1 unless $threshold > 0
411 0 2 $_[0]{'xs'} ? :
421 0 2 if $$self{'xs'}
453 0 2 unless $start_energy
455 1 1 unless $start_energy > 0
470 1 2 unless defined $_[1]
507 0 420 unless defined $words
508 0 420 unless ref $words and ref $words eq 'HASH' or ref $words eq 'ARRAY'
511 0 420 unless defined $title
514 0 420 if exists $$self{'neighbors'}{$dnode}
518 419 1 if (ref $words eq 'ARRAY') { }
524 0 420 unless scalar @list
531 2 13487 ref $words eq 'HASH' ? :
574 250 170 if $$self{'auto_reweight'}
594 0 0 unless defined $path and -f $path
597 0 0 exists $params{'name'} ? :
600 0 0 unless open my $fh, $path
605 0 0 if (exists $params{'parse'}) { }
606 0 0 unless ref $params{'parse'}
608 0 0 unless ref $params{'parse'} eq 'CODE'
612 0 0 unless ref $ref and ref $ref =~ /(HASH|ARRAY)/
627 0 0 unless $ref
654 0 0 if $$self{'auto_reweight'}
679 0 37 unless defined $type
680 0 37 unless $type =~ /^[TD]$/io
682 0 37 unless defined $name
684 0 37 unless defined $name
688 0 37 unless exists $$n{$node}
693 0 37 if $$self{'debug'}
701 976 229 if (scalar keys %{$$n{$t};} == 0)
702 0 976 if $$self{'debug'}
712 37 0 if $$self{'auto_reweight'}
726 0 4 unless defined $doc
739 0 4 unless defined $term
756 0 0 unless $type
758 0 0 unless $type =~ /^[dt]$/
759 0 0 $type eq 't' ? :
761 0 0 unless @shared
800 0 0 unless defined $type
802 0 0 unless $limit
804 0 0 if (lc $type eq 'd') { }
0 0 elsif (lc $type eq 't') { }
821 0 0 if $from eq $to
823 0 0 if $dist
846 1 1 if (exists $nodes{'documents'})
849 1 1 if (exists $nodes{'terms'})
906 145076 5210 unless $node =~ /^D:/o
907 0 5210 if $$self{'debug'} > 1
915 0 173163 unless $lcount
917 173163 0 if ($$self{'use_global_weights'}) { }
955 0 2 if $$self{'xs'}
956 0 2 unless defined $id
959 1 1 unless exists $$self{'neighbors'}{$dnode}
960 0 1 unless defined $words and ref $words and ref $words eq 'HASH' || ref $words eq 'ARRAY'
971 1 0 if (ref $words eq 'ARRAY')
986 3 1 if (exists $$n{$t}) { }
992 0 3 unless ($loc == $$words{$term})
1011 0 3 unless exists $seen{$t}
1015 1 0 if $must_reweight
1033 173186 304 if (defined $term) { }
1034 173186 0 unless $term =~ /^T:/
1036 3 173183 unless defined $node
1056 0 4 if (defined $term and not $term =~ /T:/)
1059 0 4 defined $term ? :
1128 0 0 if (defined $file) { }
1129 0 0 unless open $fh, "> $file"
1185 0 9 if (defined $doc) { }
1187 0 0 unless defined $node
1207 1 2 defined $doc ? :
1234 3 1 if (defined $term) { }
1241 879 0 unless $term =~ /^T:/o
1308 13 89 if $d =~ /$match_me/
1341 0 2 unless defined $type
1343 0 2 unless $type =~ /^[DT]/io
1354 0 2 if $bad_node eq $target
1360 5 9 if (exists $$self{'neighbors'}{$target}{$n}) { }
1374 0 9 if exists $$self{'neighbors'}{$target}{$n}
1408 0 0 unless defined $incoming and ref $incoming and ref $incoming eq 'HASH'
1434 0 0 if ($$self{'xs'}) { }
1453 21 60 $k =~ /^D:/ ? :
1463 0 4 unless exists $$self{'neighbors'}{$node}
1474 18 188028 wantarray ? :
1481 0 0 if $$self{'debug'} > 1
1483 0 0 unless -f $file
1484 0 0 unless open my $fh, $file
1493 0 0 if ($$self{'xs'}) { }
1505 0 0 defined $$map{$tnode} ? :
1532 0 0 if $$self{'debug'} > 1
1546 0 0 unless $type
1547 0 0 unless $node_name
1548 0 0 if $$self{'node_map'}{$node_name}
1576 0 17194 unless $node =~ /^[DT]:/
1585 0 37 unless scalar keys %inbound == scalar keys %outbound
1590 0 17194 unless $inbound{$node} == $outbound{$node}
1638 0 0 if exists $visited{$start}
1640 0 0 unless $start
1655 0 0 if $visited{$l}
1683 0 81 unless $$e{$k} > $$self{'COLLECT_THRESHOLD'}
1700 0 81 unless defined $$self{'neighbors'}{$node}
1703 0 81 if $$self{'depth'} == $$self{'max_depth'}
1706 0 81 if ($$self{'debug'} > 1)
1718 0 81 if ($degree == 0)
1733 30 51 if ($degree == 1 and $energy < $$self{'START_ENERGY'}) { }
12 39 elsif ($subenergy > $$self{'ACTIVATE_THRESHOLD'}) { }
1738 0 12 if $$self{'debug'} > 1
1745 0 69 if $$self{'debug'} > 1
1761 0 5630 unless defined $arr and ref $arr and ref $arr eq 'ARRAY'