blib/lib/Net/Peep/Client/Logparser/Event.pm

filter: Statementstmt 84.0% 58 / 69 Branchbran 38.8% 7 / 18 Conditioncond 20.0% 1 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 86.6% 13 / 15 Podpod 0.0% 0 / 10 totaltotal 65.8% 79 / 120 CC 12 SCAR 11.9
CC
12
Cov
72%
pool
12.0
letter
6.0
new
2.1
CRAP 3.3
« blib/lib/Net/Peep/Peck.pm ↑ Summary blib/lib/Net/Peep/Scheduler.pm »
1 package Net::Peep::Client::Logparser::Event;
2  
3 3 require 5.00503;
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 # use warnings; # commented out for 5.005 compatibility
6 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use Net::Peep::Host::Pool;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 require Exporter;
11  
12 3 ▶use vars qw{ @ISA %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION };
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 3 @ISA = qw(Exporter);
15 3 %EXPORT_TAGS = ( 'all' => [ qw( ) ] );
16 3 @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
17 3 @EXPORT = qw( );
18 3 $VERSION = do { my @r = (q$Revision: 1.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
19  
20 10 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
Pod undocumented
21  
22 10 my $self = shift;
23 10 ▶ my $class = ref($self) || $self;
Condition33%1/3
ref $self || $self
l!l&&r!l&&!r
0100
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table33%1/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
24 10 my $this = {};
25 10 bless $this, $class;
26  
27 } # end sub new
28  
29 10 ▶sub name {
Subroutine name: called CC=2 SCAR=7.0
Pod undocumented
30  
31 10 my $self = shift;
32 10 ▶ if (@_) { $self->{'NAME'} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 10 0 10
33 10 return $self->{'NAME'};
34  
35 } # end sub name
36  
37 10 ▶sub group {
Subroutine group: called CC=2 SCAR=7.0
Pod undocumented
38  
39 10 my $self = shift;
40 10 ▶ if (@_) { $self->{'GROUP'} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 10 0 10
41 10 return $self->{'GROUP'};
42  
43 } # end sub group
44  
45 0 ▶sub letter {
Subroutine letter: not called CC=2 SCAR=17.9
Pod undocumented
46  
47 0 my $self = shift;
48 0 ▶ if (@_) { $self->{'LETTER'} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
49 0 return $self->{'LETTER'};
50  
51 } # end sub letter
52  
53 10 ▶sub location {
Subroutine location: called CC=2 SCAR=7.0
Pod undocumented
54  
55 10 my $self = shift;
56 10 ▶ if (@_) { $self->{'LOCATION'} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 10 0 10
57 10 return $self->{'LOCATION'};
58  
59 } # end sub location
60  
61 10 ▶sub priority {
Subroutine priority: called CC=2 SCAR=7.0
Pod undocumented
62  
63 10 my $self = shift;
64 10 ▶ if (@_) { $self->{'PRIORITY'} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 10 0 10
65 10 return $self->{'PRIORITY'};
66  
67 } # end sub priority
68  
69 10 ▶sub notification {
Subroutine notification: called CC=2 SCAR=7.0
Pod undocumented
70  
71 10 my $self = shift;
72 10 ▶ if (@_) { $self->{'NOTIFICATION'} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 10 0 10
73 10 return $self->{'NOTIFICATION'};
74  
75 } # end sub notification
76  
77 10 ▶sub regex {
Subroutine regex: called CC=2 SCAR=7.0
Pod undocumented
78  
79 10 my $self = shift;
80 10 ▶ if (@_) { $self->{'REGEX'} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 10 0 10
81 10 return $self->{'REGEX'};
82  
83 } # end sub regex
84  
85 10 ▶sub hosts {
Subroutine hosts: called CC=2 SCAR=7.0
Pod undocumented
86  
87 10 my $self = shift;
88 10 ▶ if (@_) { $self->{'HOSTS'} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 10 0 10
89 10 return $self->{'HOSTS'};
90  
91 } # end sub hosts
92  
93 0 ▶sub pool {
Subroutine pool: not called CC=3 SCAR=24.8
Pod undocumented
94  
95 0 my $self = shift;
96 0 ▶ unless (exists $self->{'POOL'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $self->{"POOL"}) 0 0 0
97 0 ▶ my $hosts = $self->hosts()
Condition0%0/2
$self->hosts || confess('Cannot get host pool: No hosts have been identified yet.')
l!l
00
MC/DC0%0/1
$self->hosts || confess('Cannot get host pool: No hosts have been identified yet.')
$self->hosts
Truth table0%0/2
A
A= $self->hosts
Aresult
11
00
98 || confess "Cannot get host pool: No hosts have been identified yet.";
99 0 my $pool = new Net::Peep::Host::Pool;
100 0 $pool->addHosts($hosts);
101 0 $self->{'POOL'} = $pool;
102 }
103 0 return $self->{'POOL'};
104  
105 } # end sub pool
106  
107 3 1;
108  
109 __END__
« blib/lib/Net/Peep/Peck.pm ↑ Summary blib/lib/Net/Peep/Scheduler.pm »