Branch Coverage

blib/lib/Sport/Analytics/NHL/Report/PL.pm
Criterion Covered Total %
branch 94 284 33.1


line true false branch
244 0 0 if ($event->{'description'} =~ /^(\d+).*\,\s*(\S.*\S)\s*\,\s*(\d+)/) { }
0 0 elsif ($event->{'description'} =~ /^Team Penalty\,\s*(\S.*\S)\s*\,\s*(\d+) min\, Served By\s+(\d+)/) { }
0 0 elsif ($event->{'description'} =~ /^Abuse of officials - bench\,\s*(\d+) min\, Served By\s+(\d+)/) { }
0 0 elsif ($event->{'description'} =~ /^Team Penalty\,\s*(\S.*\S)\s*\,\s*(\d+) min/) { }
253 0 0 $event->{'description'} =~ /\bcoach\b/ ? :
270 0 0 if $event->{'description'} =~ /(misconduct|unsportsmanlike)/i
281 0 64 if (not $event->{'team1'}) { }
283 0 0 unless $event->{'description'} =~ /team/i
288 0 64 if ($desc =~ /^\#(\s+)/)
296 0 64 unless defined $desc
297 60 4 if ($desc =~ /Drawn.By: (\S\S\S) #(\d+)/i) { }
303 4 60 if $desc =~ /Served.By: #(\d+)/
304 0 64 if $use_servedby
305 60 4 if $desc =~ /(\w\w\w). Zone/
306 0 64 if $event->{'description'} =~ /(misconduct|unsportsmanlike)/i
308 0 64 if (not $event->{'player1'} and $event->{'servedby'}) { }
4 60 elsif ($event->{'player1'} =~ /team/i) { }
0 60 elsif ($event->{'player1'} eq ' ') { }
315 0 0 $event->{'description'} =~ /(Team Staff|\bcoach\b)/i ? :
319 0 64 if $event->{'servedby'} and $event->{'servedby'} =~ /^80/
329 0 0 if $event->{'description'} =~ /(offensive|neutral|defensive) zone/
330 0 0 if $event->{'description'} =~ /(\d+)\s+ft/
331 0 0 if ($event->{'description'} =~ /^\-?(\d+)/)
335 0 0 if $event->{'strength'} eq 'SO'
344 0 0 if ($event->{'winning_team'} eq $1) { }
0 0 elsif ($event->{'winning_team'} eq $3) { }
374 0 0 if ($event->{'description'} =~ /($VALID_MISSES|Penalty)/) { }
375 0 0 if ($1 eq 'Penalty') { }
394 0 0 if ($event->{'shot_type'} eq 'Unsuccessful Penalty Shot')
406 0 0 $event->{'distance'} > 72 ? :
0 0 $event->{'distance'} > 120 ? :
407 0 0 if ($event->{'description'} =~ /A\:\s+(\d+)\s+(\S+)\,\s+(\d+)\s+(\S+)/) { }
0 0 elsif ($event->{'description'} =~ /A\:\s+(\d+)\s+(\S+)/) { }
428 0 0 if defined $$evx{$event->{'id'}} and $$evx{$event->{'id'}}{'description'}
430 64 1200 if $event->{'type'} eq 'PENL'
437 0 1200 if ($event->{'type'} eq 'CHL')
443 940 260 if ($event->{'type'} ne 'FAC') { }
444 400 540 if ($items[-1] =~ /^(\d+) ft./)
448 728 212 if ($items[-1] =~ /^($VALID_ZONES)\. Zone/)
452 128 812 if ($items[-1] =~ /$VALID_MISSES/)
456 524 416 if ($items[-1] =~ /^$VALID_SHOTS$/)
464 260 0 if $event->{'description'} =~ /($VALID_ZONES)\. Zone/
472 0 1200 if $event->{'description'} =~ /Penalty Shot/
473 524 676 if $event->{'type'} =~ /^(GOAL|MISS|SHOT|BLOCK)$/
474 128 1072 if $event->{'type'} eq 'MISS'
476 0 212 $event->{'type'} =~ /(GOAL|SHOT|MISS|BLOCK)/ ? :
212 988 unless $event->{'location'}
479 20 0 if ($event->{'description'} =~ /Assists: #(\d+) .* #(\d+)/) { }
0 0 elsif ($event->{'description'} =~ /Assist: #(\d+)/) { }
497 0 260 unless $1
499 128 132 if ($event->{'winning_team'} ne $event->{'team1'})
526 0 2520 if (ref $on_ice eq 'ARRAY') { }
532 0 2520 unless ref $on_ice_table->{'_content'}
541 0 14544 unless defined $on_ice_cell
542 0 14544 unless $on_ice_cell =~ /^\d+$/
559 0 0 $adjust ? :
0 0 ref $row->{'_content'}[$r] ? :
561 0 0 $block =~ /\r/ ? :
579 0 0 if ($team eq $self->{'teams'}[0]{'name'}) { }
0 0 elsif ($team eq $self->{'teams'}[1]{'name'}) { }
590 0 0 if $Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{'PL'}{$self->{'_id'}}{$self->{'events'}[-1]{'id'}}{'on_ice2'}
598 0 0 $self->{'events'}[-1] ? :
613 0 0 if ($line =~ /Shootout/)
619 0 0 if not $line =~ /\w/ or $line =~ /^\<\!\-\-/ or $line =~ /^\s*(\-+|\#)/ or not $self->{'goal_mode'} || $line =~ /^\s*(\d+|SO\s|F\s)/
622 0 0 if ($self->{'goal_mode'})
626 0 0 if ($line =~ /^\s+\d+\s+\d+:\d+/)
631 0 0 $self->{'so'} ? :
637 0 0 if defined $Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{'PL'}{$self->{'_id'}}{$event->{'id'}} and !$Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{'PL'}{$self->{'_id'}}{$event->{'id'}} || $Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{'PL'}{$self->{'_id'}}{$event->{'id'}}{'special'}
638 0 0 if ($self->{'so'})
641 0 0 $self->{'so'} ? :
643 0 0 if $event->{'period'} > 5 and $self->{'stage'} == $Sport::Analytics::NHL::Report::PL::REGULAR
646 0 0 if $event->{'type'} =~ /GOALIE/i
648 0 0 $self->{'so'} ? :
649 0 0 if $event->{'period'} =~ /\d/ and $event->{'period'} == 5 and $self->{'stage'} == $Sport::Analytics::NHL::Report::PL::REGULAR
650 0 0 $self->{'so'} ? :
651 0 0 $self->{'so'} ? :
666 0 0 if ($event->{'type'} =~ /(.*)\s+\(\s*\S+\s*\)/)
676 0 0 if ($event->{'type'} eq 'Penalty Shot')
681 0 0 if ($event->{'type'} eq 'GOAL')
682 0 0 $self->{'shootout'} ? :
696 0 0 if $event->{'special'}
697 0 0 if ($event->{'type'} eq 'GOAL')
698 0 0 if ($Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{'PL'}{$self->{'_id'}}{$event->{'id'}}{'on_ice'}) { }
0 0 elsif ($Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{'PL'}{$self->{'_id'}}{$event->{'id'}}{'on_ice1'}) { }
0 0 elsif ($Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{'PL'}{$self->{'_id'}}{$event->{'id'}}{'on_ice'}) { }
715 0 0 @{$self->{'head'};} == 2 ? :
724 0 0 if ($r == 1 and not @{$self->{'events'};})
731 0 0 unless $event
732 0 0 if $$event_cache{$event->{'id'}}
736 0 0 if ($evx and $evx->{'special'})
741 0 0 unless $OLD_EVENT_TYPES{$event->{'type'}}
744 0 0 if defined $evx->{'description'}
745 0 0 $event->{'type'} eq 'PENL' ? :
747 0 0 if ($event->{'strength'} eq '-')
748 0 0 @{$self->{'events'};} ? :
752 0 0 if $event->{'period'} > 11
756 0 0 if @{$self->{'events'};} and $self->{'events'}[-1]{'special'} or $adjust
758 0 0 unless $self->{'events'}[-1]{'special'}
759 0 0 if ($Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{'PL'}{$self->{'_id'}}{'-1'})
775 32 1264 if $event_cell eq '#' or $event_cell and ref $event_cell
777 0 1264 if defined $Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{'PL'}{$self->{'_id'}}{$event_cell} and not $Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{'PL'}{$self->{'_id'}}{$event_cell}
780 0 1264 unless $event_cell
781 0 1264 if grep {$event_cell eq $_;} @IGNORED_EVENT_TYPES
783 0 1264 if not grep({$event_cell eq $_;} @KNOWN_EVENT_TYPES)
787 20 10092 if ($pp == $DESCRIPTION_INDEX and $event->{'type'} eq 'GOAL')
789 20 0 if $extra_description
790 0 20 if ($event->{'id'} == 1)
802 0 1264 if $event->{'type'} eq 'PEND' and not $event->{'time'} =~ /^\d+/
812 0 0 if ($self->{'events'}[-$e]{'type'} eq 'PEND')
820 0 0 if ($self->{'events'}[-$e]{'period'} == 5 and $self->{'stage'} == $Sport::Analytics::NHL::Report::PL::REGULAR)
834 0 4 unless defined $evx
835 0 4 if ($evx->{'-1'})
839 1264 0 unless $$evx{$event->{'id'}}
840 0 0 if $event->{'special'}
841 0 0 if ($$evx{$event->{'id'}}{'on_ice'}) { }
0 0 elsif ($$evx{$event->{'id'}}{'on_ice1'}) { }
0 0 elsif ($$evx{$event->{'id'}}{'on_ice'}) { }
858 0 0 if $Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{$self->{'_id'}} and defined $Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{$self->{'_id'}}{$event->{'id'}} and $Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{$self->{'_id'}}{$event->{'id'}} == 0
859 0 1264 if $event and $event->{'period'} > 11
862 0 12 if $event->{'type'} eq 'PEND' || $event->{'type'} eq 'PSTR' and @{$self->{'events'};} and $self->{'events'}[-1]{'type'} eq $event->{'type'}
874 0 1264 if ($event->{'period'} == 5 and $self->{'stage'} == $Sport::Analytics::NHL::Report::PL::REGULAR)
889 0 12 unless $main_table
891 112 1296 unless ref $play_row and scalar @{$play_row->{'_content'};} >= @event_fields
893 32 1264 if not $event or $self->skip_event($event)
895 0 1264 if $event->{'type'} eq 'CHL' and $event->{'team1'} eq 'html'
896 1260 4 unless $event->{'type'} eq 'GEND'
899 1264 0 $Sport::Analytics::NHL::Report::PL::BROKEN_EVENTS{'PL'}{$self->{'_id'}} ? :
901 0 4 if $event->{'on_ice1'} and ref $event->{'on_ice1'} and ref $event->{'on_ice1'} ne 'ARRAY'
902 0 4 if $event->{'on_ice2'} and ref $event->{'on_ice2'} and ref $event->{'on_ice2'} ne 'ARRAY'
905 4 1260 if $self->{'events'}[-1]{'type'} eq 'GEND'
918 64 1200 if ($event->{'penalty'})
919 4 60 if ($event->{'penalty'} =~ /\bbench\b/i and not $event->{'penalty'} =~ /leav/i) { }
0 60 elsif ($event->{'penalty'} =~ /(.*\w)\W*\bcoach\b/i) { }
928 0 64 if ($event->{'penalty'} =~ /(.*)\s+\(MAJ\)/i) { }
0 64 elsif ($event->{'penalty'} =~ /(.*)\s+\(10 MIN\)/i) { }
939 4144 2176 unless exists $event->{$v}
940 196 1980 if ($v eq 'stopreason') { }
64 1916 elsif ($v eq 'penalty') { }
953 20 1244 if ($event->{'assist1'})
955 20 0 if $event->{'assist2'}
957 0 1264 if ($event->{'period'} == 5 and $self->{'stage'} == $Sport::Analytics::NHL::Report::PL::REGULAR)
969 0 4 $self->{'old'} ? :