PerlActor/Object.pm

filter: Statementstmt 79.1% 19 / 24 Branchbran n/a Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 6 totaltotal 62.7% 27 / 43 CC 2 SCAR 3.0
CC
2
Cov
74%
new
2.1
trim
2.0
BEGIN
1.0
CRAP 1.4
« PerlActor/Command.pm ↑ Summary PerlActor/Script.pm »
1 package PerlActor::Object;
2 1 ▶use fields qw( listener context );
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 #===============================================================================================
6 # Public Methods
7 #===============================================================================================
8  
9 sub new
10 68 ▶{
Subroutine new: called CC=2 SCAR=7.4
Pod undocumented
11 68 my $proto = shift;
12 68 ▶ my $class = ref $proto || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
0680
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 68 my $self = fields::new($class);
14 68 return $self;
15 }
16  
17 sub setListener
18 16 ▶{
Subroutine setListener: called CC=1 SCAR=0.0
Pod undocumented
19 16 my $self = shift;
20 16 $self->{listener} = shift;
21 }
22  
23 sub getListener
24 15 ▶{
Subroutine getListener: called CC=1 SCAR=0.0
Pod undocumented
25 15 my $self = shift;
26 15 return $self->{listener};
27 }
28  
29 sub setContext
30 23 ▶{
Subroutine setContext: called CC=1 SCAR=0.0
Pod undocumented
31 23 my $self = shift;
32 23 $self->{context} = shift;
33 }
34  
35 sub getContext
36 15 ▶{
Subroutine getContext: called CC=1 SCAR=0.0
Pod undocumented
37 15 my $self = shift;
38 15 return $self->{context};
39 }
40  
41 sub trim
42 0 ▶{
Subroutine trim: not called CC=1 SCAR=6.9
Pod undocumented
43 0 my $self = shift;
44 0 my $string = shift;
45 0 $string =~ s/^\s+//;
46 0 $string =~ s/\s+$//;
47 0 return $string;
48 }
49  
50 #===============================================================================================
51 # Protected Methods - Don't even think about calling these from outside the class.
52 #===============================================================================================
53  
54 # Keep Perl happy.
55 1 1;
« PerlActor/Command.pm ↑ Summary PerlActor/Script.pm »