Branch Coverage

blib/lib/Sport/Analytics/NHL/Report/GS.pm
Criterion Covered Total %
branch 105 256 41.0


line true false branch
154 10 0 $is_new ? :
155 10 0 $is_goal =~ /\d/ ? :
156 0 10 $event->{'type'} eq 'MISS' ? :
157 10 0 $is_new ? :
158 0 10 unless $is_special or $event->{'period'} =~ /\w/
159 10 0 $is_new ? :
160 10 0 $is_new ? :
161 10 0 $is_new ? :
162 10 0 if ($event->{'type'} eq 'GOAL')
163 10 0 $is_new ? :
164 10 0 $is_new ? :
166 0 10 if ($is_special)
171 10 0 $is_new ? :
172 0 10 if ($event->{'period'} eq 'OT') { }
0 10 elsif ($event->{'period'} eq 'SO' or $event->{'period'} eq 'F') { }
182 0 10 if ($event->{'assist1'} and $event->{'assist1'} =~ /unsuccessful/i)
186 0 10 if (ref $event->{'assist2'})
190 0 10 if ($event->{'type'} eq 'MISS')
195 0 10 if ($event->{'strength'} =~ /(.*)-EN/) { }
0 10 elsif ($event->{'strength'} =~ /(.*)-\s*PS/ or $event->{'type'} eq 'MISS') { }
200 0 0 if $1
210 10 0 if ($is_new) { }
225 0 10 if ref $event->{'on_ice'}[0][0]
239 0 0 if ($key eq 'on_ice') { }
249 0 0 if ($key =~ /^assist/ and not $event->{$key})
265 2 0 $is_new ? :
267 2 10 unless $row and ref $row
270 10 0 if $event
284 0 32 if $event->{'period'} eq 'OT'
285 0 32 if $event->{'period'} eq 'SO'
287 0 32 unless $event->{'time'} =~ /:/
292 0 32 if $event->{'penalty'} =~ /conduct/
293 2 30 if $event->{'penalty'} =~ /\-\s+bench/
294 0 32 if $event->{'penalty'} =~ /\bcoach\b/i
295 2 30 if $event->{'name'} and $event->{'name'} =~ /\bteam\b/i
310 0 0 unless $event->{'period'}
311 0 0 unless $event->{'period'} =~ /\w/
312 0 0 if $event->{'period'} eq 'OT'
319 0 0 if $event->{'penalty'} =~ /conduct/i
320 0 0 if $event->{'penalty'} =~ /\-\s+bench/i
321 0 0 if $event->{'penalty'} =~ /\-\s+coach/i
332 2 0 $is_new ? :
336 2 0 if ($is_new)
337 0 2 unless (ref $penalty_tables[0])
344 0 4 unless defined $penalty_table
347 4 32 unless $row and ref $row
349 32 0 if ($is_new) { }
352 32 0 if $event and $event->{'type'}
357 0 0 if $event->{'type'}
394 0 0 unless ref $row
396 0 0 if ($period =~ /(\d+)/) { }
0 0 elsif ($period eq 'OT') { }
402 0 0 if ($period =~ /(\d+)/ and $period > 0) { }
0 0 elsif ($period =~ /time/i) { }
434 0 2 unless ($self->{'officials'}{'referees'}[0])
449 0 2 $star1 && $star1 eq 'Team' ? :
453 0 6 unless ($team and $team =~ /[A-Z]\s*$/)
474 0 0 $g_span == 8 ? :
486 0 0 unless ($goalie->{'name'} and $goalie->{'name'} =~ /[a-z]/i)
490 0 0 unless $goalie->{'pt'} =~ /\d/
491 0 0 if ($goalie->{'pt'} =~ /:/)
502 0 0 unless ($name and $name =~ /[A-Z]\s*$/i)
514 0 0 unless $type
515 0 0 unless $type =~ /\w/
516 0 0 $type =~ /R|A/ ? :
519 0 0 if $name =~ /\w/
532 2 22 unless $goalies_row and ref $goalies_row
534 8 14 if ($number =~ /^\d+$/) { }
535 4 4 if $t
569 0 18 if $_ == $self->{'_id'}
0 2 grep({$Sport::Analytics::NHL::Report::GS::BROKEN_EVENTS{'BS'}{$_}{'1'} if $_ == $self->{'_id'};} keys %{$Sport::Analytics::NHL::Report::GS::BROKEN_EVENTS{'BS'};}) ? :
572 2 0 unless ($self->{'old'})
574 0 2 $main_table->tag eq 'table' ? :
576 0 2 $self->{'old'} ? :
577 0 2 $self->{'old'} ? :
578 0 2 $self->{'old'} ? :
579 0 2 $self->{'old'} ? :
580 0 2 unless ref $misc_summary
586 0 2 $self->{'old'} ? :
589 0 2 $self->{'old'} ? :
591 2 0 unless ($self->{'old'})
593 2 0 if (ref $goaltender_summary) { }
617 8 88 if ($field eq 'name_decision') { }
8 80 elsif ($field eq 'team') { }
16 64 elsif ($goalie->{$field} =~ /(\d+)\:(\d+)/) { }
16 48 elsif ($goalie->{$field} =~ /(\d+)\-(\d+)/) { }
618 4 4 if ($goalie->{$field} =~ /^(\S+.*)\,\s+(\S+.*\S+)\s+\((W|L|OT)\)/) { }
638 32 64 if ($goalie->{$field} eq ' ' or ord $goalie->{$field} == 160)
639 16 16 $field =~ /SHOT/ ? :
645 2 0 if (@{$self->{'events'};})
652 8 4 if ($team->{'pptype'}{$pptype} =~ m[(\d+)\-(\d+)/(\d+)\:(\d+)]) { }
675 0 8 unless $official
681 0 6 unless defined $star and ref $star and defined $star->{'name'}
689 30 492 if ($event->{$field} and $event->{$field} =~ /^(\d+)\s+\D/)
697 32 10 if (defined $event->{'team1'} and $event->{'team1'} =~ /^\d+$/)
700 0 10 if $event->{'assist1'} and lc $event->{'assist1'} eq 'unassisted' || $event->{'assist1'} =~ /unsuccessful/i || $event->{'assist1'} =~ /penalty shot/i
701 32 10 unless defined $event->{'assist2'} and $event->{'assist2'} =~ /\w/
705 0 42 if $Sport::Analytics::NHL::Report::GS::NAME_TYPOS{$event->{'player1'}}
706 0 42 if $event->{'assist1'} and $Sport::Analytics::NHL::Report::GS::NAME_TYPOS{$event->{'assist1'}}
707 0 42 if $event->{'assist2'} and $Sport::Analytics::NHL::Report::GS::NAME_TYPOS{$event->{'assist2'}}
716 4 4 $goalie->{'team'} eq $self->{'teams'}[0]{'name'} ? :
717 4 4 if $goalie->{'decision'}
727 0 4 unless $team->{'_decision'}
740 0 0 if ($event->{'type'} eq 'GOAL' or $event->{'type'} eq 'MISS') { }
0 0 elsif ($event->{'type'} eq 'PENL') { }
742 0 0 if ($event->{'assist1'} and $event->{'assist1'} =~ /\w/) { }
744 0 0 if ($event->{'assist2'} and $event->{'assist2'} =~ /\w/) { }
754 0 0 if ($Sport::Analytics::NHL::Report::GS::SPECIAL_EVENTS{$self->{'_id'}} and not $event->{'on_ice'}[0][0] or $event->{'on_ice'}[0][0] =~ /Data/) { }
773 0 0 if ($event->{'player1'} and $event->{'player1'} =~ /\D/)
778 0 0 if (defined $event->{'team1'} and $event->{'team1'} =~ /^\d+$/)
783 0 0 if $Sport::Analytics::NHL::Report::GS::NAME_TYPOS{$event->{'player1'}}
784 0 0 if $event->{'assist1'} and $Sport::Analytics::NHL::Report::GS::NAME_TYPOS{$event->{'assist1'}}
785 0 0 if $event->{'assist2'} and $Sport::Analytics::NHL::Report::GS::NAME_TYPOS{$event->{'assist2'}}
786 0 0 if $event->{'assist1'} and $event->{'assist1'} =~ /unassisted/i || !($event->{'assist1'} =~ /[a-z]/i)
787 0 0 if $event->{'assist2'} and $event->{'assist2'} =~ /unassisted/i || !($event->{'assist2'} =~ /[a-z]/i)
803 0 0 if ($goalie->{'team_decision'} =~ /^(\S{3})\(([A-Z])\)/) { }
804 0 0 if (not $t0) { }
0 0 elsif ($t0 ne $1) { }
818 0 0 if (not $t0) { }
0 0 elsif ($t0 ne $1) { }
827 0 0 if $goalie->{'decision'}
828 0 0 if ($goalie->{'name'} eq 'EMPTY NET')
841 0 0 unless $team->{'_decision'}
851 0 2 $self->{'old'} ? :
854 2 0 unless $ENV{'GS_KEEP_PENL'}
856 0 10 if (my $evx = $Sport::Analytics::NHL::Report::GS::BROKEN_EVENTS{'GS'}{$self->{'_id'}}{$event->{'id'}})
862 0 10 if ($event->{'type'} eq 'PENL')
868 20 20 if exists $event->{$v}