| 1 | package Baseball::Sabermetrics::Team; | ||||||||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use Baseball::Sabermetrics::abstract; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||
| 5 | 2 | our @ISA = qw/ Baseball::Sabermetrics::abstract /; | |||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||
| 7 | sub players | ||||||||||||||||||||||||||||||||||
| 8 | 5 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
players: called CC=3 SCAR=14.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 9 | 5 | my ($self, $name) = @_; | |||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | if ($name) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 11 | 0 | ▶ | die "Player not found: $name\n" unless exists $self->{players}->{$name}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 12 | 0 | return $self->{players}->{$name}; | |||||||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||||||||
| 14 | 5 | return values %{$self->{players}}; | |||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||
| 17 | sub pitchers | ||||||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
pitchers: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 19 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | return grep { exists $_->{np} and $_->{np} > 0 } $self->players; | ||||||||||||||||||||||||||||||||
|
Condition0%0/3
exists $_->{'np'} && $_->{'np'} > 0
MC/DC0%0/2
exists $_->{'np'} && $_->{'np'} > 0
exists $_->{'np'}
$_->{'np'} > 0
Truth table0%0/3
A && B
A= exists $_->{'np'}B= $_->{'np'} > 0
| |||||||||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||
| 23 | sub batters | ||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
batters: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 25 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 26 | 1 | ▶ | return grep { exists $_->{pa} and $_->{pa} > 0 } $self->players; | ||||||||||||||||||||||||||||||||
|
Condition33%1/3
exists $_->{'pa'} && $_->{'pa'} > 0
MC/DC0%0/2
exists $_->{'pa'} && $_->{'pa'} > 0
exists $_->{'pa'}
$_->{'pa'} > 0
Truth table33%1/3
A && B
A= exists $_->{'pa'}B= $_->{'pa'} > 0
| |||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||
| 29 | sub left_handed_pitchers | ||||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
left_handed_pitchers: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 31 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | return grep { exists $_->{np} and $_->{np} > 0 and $_->{bio}->{throws} eq 'left' } $self->players; | ||||||||||||||||||||||||||||||||
|
Condition0%0/6
exists $_->{'np'} && $_->{'np'} > 0 && $_->{'bio'}{'throws'} eq 'left'
exists $_->{"np"} and $_->{"np"} > 0
MC/DC0%0/3
exists $_->{'np'} && $_->{'np'} > 0 && $_->{'bio'}{'throws'} eq 'left'
exists $_->{"np"}
$_->{"np"} > 0
$_->{'bio'}{'throws'} eq 'left'
Truth table0%0/4
A and B && C
A= exists $_->{"np"}B= $_->{"np"} > 0C= $_->{'bio'}{'throws'} eq 'left'
| |||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||
| 35 | sub right_handed_pitchers | ||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
right_handed_pitchers: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 37 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | return grep { exists $_->{np} and $_->{np} > 0 and $_->{bio}->{throws} eq 'right' } $self->players; | ||||||||||||||||||||||||||||||||
|
Condition0%0/6
exists $_->{'np'} && $_->{'np'} > 0 && $_->{'bio'}{'throws'} eq 'right'
exists $_->{"np"} and $_->{"np"} > 0
MC/DC0%0/3
exists $_->{'np'} && $_->{'np'} > 0 && $_->{'bio'}{'throws'} eq 'right'
exists $_->{"np"}
$_->{"np"} > 0
$_->{'bio'}{'throws'} eq 'right'
Truth table0%0/4
A and B && C
A= exists $_->{"np"}B= $_->{"np"} > 0C= $_->{'bio'}{'throws'} eq 'right'
| |||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||
| 41 | sub report | ||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
report: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 43 | 0 | my ($self, @cols) = @_; | |||||||||||||||||||||||||||||||||
| 44 | 0 | print join("\t", @cols), "\n"; | |||||||||||||||||||||||||||||||||
| 45 | 0 | for ($self->players) { | |||||||||||||||||||||||||||||||||
| 46 | 0 | $_->print(@cols); | |||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||
| 50 | sub report_pitchers | ||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
report_pitchers: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 52 | 0 | my ($self, @cols) = @_; | |||||||||||||||||||||||||||||||||
| 53 | 0 | print join("\t", @cols), "\n"; | |||||||||||||||||||||||||||||||||
| 54 | 0 | for ($self->pitchers) { | |||||||||||||||||||||||||||||||||
| 55 | 0 | $_->print(@cols); | |||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||
| 59 | sub report_batters | ||||||||||||||||||||||||||||||||||
| 60 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
report_batters: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 61 | 1 | my ($self, @cols) = @_; | |||||||||||||||||||||||||||||||||
| 62 | 1 | print join("\t", @cols), "\n"; | |||||||||||||||||||||||||||||||||
| 63 | 1 | for ($self->batters) { | |||||||||||||||||||||||||||||||||
| 64 | 5 | $_->print(@cols); | |||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||
| 68 | 2 | 1; | |||||||||||||||||||||||||||||||||