Alzabo/Debug.pm

filter: Statementstmt 75.0% 21 / 28 Branchbran 40.0% 4 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 70.4% 31 / 44 CC 7 SCAR 18.1
CC
7
Cov
66%
BEGIN
9.7
BEGIN
1.0
BEGIN
1.0
CRAP 6.1
« Alzabo/Runtime/UniqueRowCache.pm ↑ Summary Alzabo/SQLMaker/PostgreSQL.pm »
1 package Alzabo::Debug;
2  
3 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 BEGIN
6 11 ▶{
Subroutine BEGIN: called CC=7 SCAR=22.8
7 11 my %constants =
8 ( SQL => 0,
9 TRACE => 0,
10 METHODMAKER => 0,
11 REVERSE_ENGINEER => 0,
12 );
13  
14 11 ▶ if ( $ENV{ALZABO_DEBUG} )
Branch: 1 branch
BranchTrueFalseTotal
if ($ENV{"ALZABO_DEBUG"}) 0 11 11
15 {
16 0 my %debug = map { uc $_ => 1 } split /\|/, $ENV{ALZABO_DEBUG};
17  
18 0 ▶ if ( $debug{ALL} )
Branch: 1 branch
BranchTrueFalseTotal
if ($debug{'ALL'}) { } 0 0 0
19 {
20 0 @constants{ keys %constants } = (1) x keys %constants;
21 }
22 else
23 {
24 0 foreach ( grep { exists $constants{$_} } keys %debug )
25 {
26 0 ▶ $constants{$_} = $debug{$_} ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$debug{$_} ? : 0 0 0
27 }
28 }
29 }
30  
31 11 ▶ while ( my ($k, $v) = each %constants )
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %constants) 44 11 55
32 {
33 44 ▶ eval "use constant $k => $v";
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
34 44 ▶ die $@ if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 44 44
35 }
36 }
37  
38  
39 11 1;
40  
41 __END__
« Alzabo/Runtime/UniqueRowCache.pm ↑ Summary Alzabo/SQLMaker/PostgreSQL.pm »