SmokeBox/Smoker.pm

filter: Statementstmt 94.8% 37 / 39 Branchbran 41.6% 5 / 12 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 85.7% 12 / 14 Podpod 100% 2 / 2 totaltotal 75.3% 58 / 77 CC 11 SCAR 11.6
CC
11
Cov
77%
__ANON__
6.0
__ANON__
6.0
__ANON__
4.1
CRAP 3.2
« SmokeBox.pm ↑ Summary SmokeBox/Job.pm »
1 package POE::Component::SmokeBox::Smoker;
2 24 $POE::Component::SmokeBox::Smoker::VERSION = '0.54';
3 #ABSTRACT: encapsulates a smoker object.
4  
5 24 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 24 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 24 ▶use Params::Check qw(check);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 24 ▶use base qw(Object::Accessor);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 24 ▶use vars qw($VERBOSE);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub new {
12 54 ▶ my $package = shift;
Subroutine new: called CC=3 SCAR=12.8
Pod documented
13  
14 my $tmpl = {
15 perl => { defined => 1, required => 1 },
16 0 ▶ env => { defined => 1, allow => [ sub { return 1 if ref $_[0] eq 'HASH'; } ], },
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[0] eq "HASH" 0 0 0
17 4 ▶ do_callback => { allow => sub { return 1 if ! defined $_[0] or $_[0]->isa( 'CODE' ); }, },
Subroutine __ANON__: called CC=3 SCAR=14.2
Branch: 1 branch
BranchTrueFalseTotal
if not defined $_[0] or $_[0]->isa("CODE") 4 0 4
Condition33%1/3
not defined $_[0] or $_[0]->isa("CODE")
l!l&&r!l&&!r
040
MC/DC0%0/2
not defined $_[0] or $_[0]->isa("CODE")
not defined $_[0] $_[0]->isa("CODE")
Truth table33%1/3
not(A) or B
A= not defined $_[0]B= $_[0]->isa("CODE")
ABresult
1X1
011
000
18 2 ▶ name => { allow => sub { return 1; }, },
Subroutine __ANON__: called CC=1 SCAR=0.0
19 54 };
20  
21 54 ▶ my $args = check( $tmpl, { @_ }, 1 ) or return;
Branch: 1 branch
BranchTrueFalseTotal
my $args = check($tmpl, {@_}, 1) or return 0 54 54
22 54 my $self = bless { }, $package;
23 my $accessor_map = {
24 54 ▶ perl => sub { defined $_[0]; },
Subroutine __ANON__: called CC=1 SCAR=0.0
25 0 ▶ env => sub { return 1 if ref $_[0] eq 'HASH'; },
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[0] eq "HASH" 0 0 0
26 4 ▶ do_callback => sub { return 1 if ! defined $_[0] or $_[0]->isa( 'CODE' ) },
Subroutine __ANON__: called CC=3 SCAR=14.2
Branch: 1 branch
BranchTrueFalseTotal
if not defined $_[0] or $_[0]->isa("CODE") 4 0 4
Condition33%1/3
not defined $_[0] or $_[0]->isa("CODE")
l!l&&r!l&&!r
040
MC/DC0%0/2
not defined $_[0] or $_[0]->isa("CODE")
not defined $_[0] $_[0]->isa("CODE")
Truth table33%1/3
not(A) or B
A= not defined $_[0]B= $_[0]->isa("CODE")
ABresult
1X1
011
000
27 2 ▶ name => sub { return 1; },
Subroutine __ANON__: called CC=1 SCAR=0.0
28 54 };
29 54 $self->mk_accessors( $accessor_map );
30 54 $self->$_( $args->{$_} ) for keys %{ $args };
31 54 return $self;
32 }
33  
34 sub dump_data {
35 85 ▶ my $self = shift;
Subroutine dump_data: called CC=3 SCAR=11.0
Pod documented
36 85 my @returns = qw(perl);
37 85 foreach my $data ( qw( env do_callback ) ) {
38 170 ▶ push @returns, $data if defined $self->$data;
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->$data 4 166 170
39 }
40 85 return map { ( $_ => $self->$_ ) } @returns;
41 }
42  
43 24 1;
44  
45 __END__
« SmokeBox.pm ↑ Summary SmokeBox/Job.pm »