Log4perl/Appender/String.pm

filter: Statementstmt 50.0% 7 / 14 Branchbran 0.0% 0 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 1 / 3 Podpod 33.3% 1 / 3 totaltotal 37.0% 10 / 27 CC 3 SCAR 12.9
CC
3
Cov
42%
string
6.0
new
2.1
log
2.0
CRAP 3.6
« Log4perl/Config/Watch.pm ↑ Summary Log4perl/Appender/RRDs.pm »
1 package Log::Log4perl::Appender::String;
2 54 our @ISA = qw(Log::Log4perl::Appender);
3  
4 ##################################################
5 # Log dispatcher writing to a string buffer
6 ##################################################
7  
8 ##################################################
9 54 ▶sub new {
Subroutine new: called CC=2 SCAR=7.2
Pod documented
10 ##################################################
11 54 my $proto = shift;
12 54 ▶ my $class = ref $proto || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
0540
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
13 54 my %params = @_;
14  
15 54 my $self = {
16 name => "unknown name",
17 string => "",
18 %params,
19 };
20  
21 54 bless $self, $class;
22 }
23  
24 ##################################################
25 0 ▶sub log {
Subroutine log: not called CC=1 SCAR=6.9
Pod undocumented
26 ##################################################
27 0 my $self = shift;
28 0 my %params = @_;
29  
30 0 $self->{string} .= $params{message};
31 }
32  
33 ##################################################
34 0 ▶sub string {
Subroutine string: not called CC=2 SCAR=17.9
Pod undocumented
35 ##################################################
36 0 my($self, $new) = @_;
37  
38 0 ▶ if(defined $new) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $new) 0 0 0
39 0 $self->{string} = $new;
40 }
41  
42 0 return $self->{string};
43 }
44  
45 54 1;
46  
47 __END__
« Log4perl/Config/Watch.pm ↑ Summary Log4perl/Appender/RRDs.pm »