| 1 | package Car::AbstractFactory; | ||||||||||||
| 2 | |||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 3 | ▶ | use Class::Interface; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 3 | abstract; | |||||||||||
| 7 | |||||||||||||
| 8 | 0 | ▶ | eval qq| | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=1.2
| |||||||||||||
| 9 | use Class::AccessorMaker { | ||||||||||||
| 10 | createdCars => [], | ||||||||||||
| 11 | }; | ||||||||||||
| 12 | |; | ||||||||||||
| 13 | |||||||||||||
| 14 | 3 | ▶ | if ( $@ ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 15 | 3 | ▶ | no strict 'refs'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 16 | 3 | ▶ | *{ __PACKAGE__ . "::createdCars" } = sub { | ||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=12.0
| |||||||||||||
| 17 | 1 | my ( $self, $what ) = @_; | |||||||||||
| 18 | |||||||||||||
| 19 | 1 | ▶ | if ( defined $what ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 20 | 0 | $self->{$what} = $what; | |||||||||||
| 21 | } | ||||||||||||
| 22 | |||||||||||||
| 23 | 1 | ▶ | return $self->{$what} || []; | ||||||||||
|
Condition50%1/2
$self->{$what} || []
MC/DC0%0/1
$self->{$what} || []
$self->{$what}
Truth table50%1/2
A
A= $self->{$what}
| |||||||||||||
| 24 | 3 | }; | |||||||||||
| 25 | } | ||||||||||||
| 26 | |||||||||||||
| 27 | sub createCar; # this is the abstract method | ||||||||||||
| 28 | |||||||||||||
| 29 | 1 | ▶ | sub rememberCreatedCar { | ||||||||||
|
Subroutine
rememberCreatedCar: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 30 | 1 | my ( $self, $car ) = @_; | |||||||||||
| 31 | |||||||||||||
| 32 | 1 | push @{$self->createdCars}, $car; | |||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | 3 | 1; | |||||||||||