Branch Coverage

blib/lib/OSPF/LSDB/View.pm
Criterion Covered Total %
branch 414 506 81.8


line true false branch
127 1 112 if $self->ipv6
155 0 183 unless my $ospf = $self->{'ospf'}
176 1875 115 if (my $area = $colors->{'gray'})
177 0 1875 unless my $areagrays = $self->{'areagrays'}
180 0 1875 if (not $gray) { }
183 160 1715 $area eq 'ase' ? :
187 1875 115 unless $colors->{'black'}
115 1875 if (my(@areas) = &uniq(@{[] unless $colors->{'black'};}))
234 0 112 unless my $routehash = $self->{'routehash'}
238 49 203 if (@areas > 1) { }
240 3 1 unless $_->{'area'}
1 48 if (my(@badareas) = map({() unless $_->{'area'};} grep({not $_->{'bits'}{'B'};} @{$$rv{"hashes"};})))
249 1 251 if (my(@badareas) = grep({$rv->{'areas'}{$_} > 1;} @areas))
253 13 239 if ($rv->{'missing'}) { }
1 238 elsif (my(@badids) = grep({$_ ne $rid;} map({$_->{'routerid'};} @{$$rv{'hashes'};}))) { }
282 162 291 $self->ipv6 ? :
286 373 80 unless ($elem)
292 176 197 $bits->{'B'} ? :
295 172 201 if ($rid eq $routerid)
300 162 291 if ($self->ipv6) { }
328 112 71 unless $self->ipv6
329 112 71 unless $self->ipv6
330 112 71 unless $self->ipv6
341 0 112 unless my $nethash = $self->{'nethash'}
363 110 43 if $boundhash->{$rid}
377 0 366 unless my $linkhash = $$self{$type . "hash"}
385 0 183 unless my $routehash = $self->{'routehash'}
389 25 321 unless ($elem)
398 11 14 if ($rid eq $routerid)
412 0 183 unless my $routehash = $self->{'routehash'}
416 34 67 if ($routehash->{$asbr})
426 0 183 unless my $routehash = $self->{'routehash'}
475 74 6 unless ($elem)
486 112 112 $type eq 'pointtopoint' ? :
487 112 112 $type eq 'pointtopoint' ? :
488 0 224 unless my $routehash = $self->{'routehash'}
489 0 224 unless my $linkhash = $$self{$type . "hash"}
503 2 50 if ($type ne "pointtopoint" and @hashes > 1)
508 4 48 if (not $routehash->{$dstrid}{'areas'}{$area}) { }
2 46 elsif (not $linkhash->{$rid} && $linkhash->{$rid}{$area} && $linkhash->{$rid}{$area}{$dstrid} || $routehash->{$dstrid}{'missing'}) { }
522 1 26 if ($type eq "pointtopoint" and ($ifaddrs->{$intf} and $ifaddrs->{$intf}{$rid} > 1))
529 1 54 if ($type eq "pointtopoint" and my(@badrids) = sort(grep({$_ ne $rid;} keys %{$$ifaddrs{$intf};})))
580 0 112 unless my $nethash = $self->{'nethash'}
581 0 112 unless my $transithash = $self->{'transithash'}
585 3 92 if (not $nethash->{$addr} and keys %$av > 1)
593 3 98 if (not $nethash->{$addr} and keys %$ev > 1)
600 178 15 unless $rv->{'graph'}
602 1 14 if ($nethash->{$addr}) { }
3 11 elsif (not $colors{'orange'} || $colors{'blue'}) { }
622 0 195 unless my $nethash = $self->{'nethash'}
627 193 2 unless ($elem)
630 182 5 $_->{$area} ? :
15 178 unless ($nethash->{$addr} and map {$_->{$area} ? 1 : ();} map({values %$_;} values %{$$nethash{$addr};}))
648 0 112 unless my $transithash = $self->{'transithash'}
657 0 112 unless my $nethash = $self->{'nethash'}
658 0 112 unless my $routehash = $self->{'routehash'}
659 0 112 unless my $transithash = $self->{'transithash'}
671 2 191 if (@{$rv->{'hashes'};} > 1)
679 3 192 if ($ifaddrs->{$intf} and $ifaddrs->{$intf}{$rid} > 1)
685 3 192 if (my(@badrids) = sort(grep({$_ ne $rid;} keys %{$$ifaddrs{$intf};})))
693 81 114 $addr eq $intf ? :
697 16 179 if ($rv->{'graph'})
718 181 543 if $_ ne 255
722 1 180 if (&_maskip($addr, $mask) ne &_maskip($intf, $mask))
731 4 183 unless my $ev = $nv->{$area}
735 2 181 if (not $ev->{'attachrouters'}{$rid}) { }
2 286 elsif ($addr eq $intf and $netrid ne $rid) { }
791 0 112 unless my $nethash = $self->{'nethash'}
802 0 112 unless my $stubhash = $self->{'stubhash'}
809 5 26 if ($netsmv{$net}{$mask})
814 1 30 if (keys %$mv > 1)
822 1 31 if (keys %$ev > 1)
827 1 31 if ($netsmv{$net}{$mask} and my(@otherareas) = sort(grep({$_ ne $area;} map({keys %$_;} map({values %$_;} @{$netsmv{$net}{$mask};})))))
837 1 32 if ($netsmv{$net}{$mask} and grep {$_->{$rid};} @{$netsmv{$net}{$mask};})
861 33 3 unless ($elem)
878 0 112 unless my $stubhash = $self->{'stubhash'}
887 0 112 unless my $routehash = $self->{'routehash'}
888 0 112 unless my $stubhash = $self->{'stubhash'}
902 2 31 if (@{$rv->{'hashes'};} > 1)
912 3 33 if ($net ne $addr)
918 3 9 if $_ ne 255
981 0 112 unless my $nethash = $self->{'nethash'}
982 0 112 unless my $nets = $self->{'nets'}
987 1 87 if (keys %$av > 1)
996 11 78 if ($nets->{$net}{$mask} > 1)
1001 2 87 if (keys %$mv > 1)
1008 1 90 if (keys %$rv > 1)
1016 2 90 if (@{$ev->{'hashes'};} > 1)
1023 1 91 if (@attrids == 0)
1028 1 91 if (@attrids == 1)
1059 92 2 unless ($elem)
1089 0 112 unless my $nethash = $self->{'nethash'}
1098 0 112 unless my $nethash = $self->{'nethash'}
1099 0 112 unless my $routehash = $self->{'routehash'}
1100 0 112 unless my $transithash = $self->{'transithash'}
1110 89 267 if $_ ne 255
1122 2 194 if ($attcolors{$arid})
1129 4 190 if ($routehash->{$arid}{'areas'} and not $routehash->{$arid}{'areas'}{$area})
1137 1 6 unless ($tv or $routehash->{$arid}{'missing'})
1143 11 77 if ($arid eq $rid and $tv and not grep({$addr eq $_->{'interface'};} @{$$tv{"hashes"};}))
1154 0 196 unless my $dst = $routehash->{$arid}{'graph'}{'N'}
1157 93 103 if ($arid eq $rid)
1173 3 91 unless ($attcolors{$rid})
1175 0 3 unless my $dst = $routehash->{$rid}{'graph'}{'N'}
1239 0 92 unless my $netareas = $self->{'netareas'}
1240 0 92 unless my $stubareas = $self->{'stubareas'}
1241 0 92 unless my $sumhash = $self->{'sumhash'}
1249 25 30 if (@areas > 1) { }
1254 2 53 if (my(@badareas) = grep({$netareas->{$net}{$mask}{$_};} @areas))
1258 3 52 if ($stubareas and my(@badareas) = grep({$stubareas->{$net}{$mask}{$_};} @areas))
1286 55 103 unless ($elem)
1307 0 144 unless my $sumhash = $self->{'sumhash'}
1315 0 92 unless my $routehash = $self->{'routehash'}
1316 0 92 unless my $sumhash = $self->{'sumhash'}
1328 0 158 unless my $dst = $routehash->{$rid}{'graph'}{'N'}
1332 158 474 if $_ ne 255
1337 1 157 unless ($routehash->{$rid}{'areas'}{$area})
1342 4 154 if ($mv->{'arearids'}{$area}{$rid} > 1)
1358 127 31 if $src
1380 0 25 unless my $sumhash = $self->{'sumhash'}
1389 21 25 if $mv->{'graph'}{'C'}
1392 1 24 if grep {not /^(gray|black)$/;} keys %$colors
1399 27 4 if (not $elem) { }
3 1 elsif (not $elem->{'colors'}{'gray'} && $colors->{'gray'} or $elem->{'colors'}{'gray'} ne $colors->{'gray'}) { }
1408 0 3 unless $colors->{'black'}
1423 17 1 unless ($elem)
1436 17 10 if (not $elem->{'colors'}) { }
1 9 elsif (not $elem->{'colors'}{'gray'} && $colors->{'gray'} or $elem->{'colors'}{'gray'} ne $colors->{'gray'}) { }
1442 0 1 unless $colors->{'black'}
1461 0 25 unless my $sumaggr = $self->{'sumaggr'}
1469 0 25 unless my $sumaggr = $self->{'sumaggr'}
1484 2 29 if (grep {not /^(gray|black)$/;} keys %{$$s{'colors'};}) { }
1491 22 0 if $aggrs
1536 0 151 unless my $boundhash = $self->{'boundhash'}
1539 31 70 if (@areas > 1) { }
1558 81 99 unless ($elem)
1578 0 151 unless my $boundhash = $self->{'boundhash'}
1586 0 99 unless my $routehash = $self->{'routehash'}
1587 0 99 unless my $boundhash = $self->{'boundhash'}
1593 18 63 if ($bv->{'graph'}) { }
27 36 elsif ($routehash->{$asbr}) { }
1601 0 180 unless my $dst = $routehash->{$rid}{'graph'}{'N'}
1604 1 179 if ($asbr eq $rid) { }
8 171 elsif ($routehash->{$asbr} and $routehash->{$asbr}{'areas'}{$area}) { }
1612 2 178 unless ($routehash->{$rid}{'areas'}{$area})
1617 8 172 if ($bv->{'arearids'}{$area}{$rid} > 1)
1632 134 46 if $src
1653 0 30 unless my $boundhash = $self->{'boundhash'}
1659 20 36 unless $bv->{'graph'}
1662 0 36 if grep {not /^(gray|black)$/;} keys %$colors
1668 44 2 if (not $elem) { }
0 2 elsif (not $elem->{'colors'}{'gray'} && $colors->{'gray'} or $elem->{'colors'}{'gray'} ne $colors->{'gray'}) { }
1677 0 0 unless $colors->{'black'}
1689 22 1 unless ($elem)
1703 22 22 if (not $elem->{'colors'}) { }
3 19 elsif (not $elem->{'colors'}{'gray'} && $colors->{'gray'} or $elem->{'colors'}{'gray'} ne $colors->{'gray'}) { }
1709 3 0 unless $colors->{'black'}
1727 0 30 unless my $boundaggr = $self->{'boundaggr'}
1735 0 30 unless my $boundaggr = $self->{'boundaggr'}
1750 4 42 if (grep {not /^(gray|black)$/;} keys %{$$b{'colors'};}) { }
1756 27 0 if $aggrb
1801 0 99 unless my $nets = $self->{'nets'}
1802 0 99 unless my $stubs = $self->{'stubs'}
1804 0 99 unless my $externhash = $self->{'externhash'}
1811 3 84 if ($nets->{$net}{$mask})
1815 5 82 if ($stubs and $stubs->{$net}{$mask})
1819 4 83 if ($sums->{$net}{$mask})
1842 87 51 unless ($elem)
1862 0 151 unless my $externhash = $self->{'externhash'}
1870 0 99 unless my $routehash = $self->{'routehash'}
1873 0 99 unless my $externhash = $self->{'externhash'}
1888 134 355 if $_ ne 255
1894 9 129 if ($mv->{'routers'}{$rid} > 1)
1899 128 10 $type == 1 ? :
1906 98 40 if ($routehash->{$rid})
1908 0 98 unless my $dst = $routehash->{$rid}{'graph'}{'N'}
1915 17 81 if $src
1919 12 28 unless ($av)
1921 0 12 unless my $dst = $boundhash->{$rid}{'graph'}{'N'}
1928 8 4 if $src
1934 0 36 unless my $dst = $boundaggr->{$asbraggr}{'graph'}{'N'}
1942 2 34 if (grep {not /^(gray|black)$/;} keys %colors) { }
1943 0 2 if $src
1949 19 68 if $src
1970 0 19 unless my $externhash = $self->{'externhash'}
1979 3 70 if $mv->{'graph'}{'C'}
1982 2 68 if grep {not /^(gray|black)$/;} keys %$colors
1988 105 2 if (not $elem) { }
0 2 elsif (not $elem->{'colors'}{'gray'} && $colors->{'gray'} or $elem->{'colors'}{'gray'} ne $colors->{'gray'}) { }
1997 0 0 unless $colors->{'black'}
2010 32 6 unless ($elem)
2023 32 73 if (not $elem->{'colors'}) { }
0 73 elsif (not $elem->{'colors'}{'gray'} && $colors->{'gray'} or $elem->{'colors'}{'gray'} ne $colors->{'gray'}) { }
2029 0 0 unless $colors->{'black'}
2047 0 19 unless my $externaggr = $self->{'externaggr'}
2055 0 19 unless my $externaggr = $self->{'externaggr'}
2081 4 107 if (grep {not /^(gray|black)$/;} keys %colors) { }
2101 0 24 unless my $cluster = $$self{$type . "cluster"}
2103 74 24 if @$graphlist < 2
2119 55 803 if $cluster
2122 913 4341 if $k eq "C" or $k eq "N"
2127 55 803 if $cluster
2144 1478 512 if ($self->{'todo'}{'warning'})
2145 707 771 if ($graph->{'label'}) { }
2150 0 1478 if ($self->{'todo'}{'warning'}{'all'}) { }
2157 0 1990 unless $_->{'graph'}
2169 2468 6071 if $k eq "S" or $k eq "D"
2187 4 179 if ($todo->{'intra'})
2188 4 0 if $self->ipv6
2195 2 181 if ($todo->{'link'})
2196 2 0 if $self->ipv6
2198 4 179 if ($todo->{'intra'})
2199 4 0 if $self->ipv6
2201 144 39 if $todo->{'summary'}
2202 151 32 if $todo->{'boundary'}
2203 151 32 if $todo->{'external'}
2214 112 71 unless $self->ipv6
2215 2 181 if ($todo->{'link'})
2216 2 0 if $self->ipv6
2218 4 179 if ($todo->{'intra'})
2219 4 0 if $self->ipv6
2220 4 0 if $self->ipv6
2222 144 39 if $todo->{'summary'}
2223 151 32 if $todo->{'boundary'}
2224 151 32 if $todo->{'external'}
2233 12 171 if ($todo->{'cluster'})
2240 25 119 if $todo->{'summary'} and $todo->{'summary'}{'aggregate'}
2242 30 121 if $todo->{'boundary'} and $todo->{'boundary'}{'aggregate'}
2244 19 132 if $todo->{'external'} and $todo->{'external'}{'aggregate'}
2249 112 71 unless $self->ipv6
2251 2 181 if ($todo->{'link'})
2252 2 0 if $self->ipv6
2254 4 179 if ($todo->{'intra'})
2255 4 0 if $self->ipv6
2256 4 0 if $self->ipv6
2258 144 39 if ($todo->{'summary'})
2261 25 119 if $todo->{'summary'}{'aggregate'}
2263 151 32 if ($todo->{'boundary'})
2266 30 121 if $todo->{'boundary'}{'aggregate'}
2268 151 32 if ($todo->{'external'})
2271 19 132 if $todo->{'external'}{'aggregate'}
2278 112 71 unless $self->ipv6
2281 2 181 if ($todo->{'link'})
2282 2 0 if $self->ipv6
2284 4 179 if ($todo->{'intra'})
2285 4 0 if $self->ipv6
2286 4 0 if $self->ipv6
2288 144 39 if ($todo->{'summary'})
2291 25 119 if $todo->{'summary'}{'aggregate'}
2293 151 32 if ($todo->{'boundary'})
2296 30 121 if $todo->{'boundary'}{'aggregate'}
2298 151 32 if ($todo->{'external'})
2301 19 132 if $todo->{'external'}{'aggregate'}