Branch Coverage

blib/lib/Sport/Analytics/NHL/Scraper.pm
Criterion Covered Total %
branch 30 42 71.4


line true false branch
159 0 35 unless defined $opts->{'url'}
161 0 35 if $ENV{'HOCKEYDB_NONET'}
171 0 41 unless ($opts->{'validate'}->($content))
176 32 3 if $content
190 0 6 if grep {$_ == $season;} @Sport::Analytics::NHL::Scraper::LOCKOUT_SEASONS
193 4 2 if ($season == $Sport::Analytics::NHL::Scraper::CURRENT_SEASON or not -f $schedule_json_file)
196 2 2 unless ($schedule_json)
200 0 2 unless ($schedule_json)
206 0 4 unless (-f $schedule_json_file)
252 7 35 if $doc->{'disabled'}
253 0 35 if $opts->{'game_files'} and not $opts->{'game_files'}{$doc}
254 14 21 if $game->{'season'} < $Sport::Analytics::NHL::Scraper::FIRST_REPORT_SEASONS{$doc->{'name'}}
259 0 21 if (-f $file and not $opts->{'force'})
268 0 21 unless ($content)
272 14 7 unless $doc->{'extension'} eq 'json'
289 0 1 if (-f $file and -M $file < $opts->{'playerfile_expiration'} and not $opts->{'force'})
295 1 4 unless ($content)
297 0 1 if (-f $file)
305 1 3 if (-f $file) { }
308 5 0 if exists $existing_json->{$key}
314 2 1 if ($content =~ /Draft:.*(\d{4}) (\S{3}), (\d+)\S\S rd, .* pk \((\d+)\D+ overall\)/) { }