Oil/ed.pm

filter: Statementstmt 100% 31 / 31 Branchbran 70.0% 7 / 10 Conditioncond 83.3% 5 / 6 MC/DCmcdc 66.6% 2 / 3 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 3 totaltotal 86.6% 52 / 60 CC 9 SCAR 11.1
CC
9
Cov
91%
ignition
4.0
is_slipped
4.0
wipe
3.1
CRAP 3.0
« Oil.pm ↑ Summary Oil/ed/Array.pm »
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
l!l
620
MC/DC0%0/1
shift() || 0
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
12 62 ▶ return 0 if($self->{level} < 1);
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"level"} < 1 0 62 62
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
l!l
602
MC/DC100%1/1
shift() || 8
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
19 62 ▶ my $wipe = shift || 1;
Condition100%2/2
shift() || 1
l!l
602
MC/DC100%1/1
shift() || 1
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
20 62 my $check = $self->wipe($wipe) * $weight;
21 62 ▶ rand(100) < $check ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
rand 100 < $check ? : 17 45 62
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
BranchTrueFalseTotal
if warnings::enabled("Acme::Oil") 2 0 2
31 if(warnings::enabled('Acme::Oil'));
32  
33 2 $self =~ /Acme::Oil::ed::(\w+)/;
34  
35 2 ▶ if($1 eq 'Scalar'){
Branch: 2 branches
BranchTrueFalseTotal
if ($1 eq 'Scalar') { } 1 1 2
elsif ($1 eq 'Array') { } 1 0 1
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;
« Oil.pm ↑ Summary Oil/ed/Array.pm »