Mock/Quick/Method.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 4 / 4 Conditioncond 66.6% 4 / 6 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 86.4% 32 / 37 CC 5 SCAR 11.8
CC
5
Cov
93%
new
5.1
BEGIN
1.0
BEGIN
1.0
CRAP 3.3
« Mock/Quick/Class.pm ↑ Summary Mock/Quick/Object.pm »
1 package Mock::Quick::Method;
2 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 10 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6 10 ▶use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 16 ▶sub new {
Subroutine new: called CC=5 SCAR=16.2
Pod undocumented
9 16 my $class = shift;
10 16 my ($sub) = @_;
11  
12 # Fixes #11
13 16 ▶ return $sub
Branch: 1 branch
BranchTrueFalseTotal
if $sub and builtin::blessed($sub) and $sub->isa($class) 1 15 16
Condition66%4/6
$sub and builtin::blessed($sub) and $sub->isa($class)
!ll&&!rl&&r
1501
$sub and builtin::blessed($sub)
!ll&&!rl&&r
0151
MC/DC33%1/3
$sub and builtin::blessed($sub) and $sub->isa($class)
$sub builtin::blessed($sub) $sub->isa($class)
Truth table50%2/4
A and B and C
A= $subB= builtin::blessed($sub)C= $sub->isa($class)
ABCresult
0XX0
10X0
1100
1111
14 if $sub
15 && Scalar::Util::blessed($sub)
16 && $sub->isa($class);
17  
18 15 ▶ Carp::croak "Constructor to $class takes a single codeblock"
Branch: 1 branch
BranchTrueFalseTotal
unless ref $sub eq "CODE" 1 14 15
19 unless ref $sub eq 'CODE';
20 14 return bless $sub, $class;
21 }
22  
23 10 1;
24  
25 __END__
« Mock/Quick/Class.pm ↑ Summary Mock/Quick/Object.pm »