Branch Coverage

blib/lib/Sport/Analytics/NHL.pm
Criterion Covered Total %
branch 46 110 41.8


line true false branch
229 0 5 unless ($opts->{'no_database'} or $ENV{'HOCKEYDB_NODB'} or not $Sport::Analytics::NHL::MONGO_DB)
232 1 7 if $opts->{'data_dir'}
264 3 1 unless ($$schedules{$opts->{'start_season'}})
271 0 3 if $self->{'db'}
273 0 4 unless ($schedule_by_date->{$date})
288 1 0 $opts->{'no_schedule_crawl'} ? :
292 0 2 $opts->{'force'} ? :
295 2 0 ref $schedules->{$season} eq 'ARRAY' ? :
298 34 2672 unless $game
301 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
303 0 2672 if $$existing_game_ids{$game->{'game_id'}}
318 0 0 $opts->{'force'} ? :
320 0 0 unless ($opts->{'no_schedule_crawl'})
339 0 0 $opts->{'stage'} ? :
355 0 0 $self->{'db'} ? :
366 1 0 if (@args) { }
372 0 0 $opts->{'no_schedule_crawl'} ? :
0 1 if @dates
379 0 1 unless (@games)
386 0 3 if ($game->{'date'} and $game->{'date'} > strftime('%Y%m%d', localtime))
404 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)
414 5 8 if (not $opts->{'force'} and -f $storable and -M $storable < -M $file)
420 0 8 if ($opts->{'test'})
441 0 1 if (defined $Sport::Analytics::NHL::DEFAULTED_GAMES{$game_id})
446 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))
456 0 6 if $opts->{'doc'} and not grep({$_ eq $type;} @{$$opts{'doc'};})
458 6 0 if $storable
476 11 18 $doc eq 'BS' ? :
479 16 13 if -f $doc_storable and not $opts->{'recompile'}
480 1 12 if ($opts->{'no_compile'})
484 5 7 unless (-f $doc_source)
490 7 0 if $doc_storable
502 0 12 if (defined $Sport::Analytics::NHL::DEFAULTED_GAMES{$game_id})
508 10 2 if (not $opts->{'force'} and -f $merged)
517 0 2 unless $boxscore
522 4 4 if $report
524 0 2 if ($opts->{'test'})
551 0 0 unless $Sport::Analytics::NHL::BROKEN_FILES{$boxscore->{'_id'}}{'BS'} and keys %{$$boxscore{'sources'};} <= 1
553 0 0 if ($@) { }
557 0 0 if $to_die == 1
559 0 0 if ($error =~ /team.*(0|1).*playergo.*consistent: (\d+) vs (\d+)/i) { }
569 0 0 if $to_die == $player
570 0 0 if ($boxscore->{'season'} < 1945 and $error =~ /assists/) { }
0 0 elsif ($error =~ /goalsAgainst/) { }
0 0 elsif ($error =~ /penaltyMinutes/) { }
572 0 0 if ($2 == $3 + 1)
588 0 0 unless $result
608 0 2 if (defined $Sport::Analytics::NHL::DEFAULTED_GAMES{$game_id})
617 0 2 if (not $opts->{'force'} and -f $normalized)
625 0 2 unless ($boxscore)
630 0 2 if ($opts->{'test'})
638 0 2 if ($@)
642 0 2 if ($opts->{'test'})
646 0 0 if ($@)
648 0 0 unless $repeat