blib/lib/Lemonldap/NG/Common/Logger/Std.pm

filter: Statementstmt 95.2% 20 / 21 Branchbran 83.3% 5 / 6 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 5 totaltotal 76.1% 32 / 42 CC 6 SCAR 12.6
CC
6
Cov
90%
new
6.1
debug
1.0
info
1.0
CRAP 3.5
« blib/lib/Lemonldap/NG/Common/Util/Crypto.pm ↑ Summary blib/lib/Lemonldap/NG/Common/Crypto.pm »
1 package Lemonldap::NG::Common::Logger::Std;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our $VERSION = '2.0.15';
6  
7 2 ▶sub new {
Subroutine new: called CC=6 SCAR=18.0
Pod undocumented
8 4 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶ my $level = $_[1]->{logLevel} || 'info';
Condition50%1/2
$_[1]{'logLevel'} || 'info'
l!l
20
MC/DC0%0/1
$_[1]{'logLevel'} || 'info'
$_[1]{'logLevel'}
Truth table50%1/2
A
A= $_[1]{'logLevel'}
Aresult
11
00
10 2 my $show = 1;
11  
12 2 foreach (qw(error warn notice info debug)) {
13 10 ▶ if ($show) {
Branch: 1 branch
BranchTrueFalseTotal
if ($show) { } 2 8 10
14 eval
15 2 qq'sub $_ {print STDERR "[".localtime."] [LLNG:\$\$] [$_] \$_[1]\n"}';
16 }
17 else {
18 0 ▶ eval qq'sub $_ {1}';
Subroutine debug: called CC=1 SCAR=0.1
Subroutine info: called CC=1 SCAR=0.1
Subroutine notice: called CC=1 SCAR=0.1
Subroutine warn: not called CC=1 SCAR=0.1
Pod undocumented
Pod undocumented
Pod undocumented
Pod undocumented
19 }
20 10 ▶ $show = 0 if ( $level eq $_ );
Branch: 1 branch
BranchTrueFalseTotal
if $level eq $_ 2 8 10
21 }
22 2 ▶ die "Unknown logLevel $level" if $show;
Branch: 1 branch
BranchTrueFalseTotal
if $show 0 2 2
23  
24 2 return bless {}, shift;
25 }
26  
27 1 1;
« blib/lib/Lemonldap/NG/Common/Util/Crypto.pm ↑ Summary blib/lib/Lemonldap/NG/Common/Crypto.pm »