Maker/Empty.pm

filter: Statementstmt 72.0% 18 / 25 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 1 totaltotal 51.1% 23 / 45 CC 4 SCAR 21.6
CC
4
Cov
55%
init
20.0
__ANON__
2.0
BEGIN
1.0
CRAP 8.7
« Maker/Ladder.pm ↑ Summary Maker/Random.pm »
1 package Graph::Maker::Empty;
2
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use base qw/Graph::Maker/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Graph;
Subroutine BEGIN: called CC=1 SCAR=0.0
8
9 1 our $VERSION = '0.01';
10
11 sub init
12 0 ▶{
Subroutine init: not called CC=4 SCAR=30.0
Pod undocumented
13 0 my ($self, %params) = @_;
14
15 0 my $gm = delete($params{graph_maker});
16 0 ▶ croak "graph_maker must be a reference to a function that creates a Graph.\n" if $gm && ref($gm) ne 'CODE';
Branch: 1 branch
BranchTrueFalseTotal
if $gm and ref $gm ne "CODE" 0 0 0
Condition0%0/3
$gm and ref $gm ne "CODE"
!ll&&!rl&&r
000
MC/DC0%0/2
$gm and ref $gm ne "CODE"
$gm ref $gm ne "CODE"
Truth table0%0/3
A and B
A= $gmB= ref $gm ne "CODE"
ABresult
0X0
100
111
17 0 ▶ $gm ||= sub { new Graph(@_); };
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$gm ||= sub { "Graph"->new(@_); }
l!l&&r!l&&!r
000
MC/DC0%0/2
$gm ||= sub { "Graph"->new(@_); }
$gm sub { "Graph"->new(@_); }
Truth table0%0/3
A ||= B
A= $gmB= sub { "Graph"->new(@_); }
ABresult
1X1
011
000
18
19 0 my $g = $gm->(%params);
20 0 return $g;
21 }
22
23 1 Graph::Maker->add_factory_type( 'empty' => __PACKAGE__ );
24
25 1 1;
26
27 __DATA__
« Maker/Ladder.pm ↑ Summary Maker/Random.pm »