Branch Coverage

blib/lib/Sport/Analytics/NHL/Report/BH.pm
Criterion Covered Total %
branch 100 172 58.1


line true false branch
105 140 0 unless $Sport::Analytics::NHL::Report::BH::BROKEN_PLAYER_IDS{$id}
163 0 6 unless $score
165 0 6 if not ref $score and $score =~ /\bEN\b/
167 2 4 if (not ref $score) { }
172 2 0 if ($score =~ /(\w\w)G/)
175 0 2 if ($score =~ /EN/) { }
0 2 elsif ($score =~ /PS/) { }
193 6 0 if ($asst =~ /ASST/)
195 6 0 if ($asst1)
199 6 0 if $asst2
200 6 0 if $asst2
223 0 24 if $event->{'time'} eq 'NONE'
225 24 0 if (ref $offender) { }
234 22 2 $event->{'penalty'} =~ /\bagainst\b/ ? :
235 0 24 if ($event->{'penalty'} =~ /(.*\S)\s*\(maj\)/) { }
0 24 elsif ($event->{'penalty'} =~ /(.*\S)\s*\(10.*min\)/) { }
0 24 elsif ($event->{'penalty'} =~ /double minor/i) { }
249 22 2 if ($against)
253 0 24 if $event->{'penalty'} =~ /conduct/i
258 0 24 if $event->{'penalty'} =~ /misconduct/i or $event->{'penalty'} =~ /Match/ or $event->{'penalty'} =~ /abuse.*official/i and $self->{'season'} > 1997 or $event->{'penalty'} =~ /leaving .* bench/i
259 0 24 if $event->{'penalty'} =~ /penalty shot/i
260 2 22 if ($event->{'penalty'} =~ /too many/i or $event->{'penalty'} =~ /\bbench\b/i and $event->{'length'} != 10)
264 2 0 if ($event->{'player1'} and $event->{'player1'} =~ /^8\d{6}/)
267 0 2 $event->{'penalty'} =~ /coach/ ? :
270 2 22 if ($event->{'penalty'} =~ /\bbench\b/i and not $event->{'penalty'} =~ /leaving/i)
271 0 0 if (not $event->{'servedby'} and $event->{'player1'} and $event->{'player1'} != $Sport::Analytics::NHL::Report::BH::BENCH_PLAYER_ID)
277 0 24 if ($event->{'penalty'} =~ /(.*\w)\W*\bcoach\b/i)
281 0 24 if ($event->{'penalty'} =~ /aggressor/i)
301 0 0 unless $href
312 0 0 if ($href->attr('class') =~ /shootoutgoal/i) { }
337 0 42 unless (ref $row)
342 12 30 if ($cell->tag eq 'th') { }
30 0 elsif ($cell->tag eq 'td') { }
343 0 12 if ($shootout_mode) { }
345 0 12 if $cell->{'_content'}[2] and $cell->{'_content'}[2] =~ /OT period/i
346 0 12 if ($period eq 'OT Period')
349 0 12 if ($period eq 'Shootout')
353 0 12 if $period > $LAST_PERIOD
357 0 0 $self->{'full_teams'}[0] eq $_ ? :
366 0 30 ref $event eq 'ARRAY' ? :
30 0 if $event
385 0 1364 unless ref $cell
386 104 1260 if ($cell->tag eq 'th')
392 76 1184 if (ref $cell->{'_content'}[0]) { }
395 4 72 ref $c2->{'_content'}[0] ? :
398 4 72 ref $c2->{'_content'}[0] ? :
400 76 0 if (ref $c2)
424 8 76 unless keys %{$player;}
426 4 72 $player->{'position'} eq 'G' ? :
427 4 72 if ($pos eq 'G')
430 4 12 if ($stat eq 'EV') { }
4 8 elsif ($stat eq 'SH') { }
4 4 elsif ($stat eq 'PP') { }
450 1244 152 if exists $player->{$key}
455 4 72 if $player->{'decision'}
458 76 0 unless defined $player->{'start'}
469 2 0 $self->get_sub_tree(0, [0, 1, 0, 2, 0, 0], $summaries) ? :
475 2 2 if ($summary_type eq 'scoring')
477 0 2 if ($shootout)
493 2 0 $self->get_sub_tree(0, [0, 1, 2, 2, 0, 0], $summaries) ? :
495 0 2 if ($e == 2 and $x->tag eq 'tbody')
520 2 2 if ($referees and not ref $referees) { }
521 2 0 if ($referees =~ /:\s+(\S+.*\S+)\s*\,\s+(\S+.*\S+)\s*$/) { }
533 0 2 unless $linesmen
534 2 0 if ($linesmen =~ /:\s+(\S+.*\S+)\s*\,\s+(\S+.*\S+)\s*$/) { }
558 2 2 unless $coach_box
582 0 0 if $star
597 0 0 if ($player->{'number'} == $broken_player->{'No.'})
599 0 0 if $field eq 'No.'
600 0 0 unless (exists $player->{$field})
601 0 0 if ($field eq 'number' or $field eq 'error') { }
621 0 2 if ($Sport::Analytics::NHL::Report::BH::MISSING_EVENTS{$self->{'_id'}})
624 0 0 unless $event->{'type'} eq 'PEND' or $event->{'type'} eq 'GEND'
627 0 2 if ($Sport::Analytics::NHL::Report::BH::MISSING_COACHES{$self->{'_id'}})
632 0 2 if $Sport::Analytics::NHL::Report::BH::BROKEN_ROSTERS{$self->{'_id'}}
643 80 42 unless ref $main_div
645 4 38 if ($main_div->attr('class') and $main_div->attr('class') eq 'chrome')
646 2 2 if ($flag == $BOXSCORE_HEADER) { }
2 0 elsif ($flag == $BOXSCORE_GAME) { }
679 24 0 if not $event->{'strength'} and $event->{'str'}
680 0 30 if $event->{'strength'} eq 'PS' and $event->{'time'} eq '0:00'
681 24 6 if ($event->{'type'} eq 'PENL')
687 0 30 if ($Sport::Analytics::NHL::Report::BH::BROKEN_EVENTS{'BH'}{$self->{'_id'}} and my $evx = $Sport::Analytics::NHL::Report::BH::BROKEN_EVENTS{'BH'}{$self->{'_id'}}{$event->{'id'}})
689 0 0 if ($evx->{'broken'}) { }
696 0 0 defined $evx->{$error} ? :
700 12 18 if $event->{'time'} =~ /^0(\d.*)/