SQL/Abstract/Parts.pm

filter: Statementstmt 100% 27 / 27 Branchbran 83.3% 5 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 5 totaltotal 80.7% 42 / 52 CC 4 SCAR 5.4
CC
4
Cov
92%
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 our $VERSION = '2.000003';
4 1 ▶$VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases
Branch: 1 branch
BranchTrueFalseTotal
if $VERSION =~ /_/ 0 1 1
5  
6 1 ▶use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use overload '""' => 'stringify', fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 153 ▶sub new {
Subroutine new: called CC=3 SCAR=11.7
Pod undocumented
13 153 my ($proto, $join, @parts) = @_;
14 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
15 $join, map Scalar::Util::blessed($_) ? [ @$_ ] : $_, @parts
16 ], ref($proto) || $proto);
17 }
18  
19 32760 ▶sub stringify {
Subroutine stringify: called CC=2 SCAR=6.9
Pod undocumented
20 32760 my ($self) = @_;
21 32760 my ($join, @parts) = @$self;
22 32760 ▶ return join($join, map +(ref() ? stringify($_) : $_), @parts);
Branch: 1 branch
BranchTrueFalseTotal
ref $_ ? : 26328 51143 77471
23 }
24  
25 963 ▶sub to_array { return @{$_[0]} }
Subroutine to_array: called CC=1 SCAR=0.0
Pod undocumented
26  
27 962 ▶sub formatter {
Subroutine formatter: called CC=1 SCAR=0.0
Pod undocumented
28 962 my ($self, %opts) = @_;
29 962 require SQL::Abstract::Formatter;
30 962 SQL::Abstract::Formatter->new(%opts)
31 }
32  
33 962 ▶sub format {
Subroutine format: called CC=1 SCAR=0.0
Pod undocumented
34 962 my ($self, %opts) = @_;
35 962 $self->formatter(%opts)
36 ->format($self->to_array);
37 }
38  
39 1 1;
« SQL/Abstract/Role/Plugin.pm ↑ Summary SQL/Abstract/Reference.pm »