Branch Coverage

blib/lib/Sport/Analytics/NHL/Report.pm
Criterion Covered Total %
branch 93 150 62.0


line true false branch
228 2 25 unless ($args->{'data'} or $args->{'file'})
232 1 2 if ($args->{'data'} and $args->{'file'})
239 1 26 unless ($type)
244 25 1 if $args->{'file'}
253 4 26 unless &set_args($args)
256 16 10 unless $class =~ /\:\:[A-Z]{2}$/
258 1 25 unless ($plugin)
264 5 20 $REPORT_TYPES{$args->{'type'}} eq 'json' ? :
276 20 0 if ($args->{'file'})
279 15 5 if (-f $tree and (stat $tree)[9] > (stat $args->{'file'})[9] - 2)
285 5 15 unless ($self->{'html'})
290 0 1 if ($args->{'type'} eq 'ES' and $args->{'data'} =~ /width\=100\%/i and not $args->{'data'} =~ /width\=100\%\>/i)
297 5 0 if ($args->{'file'})
324 0 8 if $self->{'old'}
328 0 72 $self->{'old'} ? :
330 16 56 unless $content and not ref $content
331 0 0 if ($self->{'old'} and $r == 4 and $content =~ /\,/)
334 0 56 $self->{'old'} ? :
335 0 56 if ($content and $content =~ /\s*(attendance|attd)\s+(\d+\S+\d+)\s*$/i)
340 0 56 if ($r == 11 and not $self->{'attendance'})
343 0 56 if ($content and $content =~ /^\s*(\d+\:\d+)\s+(\S\S)\s+(\S\S)\s+at\s+(.*)/)
349 16 40 unless $method
357 0 8 if $self->{'status'} eq 'End of Game' or $self->{'status'} eq 'End of Period 4' or $self->{'status'} eq 'Period 4 (0:00 Remaining)'
390 0 8 if (not $arena_info =~ /att/i) { }
0 8 elsif ($arena_info =~ /attendance.*?(\d+)\,(\d+)\s*$/i) { }
392 0 0 if ($arena_info =~ /(\d+\:\d+ \w\w \w\w) (at|\@) (.*)/)
405 8 0 if ($attendance) { }
407 0 0 if ($arena_info =~ /(at|\@).*?(\w.*)/)
440 0 8 if ($status_info =~ / (\d+) \- (\S.*)/) { }
456 0 16 $self->{'old'} ? :
458 0 0 if (ref $name and $self->{'old'})
466 0 16 $self->{'old'} ? :
467 0 16 unless $score =~ /^\d{1,2}\s*$/
468 0 16 unless defined $score and $score =~ /^\d{1,2}\s*$/
469 0 16 unless (defined $score and $score =~ /^\s*\d{1,2}\s*$/)
472 16 0 if ($name)
476 0 16 if $name eq 'CANADIENS MONTREAL'
491 0 24 unless ref $base_element
492 8 16 if ($base_element->tag eq 'table')
494 0 8 if $base_element->{'_content'}[0]->tag eq 'tbody'
510 8 0 if ($main_table->attr('class')) { }
527 0 24 if ($self->{'old'} and @{$self->{'head'};} == 2) { }
532 0 24 if $gameinfo_size == 12
533 0 24 if $gameinfo_size == 14
534 0 24 $self->{'old'} ? :
536 8 16 $i % 2 ? :
538 0 8 if ($self->{'status'} =~ /end.*period (3|4)/i and $self->{'teams'}[0]{'score'} != $self->{'teams'}[1]{'score'})
542 0 8 if $self->{'month'} < 9
543 0 8 if ($self->{'season'} != 2012 and $self->{'month'} > 3 and $self->{'month'} < 8 and $self->{'season_id'} <= $Sport::Analytics::NHL::Report::LAST_PLAYOFF_GAME_INDEX or $self->{'season'} == 2012 and $self->{'start_ts'} >= $Sport::Analytics::NHL::Report::LATE_START_IN_2012) { }
553 0 8 if $self->{'teams'}[0]{'name'} eq 'CANADIENS MONTREAL'
555 0 8 if $self->{'teams'}[1]{'name'} eq 'CANADIENS MONTREAL'
573 0 10 $date =~ /^\d/ && !$force_us ? :
583 2 8 unless ($end_h)
585 2 0 unless ($start_h)
594 8 2 if $start_h < 12
595 8 2 if $end_h < $start_h
597 0 10 if ($end_h > 23) { }
618 0 0 if ($self->{'_score'}[0] == $self->{'_score'}[1]) { }
0 0 elsif ($self->{'_score'}[$self->{'_t'}] > $self->{'_score'}[1 - $self->{'_t'}]) { }
625 0 0 $self->{'ot'} || $self->{'so'} ? :
637 0 27436 if $ENV{'SHOW_WALK'}
640 260 102156 unless $$tpointer and ref $$tpointer
645 0 27176 $want_content ? :
652 8 2 unless $self->{'type'} eq 'BH'
664 0 3525 if $event->{'game'}
665 196 3329 if $event->{'penalty'}
667 2924 601 if ($event->{'team1'})
669 2924 0 if $event->{'team1'} ne 'OTH'
673 1452 263 $event->{'team1'} eq $self->{'teams'}[1]{'name'} ? :
1209 1715 $event->{'team1'} eq $self->{'teams'}[0]{'name'} ? :
676 715 2810 if $event->{'team2'} and $event->{'team2'} ne 'OTH'
681 3525 0 $event->{'stage'} == $Sport::Analytics::NHL::Report::PLAYOFF || $event->{'stage'} == $Sport::Analytics::NHL::Report::REGULAR && $event->{'period'} < 5 ? :
0 3525 $event->{'special'} ? :
683 0 14 unless @{$self->{'events'};}
687 14 27 if defined $tb