Branch Coverage

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


line true false branch
134 0 5605 unless $transitions and ref $transitions eq 'ARRAY'
137 5605 0 if $action
138 133 5472 if (&any(sub { $_ eq $oldState; } , $self->loggedProcedures))
141 133 0 if %log
143 0 5605 if ($state eq 'ERROR')
147 47 5558 if ($state eq 'LAST')
150 0 5558 unless grep /$state/, @alterStates
167 1 46 if (defined $message) { }
0 46 elsif ($self->{'message'}) { }
183 133 0 if (defined $logreport) { }
0 0 elsif ($self->{'logreport'}) { }
200 0 47 if defined $index
226 0 219 unless defined $index
227 16 203 if defined $index and $index eq $self->lastBracket
229 0 203 unless defined $next
232 0 203 unless defined $nextBracket and $nextBracket->isa('Games::Tournament::Swiss::Bracket')
256 0 0 if defined $index and $index eq $self->firstBracket
287 49 157 if (@$members == 1) { }
302 612 1454 if ($alreadyPlayed->{$id}{$candidate}) { }
30 1424 elsif ($colorClashes->{$id}{$candidate}) { }
305 92 491 if ($rejections >= @candidates or @candidates == 0)
310 72 85 if (@unpairables)
319 192 14 if $previousIndex
320 122 84 if $previousBracket
321 122 84 if $previousBracket
322 121 85 if (@unpairables) { }
323 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) { }
328 7 33 if $_->floating
348 25 2 if (@unpairables == @$members) { }
386 0 45 if (@members == 1) { }
399 210 276 if ($alreadyPlayed->{$id}{$candidate}) { }
0 276 elsif ($colorClashes->{$id}{$candidate}) { }
402 20 148 if ($rejections >= @candidates or @candidates == 0)
406 20 25 if (@unpairables)
412 20 25 if (@unpairables) { }
432 0 131 unless defined $group->xprime
455 28 103 if ($group->hetero) { }
482 0 330 unless @$s1
483 0 330 unless @$s2
514 0 1369 if grep({$_->id eq $member->id;} @{$group->s2;}) > 1
539 0 1517 unless @$s1 and @$s2
540 0 1517 if $#$s1 > $#$s2
541 0 1517 unless @$s1 and @$s2
548 3140 1080 if $pos <= $#$s1
549 1080 3140 if $pos > $#$s1
556 2110 1030 if ($test) { }
557 236 794 defined $badpos ? :
559 794 723 unless (grep({defined $_;} @B1passer) >= $pprime)
567 0 723 unless @B1passer
570 0 1376 unless defined $B1passer[$pos]
573 1367 9 if ($test) { }
574 1 8 defined $badpos ? :
576 8 715 unless (grep({defined $_;} @B2passer) >= $pprime)
583 0 715 unless @B2passer
588 0 1066 unless defined $B2passer[$pos]
594 622 444 if ($quota <= $x) { }
595 167 455 if $group->hetero
598 0 444 defined $badpos ? :
600 443 272 unless (grep({defined $_;} @Xpasser) >= $pprime)
607 0 272 unless @Xpasser
614 80 192 if (defined $badpos)
621 0 192 unless @$passer
623 0 246 unless defined $passer->[$pos]
625 451 41 defined $_->score ? :
626 112 134 if ($score[0] > $score[1]) { }
134 0 elsif ($score[0] == $score[1]) { }
642 0 192 if ($#paired >= $pprime)
651 148 44 if @nonpaired
653 192 0 if @paired
655 28 58 if ($group->hetero and @nonpaired and $group->bigGroupXprime)
664 148 44 if (@nonpaired) { }
192 0 if (@paired)
684 0 148 unless defined $nonpaired and @$nonpaired
687 60 88 if (not $group->hetero && @$nonpaired > 1 || $islastBracket) { }
706 16 72 $group->{'xdeduction'} ? :
716 23 65 if ($islastBracket and @$nonpaired == 1)
735 24 64 if $group->{'c10repaired'}
737 27 61 if $group->{'lowfloaterlastshuffle'}
738 25 63 if $group->{'c11repaired'}
740 10 78 if $group->{'lastheteroshuffle'}
742 43 45 if ($islastBracket)
747 6 39 if (@rejections and not @$nonpaired % 2) { }
777 0 1414 if ($self->{'lowfloaterlastshuffle'})
785 0 1414 unless defined $badpair
787 461 953 unless (@newS2)
792 101 138 if $group->hetero or $group->{'remainderof'} and $group->{'remainderof'}{'lastheteroshuffle'}
795 402 59 unless $group->hetero
803 16 73 if ($lastC10shuffle and ref $lastC10shuffle eq 'ARRAY' and @$lastC10shuffle and &all(sub { $newOrder[$_] == $lastC10shuffle->[$_]; } , 0 .. $#$lastC10shuffle))
832 348 54 if ($group->c8swapper) { }
841 168 234 unless (@newMembers)
873 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') { }
926 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') { }
929 3 6 if ($group->{'remainderof'}) { }
6 0 elsif ($group->hetero) { }
958 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') { }
980 17 15 if ($group->{'remainderof'}{'c11repaired'} or $group->{'remainderof'}{'c12repaired'})
1001 3 12 if (not $heteroBracket->{'c10repaired'}) { }
12 0 elsif ($group->{'lastshuffle'}) { }
1078 2 35 if ($group->{'c11repaired'} and $group->{'lastheteroshuffle'}) { }
3 32 elsif ($group->{'c10repaired'}) { }
15 17 elsif ($group->{'remainderof'}) { }
13 4 elsif ($xprime < $pprime) { }
1080 2 0 if ($heteroBracket = $group->{'remainderof'}) { }
0 0 elsif ($group->hetero) { }
1100 2 0 if ($bigGroupXprime < $bigGroupPprime) { }
1117 0 3 if $matches
1128 3 0 $group->{'remainder'} ? :
1135 0 15 if ($group->{'remainderof'}{'c12repaired'}) { }
15 0 elsif ($group->{'c11repaired'}) { }
1164 0 13 if ($group->{'remainder'}) { }
1205 1 3 if ($index eq $first)
1214 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) { }
1222 0 0 unless ($previous->{'c12repaired'})
1227 0 0 if $matches
1266 0 0 if $matches->{$c11Remainder}
1279 0 0 if ($bracketAbove and $bracketAbove->hetero) { }
0 0 elsif (not $bracketAbove->hetero) { }
1384 2 90 unless ($index eq $self->lastBracket)
1388 1 89 if ($index eq $self->firstBracket)
1393 32 57 if (@$members == 1)
1399 30 2 unless ($byeGone)
1414 57 2 if (@returnees)
1428 2 57 if ($penultpPrime and not @returnees)
1430 1 1 if $penultxPrime
1435 1 58 if ($penultpPrime == 0)
1450 58 0 if ($penultpPrime > 0) { }
1485 23 7 $index =~ /Bye$/ ? :
1519 2 0 if ($pprime)
1521 2 0 if $x
1529 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'}) { }
1610 1 317 if ¬all(sub { $_->firstround <= $round - $lookback; } , @pair)
1616 17 300 unless $s1role and $s2role
1617 133 167 if $s1role eq $s2role
1618 167 167 unless $_ eq (&ROLES())[0]
0 167 unless 2 == grep({$_ eq (&ROLES())[1] unless $_ eq (&ROLES())[0];} $s1role, $s2role)
1627 0 4 unless ($roles[0] or $roles[1])
1631 4 242 unless ($roles[0])
1632 4 0 $roles[1] eq (&ROLES())[1] ? :
1638 27 219 unless ($roles[1])
1639 10 17 $roles[0] eq (&ROLES())[1] ? :
1645 189 57 if ($roles[0] ne $roles[1]) { }
18 39 elsif ($strengths[0] ne $strengths[1]) { }
8 31 elsif (@lastdiff) { }
1650 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])) { }
1684 3 15 $stronger == 0 ? :
1731 652 7364 if (defined $brackets) { }
7364 0 elsif ($self->{'brackets'}) { }
1758 0 4872 unless $index{$b}{'score'} <=> $index{$a}{'score'}
1810 412 0 if (defined $place)
1815 407 1113 if $next
1816 412 701 if $index eq $place
1818 407 5 unless $nextBracket eq $place
1838 308 796 if $index eq $place
1860 44 34 if /^\d+(\.5)?$/
1862 0 22 unless defined $index
1866 0 22 if $bracket->{'remainderof'}
1882 0 515 if (defined $round) { }
515 0 elsif ($self->{'round'}) { }
1900 416 8364 if (defined $thisBracket) { }
8317 47 elsif (defined $self->{'thisBracket'}) { }
1917 30 30 if (defined $byer) { }
30 0 elsif ($self->{'byer'}) { }
1934 0 0 if (defined $paired) { }
0 0 elsif ($self->{'paired'}) { }
1951 148 148 if (defined $nonpaired) { }
148 0 elsif ($self->{'nonpaired'}) { }
1968 0 333 if (defined $matches) { }
333 0 elsif ($self->{'matches'}) { }
1985 0 1768 if (defined $whoPlayedWho) { }
1722 46 elsif ($self->{'whoPlayedWho'}) { }
2001 0 1768 if (defined $colorClashes) { }
1260 508 elsif ($self->{'colorClashes'}) { }
2017 0 0 if (defined $incompatibles) { }
0 0 elsif ($self->{'incompatibles'}) { }
2034 0 62 if (defined $byes) { }
62 0 elsif ($self->{'byes'}) { }
2051 58 0 if (defined $penultpPrime) { }
0 0 elsif ($self->{'penultpPrime'}) { }