Branch Coverage

blib/lib/Games/Tournament/Swiss/Procedure/FIDE.pm
Criterion Covered Total %
branch 293 404 72.5


line true false branch
127 0 5605 unless $transitions and ref $transitions eq 'ARRAY'
130 5605 0 if $action
131 133 5472 if (&any(sub { $_ eq $oldState; } , $self->loggedProcedures))
134 133 0 if %log
136 0 5605 if ($state eq 'ERROR')
140 47 5558 if ($state eq 'LAST')
143 0 5558 unless grep /$state/, @alterStates
160 1 46 if (defined $message) { }
0 46 elsif ($self->{'message'}) { }
176 133 0 if (defined $logreport) { }
0 0 elsif ($self->{'logreport'}) { }
193 0 47 if defined $index
219 0 219 unless defined $index
220 16 203 if defined $index and $index eq $self->lastBracket
222 0 203 unless defined $next
225 0 203 unless defined $nextBracket and $nextBracket->isa('Games::Tournament::Swiss::Bracket')
249 0 0 if defined $index and $index eq $self->firstBracket
280 49 157 if (@$members == 1) { }
295 612 1454 if ($alreadyPlayed->{$id}{$candidate}) { }
30 1424 elsif ($colorClashes->{$id}{$candidate}) { }
298 92 491 if ($rejections >= @candidates or @candidates == 0)
303 72 85 if (@unpairables)
312 192 14 if $previousIndex
313 122 84 if $previousBracket
314 122 84 if $previousBracket
315 121 85 if (@unpairables) { }
316 89 32 if ($index eq $self->lastBracket and $index ne $self->firstBracket) { }
0 32 elsif (grep {$_->floating eq 'Down' if $_->floating;} @unpairables and $previousIndex and $previousMembers) { }
27 5 elsif (defined $self->nextBracket) { }
321 7 33 if $_->floating
341 25 2 if (@unpairables == @$members) { }
379 0 45 if (@members == 1) { }
392 210 276 if ($alreadyPlayed->{$id}{$candidate}) { }
0 276 elsif ($colorClashes->{$id}{$candidate}) { }
395 20 148 if ($rejections >= @candidates or @candidates == 0)
399 20 25 if (@unpairables)
405 20 25 if (@unpairables) { }
425 0 131 unless defined $group->xprime
448 28 103 if ($group->hetero) { }
475 0 330 unless @$s1
476 0 330 unless @$s2
507 0 1369 if grep({$_->id eq $member->id;} @{$group->s2;}) > 1
532 0 1517 unless @$s1 and @$s2
533 0 1517 if $#$s1 > $#$s2
534 0 1517 unless @$s1 and @$s2
541 3140 1080 if $pos <= $#$s1
542 1080 3140 if $pos > $#$s1
549 2110 1030 if ($test) { }
550 236 794 defined $badpos ? :
552 794 723 unless (grep({defined $_;} @B1passer) >= $pprime)
560 0 723 unless @B1passer
563 0 1376 unless defined $B1passer[$pos]
566 1367 9 if ($test) { }
567 1 8 defined $badpos ? :
569 8 715 unless (grep({defined $_;} @B2passer) >= $pprime)
576 0 715 unless @B2passer
581 0 1066 unless defined $B2passer[$pos]
587 622 444 if ($quota <= $x) { }
588 167 455 if $group->hetero
591 0 444 defined $badpos ? :
593 443 272 unless (grep({defined $_;} @Xpasser) >= $pprime)
600 0 272 unless @Xpasser
607 80 192 if (defined $badpos)
614 0 192 unless @$passer
616 0 246 unless defined $passer->[$pos]
618 451 41 defined $_->score ? :
619 112 134 if ($score[0] > $score[1]) { }
134 0 elsif ($score[0] == $score[1]) { }
635 0 192 if ($#paired >= $pprime)
644 148 44 if @nonpaired
646 192 0 if @paired
648 28 58 if ($group->hetero and @nonpaired and $group->bigGroupXprime)
657 148 44 if (@nonpaired) { }
192 0 if (@paired)
677 0 148 unless defined $nonpaired and @$nonpaired
680 60 88 if (not $group->hetero && @$nonpaired > 1 || $islastBracket) { }
699 16 72 $group->{'xdeduction'} ? :
709 23 65 if ($islastBracket and @$nonpaired == 1)
728 24 64 if $group->{'c10repaired'}
730 27 61 if $group->{'lowfloaterlastshuffle'}
731 25 63 if $group->{'c11repaired'}
733 10 78 if $group->{'lastheteroshuffle'}
735 43 45 if ($islastBracket)
740 6 39 if (@rejections and not @$nonpaired % 2) { }
770 0 1414 if ($self->{'lowfloaterlastshuffle'})
778 0 1414 unless defined $badpair
780 461 953 unless (@newS2)
785 101 138 if $group->hetero or $group->{'remainderof'} and $group->{'remainderof'}{'lastheteroshuffle'}
788 402 59 unless $group->hetero
796 16 73 if ($lastC10shuffle and ref $lastC10shuffle eq 'ARRAY' and @$lastC10shuffle and &all(sub { $newOrder[$_] == $lastC10shuffle->[$_]; } , 0 .. $#$lastC10shuffle))
825 348 54 if ($group->c8swapper) { }
834 168 234 unless (@newMembers)
866 67 160 if ($group->floatCheckWaive eq 'None') { }
61 99 elsif ($group->floatCheckWaive eq 'B6Down') { }
54 45 elsif ($group->floatCheckWaive eq 'B5Down') { }
24 21 elsif ($group->floatCheckWaive eq 'B6Up') { }
20 1 elsif ($group->floatCheckWaive eq 'B5Up') { }
1 0 elsif ($group->floatCheckWaive eq 'All') { }
919 9 95 if ($group->{'c10repaired'} and $group->{'lowfloaterlastshuffle'}) { }
32 63 elsif ($group->{'remainderof'}) { }
25 38 elsif ($group->floatCheckWaive eq 'B5Down') { }
21 17 elsif ($group->floatCheckWaive eq 'B6Up') { }
17 0 elsif ($group->floatCheckWaive eq 'B5Up') { }
0 0 elsif ($group->floatCheckWaive eq 'All') { }
922 3 6 if ($group->{'remainderof'}) { }
6 0 elsif ($group->hetero) { }
951 3 6 if ($heteroBracket->floatCheckWaive eq 'B5Up') { }
3 3 elsif ($heteroBracket->floatCheckWaive eq 'B6Down' or $heteroBracket->floatCheckWaive eq 'B5Down') { }
3 0 elsif ($heteroBracket->floatCheckWaive eq 'B6Up') { }
973 17 15 if ($group->{'remainderof'}{'c11repaired'} or $group->{'remainderof'}{'c12repaired'})
994 3 12 if (not $heteroBracket->{'c10repaired'}) { }
12 0 elsif ($group->{'lastshuffle'}) { }
1071 2 35 if ($group->{'c11repaired'} and $group->{'lastheteroshuffle'}) { }
3 32 elsif ($group->{'c10repaired'}) { }
15 17 elsif ($group->{'remainderof'}) { }
13 4 elsif ($xprime < $pprime) { }
1073 2 0 if ($heteroBracket = $group->{'remainderof'}) { }
0 0 elsif ($group->hetero) { }
1093 2 0 if ($bigGroupXprime < $bigGroupPprime) { }
1110 0 3 if $matches
1121 3 0 $group->{'remainder'} ? :
1128 0 15 if ($group->{'remainderof'}{'c12repaired'}) { }
15 0 elsif ($group->{'c11repaired'}) { }
1157 0 13 if ($group->{'remainder'}) { }
1198 1 3 if ($index eq $first)
1207 2 1 if ($group->{'c12repaired'} or $previous->{'c12repaired'}) { }
0 1 elsif ($group->{'c11repaired'}) { }
0 1 elsif ($group->{'remainderof'} and $group->{'remainderof'}{'c12repaired'}) { }
0 1 elsif ($group->{'remainderof'} and $group->{'remainderof'}{'c11repaired'}) { }
1 0 elsif ($group->hetero) { }
0 0 elsif (not $group->hetero) { }
1215 0 0 unless ($previous->{'c12repaired'})
1220 0 0 if $matches
1259 0 0 if $matches->{$c11Remainder}
1272 0 0 if ($bracketAbove and $bracketAbove->hetero) { }
0 0 elsif (not $bracketAbove->hetero) { }
1377 2 90 unless ($index eq $self->lastBracket)
1381 1 89 if ($index eq $self->firstBracket)
1386 32 57 if (@$members == 1)
1392 30 2 unless ($byeGone)
1407 57 2 if (@returnees)
1421 2 57 if ($penultpPrime and not @returnees)
1423 1 1 if $penultxPrime
1428 1 58 if ($penultpPrime == 0)
1443 58 0 if ($penultpPrime > 0) { }
1478 23 7 $index =~ /Bye$/ ? :
1512 2 0 if ($pprime)
1514 2 0 if $x
1522 0 2 if ($pprime == 0 and $index eq $self->lastBracket and defined $self->penultpPrime) { }
0 2 elsif ($pprime < $p and $index eq $self->lastBracket) { }
0 2 elsif ($pprime > 0) { }
0 2 elsif ($nextgroup->{'remainderof'}) { }
1603 1 317 if ¬all(sub { $_->firstround <= $round - $lookback; } , @pair)
1609 17 300 unless $s1role and $s2role
1610 133 167 if $s1role eq $s2role
1611 167 167 unless $_ eq (&ROLES())[0]
0 167 unless 2 == grep({$_ eq (&ROLES())[1] unless $_ eq (&ROLES())[0];} $s1role, $s2role)
1620 0 4 unless ($roles[0] or $roles[1])
1624 4 242 unless ($roles[0])
1625 4 0 $roles[1] eq (&ROLES())[1] ? :
1631 27 219 unless ($roles[1])
1632 10 17 $roles[0] eq (&ROLES())[1] ? :
1638 189 57 if ($roles[0] ne $roles[1]) { }
18 39 elsif ($strengths[0] ne $strengths[1]) { }
8 31 elsif (@lastdiff) { }
1643 11 7 if (defined($stronger = (grep {$pair[$_]->preference->strength eq 'Absolute';} (0, 1))[0])) { }
7 0 elsif (defined($stronger = (grep {$pair[$_]->preference->strength eq 'Strong';} (0, 1))[0])) { }
0 0 elsif (defined($stronger = (grep {$pair[$_]->preference->strength eq 'Mild';} (0, 1))[0])) { }
1677 3 15 $stronger == 0 ? :
1724 652 7364 if (defined $brackets) { }
7364 0 elsif ($self->{'brackets'}) { }
1751 0 5107 unless $index{$b}{'score'} <=> $index{$a}{'score'}
1803 412 0 if (defined $place)
1808 407 1113 if $next
1809 412 701 if $index eq $place
1811 407 5 unless $nextBracket eq $place
1831 308 796 if $index eq $place
1853 44 34 if /^\d+(\.5)?$/
1855 0 22 unless defined $index
1859 0 22 if $bracket->{'remainderof'}
1875 0 515 if (defined $round) { }
515 0 elsif ($self->{'round'}) { }
1893 416 8364 if (defined $thisBracket) { }
8317 47 elsif (defined $self->{'thisBracket'}) { }
1910 30 30 if (defined $byer) { }
30 0 elsif ($self->{'byer'}) { }
1927 0 0 if (defined $paired) { }
0 0 elsif ($self->{'paired'}) { }
1944 148 148 if (defined $nonpaired) { }
148 0 elsif ($self->{'nonpaired'}) { }
1961 0 333 if (defined $matches) { }
333 0 elsif ($self->{'matches'}) { }
1978 0 1768 if (defined $whoPlayedWho) { }
1722 46 elsif ($self->{'whoPlayedWho'}) { }
1994 0 1768 if (defined $colorClashes) { }
1260 508 elsif ($self->{'colorClashes'}) { }
2010 0 0 if (defined $incompatibles) { }
0 0 elsif ($self->{'incompatibles'}) { }
2027 0 62 if (defined $byes) { }
62 0 elsif ($self->{'byes'}) { }
2044 58 0 if (defined $penultpPrime) { }
0 0 elsif ($self->{'penultpPrime'}) { }