SQL/Abstract/Parts.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 4 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 5 totaltotal 81.2% 39 / 48 CC 4 SCAR 5.4
CC
4
Cov
94%
new
3.2
stringify
2.0
BEGIN
1.0
CRAP 1.7
« SQL/Abstract/Role/Plugin.pm ↑ Summary SQL/Abstract/Reference.pm »
1 package SQL::Abstract::Parts;
2  
3 1 ▶use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use overload '""' => 'stringify', fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 153 ▶sub new {
Subroutine new: called CC=3 SCAR=11.7
Pod undocumented
10 153 my ($proto, $join, @parts) = @_;
11 153 ▶ bless([
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($_) ? : 139 208 347
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
01530
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
12 $join, map Scalar::Util::blessed($_) ? [ @$_ ] : $_, @parts
13 ], ref($proto) || $proto);
14 }
15  
16 32760 ▶sub stringify {
Subroutine stringify: called CC=2 SCAR=6.9
Pod undocumented
17 32760 my ($self) = @_;
18 32760 my ($join, @parts) = @$self;
19 32760 ▶ return join($join, map +(ref() ? stringify($_) : $_), @parts);
Branch: 1 branch
BranchTrueFalseTotal
ref $_ ? : 26328 51143 77471
20 }
21  
22 963 ▶sub to_array { return @{$_[0]} }
Subroutine to_array: called CC=1 SCAR=0.0
Pod undocumented
23  
24 962 ▶sub formatter {
Subroutine formatter: called CC=1 SCAR=0.0
Pod undocumented
25 962 my ($self, %opts) = @_;
26 962 require SQL::Abstract::Formatter;
27 962 SQL::Abstract::Formatter->new(%opts)
28 }
29  
30 962 ▶sub format {
Subroutine format: called CC=1 SCAR=0.0
Pod undocumented
31 962 my ($self, %opts) = @_;
32 962 $self->formatter(%opts)
33 ->format($self->to_array);
34 }
35  
36 1 1;
« SQL/Abstract/Role/Plugin.pm ↑ Summary SQL/Abstract/Reference.pm »