Branch Coverage

blib/lib/Sport/Analytics/NHL.pm
Criterion Covered Total %
branch 45 126 35.7


line true false branch
244 0 5 unless ($opts->{'no_database'} or $ENV{'HOCKEYDB_NODB'} or not $Sport::Analytics::NHL::MONGO_DB)
247 1 7 if $opts->{'data_dir'}
279 3 1 unless ($$schedules{$opts->{'start_season'}})
286 0 3 if $self->{'db'}
288 0 4 unless ($schedule_by_date->{$date})
303 1 0 $opts->{'no_schedule_crawl'} ? :
307 0 2 $opts->{'force'} ? :
310 2 0 ref $schedules->{$season} eq 'ARRAY' ? :
313 34 2672 unless $game
316 0 2672 unless $opts->{'stage'} and $game->{'stage'} == $opts->{'stage'} or not $opts->{'stage'} and $game->{'stage'} == $Sport::Analytics::NHL::REGULAR || $game->{'stage'} == $Sport::Analytics::NHL::PLAYOFF
318 0 2672 if $$existing_game_ids{$game->{'game_id'}}
333 0 0 $opts->{'force'} ? :
335 0 0 unless ($opts->{'no_schedule_crawl'})
354 0 0 $opts->{'stage'} ? :
370 0 0 $self->{'db'} ? :
381 1 0 if (@args) { }
387 0 0 $opts->{'no_schedule_crawl'} ? :
0 1 if @dates
394 0 1 unless (@games)
401 0 3 if ($game->{'date'} and $game->{'date'} > strftime('%Y%m%d', localtime))
419 0 0 if ($Sport::Analytics::NHL::BROKEN_FILES{$game_id}{$type} and $Sport::Analytics::NHL::BROKEN_FILES{$game_id}{$type} != $Sport::Analytics::NHL::UNSYNCHED and $Sport::Analytics::NHL::BROKEN_FILES{$game_id}{$type} != $Sport::Analytics::NHL::NO_EVENTS)
429 0 19 if (not $opts->{'force'} || $opts->{'recompile'} and -f $storable and -M $storable < -M $file)
435 0 19 if ($opts->{'test'})
456 0 1 if (defined $Sport::Analytics::NHL::DEFAULTED_GAMES{$game_id})
461 0 0 if ($Sport::Analytics::NHL::BROKEN_FILES{$game_id}{'BS'} and $Sport::Analytics::NHL::BROKEN_FILES{$game_id}{'BS'} == $Sport::Analytics::NHL::NO_EVENTS and not grep({/PL/;} @game_files))
471 0 6 if $opts->{'doc'} and not grep({$_ eq $type;} @{$$opts{'doc'};})
473 6 0 if $storable
491 13 26 $doc eq 'BS' ? :
494 16 23 if -f $doc_storable and not $opts->{'recompile'}
495 1 22 if ($opts->{'no_compile'})
499 9 13 unless (-f $doc_source)
505 13 0 if $doc_storable
517 0 12 if (defined $Sport::Analytics::NHL::DEFAULTED_GAMES{$game_id})
523 8 4 if (not $opts->{'force'} || $opts->{'remerge'} and -f $merged)
532 0 4 unless $boxscore
537 8 8 if $report
539 0 4 if ($opts->{'test'})
566 0 0 unless $Sport::Analytics::NHL::BROKEN_FILES{$boxscore->{'_id'}}{'BS'} and keys %{$$boxscore{'sources'};} <= 1
568 0 0 if ($@) { }
572 0 0 if $to_die == 1
574 0 0 if ($error =~ /team.*(0|1).*playergo.*consistent: (\d+) vs (\d+)/i) { }
584 0 0 if $to_die == $player
585 0 0 if ($boxscore->{'season'} < 1945 and $error =~ /assists/) { }
0 0 elsif ($error =~ /goalsAgainst/) { }
0 0 elsif ($error =~ /penaltyMinutes/) { }
587 0 0 if ($2 == $3 + 1)
603 0 0 unless $result
623 0 2 if (defined $Sport::Analytics::NHL::DEFAULTED_GAMES{$game_id})
632 0 2 if (not $opts->{'force'} || $opts->{'renormalize'} and -f $normalized)
640 0 2 unless ($boxscore)
645 0 2 if ($opts->{'test'})
653 0 2 if ($@)
657 0 2 if ($opts->{'test'})
661 0 0 if ($@)
663 0 0 unless $repeat
687 0 0 unless ($self->{'db'})
692 0 0 if (defined $Sport::Analytics::NHL::DEFAULTED_GAMES{$game_id})
697 0 0 if ($db_game and not $opts->{'force'})
704 0 0 if ($opts->{'no_normalize'} and not -f $normalized)
708 0 0 if not -f $normalized or $opts->{'renormalize'}
709 0 0 unless ($normalized)
714 0 0 unless ($boxscore)
719 0 0 $db_game ? :