Branch Coverage

blib/lib/Sport/Analytics/NHL/Tools.pm
Criterion Covered Total %
branch 44 68 64.7


line true false branch
225 6 2 $2 > 8 ? :
247 0 0 unless (@games)
259 0 29232 if (not $force_no_db and $ENV{'MONGO_DB'})
262 0 0 if $team_id
264 347 28889 if $team =~ /MONTR.*CAN/i or $team =~ /CAN.*MONTR/
265 1 28888 if $team eq 'League' or $team eq 'NHL'
267 24915 594144 if $team_id eq $team
269 3973 1776553 if grep {uc $_ eq uc $team;} @{$Sport::Analytics::NHL::Tools::TEAMS{$team_id}{$type};}
294 1181 9793 if $year < 1969
303 189 9257 if $game->{'stage'} ne $Sport::Analytics::NHL::Tools::REGULAR and $game->{'stage'} ne $Sport::Analytics::NHL::Tools::PLAYOFF
325 124 5268 unless $game
336 1 1670 if $stage != $Sport::Analytics::NHL::Tools::REGULAR and $stage != $Sport::Analytics::NHL::Tools::PLAYOFF
362 1434 1 if ($game)
375 236 4054 $game->{'gamePk'} ? :
383 4 5 ref $schedule_json_data eq 'ARRAY' ? :
398 0 2 unless (-f $schedule_file)
403 2 0 unless ($jsons{$season})
408 1 1 unless ($schedule_by_date->{$date})
422 0 0 $ENV{'MONGO_DB'} ? :
444 31 9 if -d $path and -w $path
445 0 9 unless make_path($path)
461 0 4 unless -f $json_file
473 3 0 $1 && $2 && $3 ? :
504 2 16 if ($_ eq $Sport::Analytics::NHL::Tools::MAIN_GAME_FILE or $_ eq $Sport::Analytics::NHL::Tools::SECONDARY_GAME_FILE)
536 24 6 if -f "$path/$_"
570 2064 3140 if $Sport::Analytics::NHL::Tools::VOCABULARY{$vocabulary}{$string}
573 3139 10871 if (&any(sub { $string eq $_; } , @{$alternatives;}))
662 0 0 if ($player->{'_id'} == $player_id)
663 0 0 if ($stat eq 'goalsAgainst' and defined $player->{'saves'}) { }
0 0 elsif ($stat eq 'penaltyMinutes') { }
0 0 elsif (defined $player->{$stat}) { }
669 0 0 if ($delta)
710 0 0 if (my $es = $$event_summary{$player->{'_id'}})
731 7004 112 unless $event->{'type'} eq 'PEND' or $event->{'type'} eq 'PSTR' or $event->{'type'} eq 'GEND'