Sprocket/Logger/Basic.pm

filter: Statementstmt 61.1% 11 / 18 Branchbran 10.0% 1 / 10 Conditioncond 20.0% 1 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 4 / 4 Podpod 50.0% 1 / 2 totaltotal 42.8% 18 / 42 CC 8 SCAR 32.1
CC
8
Cov
39%
put
37.9
new
2.3
BEGIN
1.0
CRAP 24.7
« Sprocket/Spread.pm ↑ Summary Sprocket/Local/Connection.pm »
1 package Sprocket::Logger::Basic;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 10 ▶sub new {
Subroutine new: called CC=2 SCAR=8.1
Pod undocumented
7 10 my $class = shift;
8 10 ▶ bless( {}, ref $class || $class );
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
0100
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
9 }
10  
11 24 ▶sub put {
Subroutine put: called CC=7 SCAR=36.3
Pod documented
12 24 my ($self, $sprocket, $opts) = @_;
13  
14 24 ▶ return unless ( $opts->{v} <= $sprocket->{opts}->{log_level} );
Branch: 1 branch
BranchTrueFalseTotal
unless $opts->{"v"} <= $sprocket->{"opts"}{"log_level"} 24 0 24
15 0 my $con = $sprocket->{heap};
16 0 ▶ my $sender = ( $con )
Branch: 2 branches
BranchTrueFalseTotal
$con ? : 0 0 0
$con->peer_addr ? : 0 0 0
17 ? ( $con->peer_addr ? $con->peer_addr : '' )."(".$con->ID.")" : "?";
18 0 ▶ my $l = $opts->{l} ? $opts->{l}+2 : 2;
Branch: 1 branch
BranchTrueFalseTotal
$opts->{'l'} ? : 0 0 0
19 0 ▶ my $caller = $opts->{call} ? $opts->{call} : ( caller($l) )[3] || '?';
Branch: 1 branch
BranchTrueFalseTotal
$opts->{'call'} ? : 0 0 0
Condition0%0/2
(caller $l)[3] or "?"
l!l
00
MC/DC0%0/1
(caller $l)[3] or "?"
(caller $l)[3]
Truth table0%0/2
A
A= (caller $l)[3]
Aresult
11
00
20 0 $caller =~ s/^POE::Component/PoCo/o;
21 0 $caller =~ s/^Sprocket::Plugin/SPlugin/o;
22 0 print STDERR '['.localtime()."][pid:$$][$sprocket->{connections}][$caller][$sender] $opts->{msg}\n";
23 }
24  
25 5 1;
26  
27 __END__
« Sprocket/Spread.pm ↑ Summary Sprocket/Local/Connection.pm »