Branch Coverage

blib/lib/Games/Tournament/Swiss/Bracket.pm
Criterion Covered Total %
branch 165 230 71.7


line true false branch
55 0 287 unless defined $score
72 0 0 unless @{$self->members;}
93 0 0 unless @{$self->members;}
117 0 6 unless &any(sub { $_->pairingNumber == $foreigner->pairingNumber; } , @$members)
119 0 6 unless $direction eq 'Up' or $direction eq 'Down'
135 0 0 unless @{$self->members;}
153 0 1 unless @$members and $self->trueHetero
157 3 0 defined $member->score ? :
177 0 57 unless @{$self->members;}
179 56 147 if $_->floating
198 8764 0 unless &any(sub { $member->pairingNumber == $_->pairingNumber; } , @$floated)
216 0 2259 if ($floater) { }
236 0 575 if @stayers == @$members
265 0 575 if &any(sub { $_->{'id'} eq $myId; } , @$members)
284 0 0 if (&any(sub { $_->pairingNumber == $returnee->pairingNumber; } , @$emigrants))
312 64 6877 if (defined $flag) { }
315 64 0 $flag ? :
318 1802 5075 $self->{'dissolved'} ? :
336 1984 5107 if (defined $s1) { }
5099 8 elsif ($self->{'s1'}) { }
356 3233 8442 if (defined $s2) { }
8442 0 elsif ($self->{'s2'}) { }
377 0 1186 unless $#$members >= 1
380 149 1037 if ($self->hetero) { }
384 692 2 defined $member->score ? :
403 0 1186 if &any(sub { not defined $_; } , @s1, @s2)
429 1 59 if $memberChangeTest
445 0 3567 unless $n >= 2
447 378 3189 if ($self->hetero) { }
450 1921 5 defined $member->score ? :
454 0 378 unless defined $lowestScore
456 0 378 if $p > $n / 2
477 17 12 if ($self->{'remainderof'}) { }
0 12 elsif ($self->{'remaindered'}) { }
486 0 29 unless $n >= 2
503 192 1887 if (defined $p) { }
1880 7 elsif (defined $pprime) { }
523 0 37 if (defined $p) { }
8 29 elsif (defined $bigGroupPprime) { }
525 0 0 if ($self->{'remainderof'}) { }
0 0 elsif ($self->{'remainder'}) { }
552 177 145 @$players % 2 ? :
570 1684 210 if $_->preference->role
576 176 53 $w >= $b ? :
577 37 192 $x < 0 ? :
593 398 38 if $_->preference->role
597 39 54 $w >= $b ? :
599 0 93 if ($self->{'remainderof'}) { }
0 93 elsif ($self->{'remainder'}) { }
618 5 239 if (defined $x) { }
72 167 elsif (defined $xprime) { }
620 0 5 if ($self->{'remainderof'}) { }
5 0 elsif ($self->{'remainder'}) { }
629 21 146 if ($self->{'remainderof'}) { }
53 93 elsif ($self->{'remainder'}) { }
631 18 3 if defined $x
635 0 53 if defined $x
654 77 1639 if (defined $x) { }
1553 86 elsif (defined $xprime) { }
675 0 1187 if $level and not $level =~ /^(?:None|B6Down|B5Down|B6Up|B5Up|All)$/i
678 222 965 if (defined $level) { }
965 0 elsif (defined $self->{'floatCheck'}) { }
679 0 1 unless $level eq 'None' or $oldLevel eq 'None' and $level eq 'B6Down' or $oldLevel eq 'B6Down' and $level eq 'B5Down' or $oldLevel eq 'B6Down' and $level eq 'B6Up' or $oldLevel eq 'B5Down' and $level eq 'B6Up' or $oldLevel eq 'B6Up' and $level eq 'B5Up' or $oldLevel eq 'B5Up' and $level eq 'All' or $oldLevel eq 'All' and $level eq 'None' or $oldLevel eq 'All' and $level eq 'B6Down'
711 31184 2392 defined $member->score ? :
715 5191 1773 if @range == 1
717 0 1773 unless defined $min
718 657 1116 if $tally{$min} <= @members / 2
719 1116 0 if $tally{$min} > @members / 2
737 3 0 defined $member->score ? :
741 0 1 unless @range
742 0 1 if @range == 1
764 0 1719 if $position > $#$s2
766 0 1719 if $bigLastGroup
783 0 2730 if @pattern == $digit
786 1249 1481 unless $nextPattern[$digit] == 0
789 470 1249 unless grep {$_;} @nextPattern
847 0 0 $n ? :
870 162 85 if (not $oddBracket) { }
85 0 elsif ($oddBracket) { }
887 162 85 if (not $oddBracket) { }
85 0 elsif ($oddBracket) { }
933 177 376 unless $exchange
944 0 376 if &any(sub { not defined $_; } , @members)
961 0 380 if (defined $score) { }
380 0 elsif (exists $self->{'score'}) { }
978 0 9645 if (defined $number) { }
9494 151 elsif (exists $self->{'number'}) { }
995 1384 2931 if (defined $badpair) { }
2801 130 elsif (defined $self->{'badpair'}) { }
1012 2103 16353 if (defined $members) { }
16264 89 elsif ($self->{'members'}) { }
1029 223 750 if (defined $c8swapper) { }
696 54 elsif ($self->{'c8swapper'}) { }
1048 0 272 unless $levels and ref $levels eq 'ARRAY'
1060 367 515 if ($level =~ /^B5/i) { }
1062 315 567 if ($level =~ /Down$/i) { }
375 192 elsif ($level =~ /Up$/i) { }
1066 3 937 unless defined $pairtestee[$pos]
1068 1710 164 defined $_->score ? :
1071 937 0 unless $direction eq 'None'
1073 869 68 if ($test) { }
1075 0 68 defined $badpos{$level} ? :
1076 0 68 defined $badpos ? :
1080 128 61 if ($direction ne 'Up' and @nopairtestee and !$self->hetero || grep({defined $_;} @nopairtestee) == 1)
1086 186 128 unless defined $nopairtestee[$pos]
1087 128 0 if defined $nopairtestee[$pos] and ref $nopairtestee[$pos] eq 'ARRAY'
1094 12 244 if $player and not $test
1096 244 12 if $test
1098 116 12 if ($tableTest >= 2) { }
1100 0 12 defined $badpos{$level} ? :
1101 0 12 defined $badpos ? :
1102 12 0 if $idCheck
1109 80 610 if (@retainables < $pprime or keys %badpos)
1115 66 80 unless defined $badpos{$nextLevel}
1151 0 599 unless defined $pairables[$pos]