Alzabo/Utils.pm

filter: Statementstmt 63.6% 7 / 11 Branchbran n/a Conditioncond 0.0% 0 / 21 MC/DCmcdc 0.0% 0 / 11 Subroutinesub 33.3% 2 / 6 Podpod 0.0% 0 / 4 totaltotal 16.9% 9 / 53 CC 8 SCAR 23.9
CC
8
Cov
22%
is_hashref
20.0
is_arrayref
12.0
safe_can
6.0
CRAP 10.9
« Alzabo/Create/ColumnDefinition.pm ↑ Summary Alzabo/Driver/PostgreSQL.pm »
1 package Alzabo::Utils;
2  
3 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 12 ▶use Scalar::Util qw( blessed reftype );
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 sub safe_can
9 0 ▶{
Subroutine safe_can: not called CC=2 SCAR=17.9
Pod undocumented
10 0 ▶ return blessed( $_[0] ) && $_[0]->can( $_[1] );
Condition0%0/3
builtin::blessed($_[0]) && $_[0]->can($_[1])
!ll&&!rl&&r
000
MC/DC0%0/2
builtin::blessed($_[0]) && $_[0]->can($_[1])
builtin::blessed($_[0]) $_[0]->can($_[1])
Truth table0%0/3
A && B
A= builtin::blessed($_[0])B= $_[0]->can($_[1])
ABresult
0X0
100
111
11 }
12  
13 sub safe_isa
14 0 ▶{
Subroutine safe_isa: not called CC=2 SCAR=17.9
Pod undocumented
15 0 ▶ return blessed( $_[0] ) && $_[0]->isa( $_[1] );
Condition0%0/3
builtin::blessed($_[0]) && $_[0]->isa($_[1])
!ll&&!rl&&r
000
MC/DC0%0/2
builtin::blessed($_[0]) && $_[0]->isa($_[1])
builtin::blessed($_[0]) $_[0]->isa($_[1])
Truth table0%0/3
A && B
A= builtin::blessed($_[0])B= $_[0]->isa($_[1])
ABresult
0X0
100
111
16 }
17  
18 sub is_arrayref
19 0 ▶{
Subroutine is_arrayref: not called CC=3 SCAR=24.8
Pod undocumented
20 0 ▶ return defined $_[0] && ref $_[0] && reftype $_[0] eq 'ARRAY';
Condition0%0/6
defined $_[0] && ref $_[0] && builtin::reftype($_[0]) eq 'ARRAY'
!ll&&!rl&&r
000
defined $_[0] and ref $_[0]
!ll&&!rl&&r
000
MC/DC0%0/3
defined $_[0] && ref $_[0] && builtin::reftype($_[0]) eq 'ARRAY'
defined $_[0] ref $_[0] builtin::reftype($_[0]) eq 'ARRAY'
Truth table0%0/4
A and B && C
A= defined $_[0]B= ref $_[0]C= builtin::reftype($_[0]) eq 'ARRAY'
ABCresult
0XX0
10X0
1100
1111
21 }
22  
23 sub is_hashref
24 0 ▶{
Subroutine is_hashref: not called CC=4 SCAR=30.0
Pod undocumented
25 0 ▶ return defined $_[0] && ref $_[0] && ( ! blessed $_[0] ) && reftype $_[0] eq 'HASH';
Condition0%0/9
defined $_[0] && ref $_[0] && !builtin::blessed($_[0]) && builtin::reftype($_[0]) eq 'HASH'
!ll&&!rl&&r
000
defined $_[0] and ref $_[0] and not builtin::blessed($_[0])
!ll&&!rl&&r
000
defined $_[0] and ref $_[0]
!ll&&!rl&&r
000
MC/DC0%0/4
defined $_[0] && ref $_[0] && !builtin::blessed($_[0]) && builtin::reftype($_[0]) eq 'HASH'
defined $_[0] ref $_[0] not builtin::blessed($_[0]) builtin::reftype($_[0]) eq 'HASH'
Truth table0%0/5
A and B and not(C) && D
A= defined $_[0]B= ref $_[0]C= not builtin::blessed($_[0])D= builtin::reftype($_[0]) eq 'HASH'
ABCDresult
0XXX0
10XX0
110X0
11100
11111
26 }
27  
28  
29 12 1;
30  
31 __END__
« Alzabo/Create/ColumnDefinition.pm ↑ Summary Alzabo/Driver/PostgreSQL.pm »