| 1 | ############################################################################## | ||||||||||||||
| 2 | package Acme::Oil::ed; | ||||||||||||||
| 3 | |||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 2 | ▶ | use Carp; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | 2 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | 2 | ▶ | use warnings::register; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 8 | |||||||||||||||
| 9 | 62 | ▶ | sub wipe { | ||||||||||||
|
Subroutine
wipe: called CC=3 SCAR=11.4
Pod
undocumented
| |||||||||||||||
| 10 | 62 | my $self = shift; | |||||||||||||
| 11 | 62 | ▶ | my $wipe = shift || 0; | ||||||||||||
|
Condition50%1/2
shift() || 0
MC/DC0%0/1
shift() || 0
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||
| 12 | 62 | ▶ | return 0 if($self->{level} < 1); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 13 | 62 | $self->{level} -= $wipe; | |||||||||||||
| 14 | } | ||||||||||||||
| 15 | |||||||||||||||
| 16 | 62 | ▶ | sub is_slipped { | ||||||||||||
|
Subroutine
is_slipped: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||
| 17 | 62 | my $self = shift; | |||||||||||||
| 18 | 62 | ▶ | my $weight = shift || 8; | ||||||||||||
|
Condition100%2/2
shift() || 8
MC/DC100%1/1
shift() || 8
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||
| 19 | 62 | ▶ | my $wipe = shift || 1; | ||||||||||||
|
Condition100%2/2
shift() || 1
MC/DC100%1/1
shift() || 1
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||
| 20 | 62 | my $check = $self->wipe($wipe) * $weight; | |||||||||||||
| 21 | 62 | ▶ | rand(100) < $check ? 1 : 0; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 22 | } | ||||||||||||||
| 23 | |||||||||||||||
| 24 | |||||||||||||||
| 25 | |||||||||||||||
| 26 | 2 | ▶ | sub ignition { | ||||||||||||
|
Subroutine
ignition: called CC=4 SCAR=14.0
Pod
undocumented
| |||||||||||||||
| 27 | 2 | my $self = shift; | |||||||||||||
| 28 | 2 | my $ash = 'ASH'; | |||||||||||||
| 29 | |||||||||||||||
| 30 | 2 | ▶ | carp "Don't bring the fire close! ...Bom!" | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 31 | if(warnings::enabled('Acme::Oil')); | ||||||||||||||
| 32 | |||||||||||||||
| 33 | 2 | $self =~ /Acme::Oil::ed::(\w+)/; | |||||||||||||
| 34 | |||||||||||||||
| 35 | 2 | ▶ | if($1 eq 'Scalar'){ | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 36 | 1 | require Acme::Oil::Ashed::Scalar; | |||||||||||||
| 37 | 1 | bless $self, 'Acme::Oil::Ashed::Scalar'; | |||||||||||||
| 38 | } | ||||||||||||||
| 39 | elsif($1 eq 'Array'){ | ||||||||||||||
| 40 | 1 | require Acme::Oil::Ashed::Array; | |||||||||||||
| 41 | 1 | bless $self, 'Acme::Oil::Ashed::Array'; | |||||||||||||
| 42 | } | ||||||||||||||
| 43 | } | ||||||||||||||
| 44 | |||||||||||||||
| 45 | |||||||||||||||
| 46 | 2 | 1; | |||||||||||||