Branch Coverage

blib/lib/Baseball/Simulation.pm
Criterion Covered Total %
branch 80 92 86.9


line true false branch
52 0 1 unless (-e $TeamBattingFile)
56 0 1 unless (-e $TeamPitchingFile)
98 0 16 if ($LineToBeParsed =~ /^\s+/)
103 6 10 if ($LineToBeParsed =~ /#/)
107 0 16 if ($LineToBeParsed =~ /\s+$/)
177 0 2 unless open INFILE, "$File"
185 0 2 unless $Line
187 0 2 if ($#TotalStats + 1 != 7)
195 1 0 if $Line =~ /additions/i
201 1 4 if $Line =~ /sub/i
202 2 2 if ($Line)
205 0 2 if ($#PlayerStats + 1 != 7)
216 4 4 if ($Line)
218 0 4 if ($#PlayerStats + 1 != 7)
266 20954 243994 if ($Random2 < $WalkChance) { }
42153 201841 elsif ($Random2 < $SingleChance + $WalkChance) { }
12774 189067 elsif ($Random2 < $SingleChance + $WalkChance + $DoubleChance) { }
1467 187600 elsif ($Random2 < $SingleChance + $WalkChance + $DoubleChance + $TripleChance) { }
8446 179154 elsif ($Random2 < $SingleChance + $WalkChance + $DoubleChance + $TripleChance + $HomerChance) { }
302 20954 184276 if ($Result == -1) { }
42153 142123 elsif ($Result == 1) { }
12774 129349 elsif ($Result == 2) { }
1467 127882 elsif ($Result == 3) { }
8446 119436 elsif ($Result == 4) { }
119436 0 elsif ($Result == 0) { }
303 235 20719 if ($FirstBase and $SecondBase and $ThirdBase) { }
1138 19581 elsif ($FirstBase and $SecondBase) { }
5828 13753 elsif ($FirstBase) { }
320 3603 38550 if ($ThirdBase)
324 7221 34932 if ($SecondBase) { }
11740 23192 elsif ($FirstBase) { }
327 5036 2185 if (rand 10 < 7) { }
335 8158 3582 if (rand 10 < 7) { }
349 4457 8317 if ($FirstBase)
350 3108 1349 if (rand 10 < 7) { }
370 7213 112223 if ($ThirdBase) { }
13779 98444 elsif ($SecondBase and not $ThirdBase) { }
25590 145708 elsif ($FirstBase and not $SecondBase) { }
372 2849 4364 if (rand 10 < 4)
377 4119 9660 if (rand 10 < 3)
382 7724 17866 if (rand 10 < 3)
416 29859 29859 if ($Who) { }
424 179154 85794 unless ($Result)
426 205230 59718 if ($Outs < 3)
481 1419 1821 if ($SingleScore > $SingleOtherScore) { }
1821 0 elsif ($SingleScore < $SingleOtherScore) { }