blib/lib/Net/Peep/Conf.pm

filter: Statementstmt 41.1% 170 / 413 Branchbran 18.5% 33 / 178 Conditioncond 18.5% 39 / 210 MC/DCmcdc 0.9% 1 / 106 Subroutinesub 49.2% 31 / 63 Podpod 0.0% 0 / 55 totaltotal 26.7% 274 / 1025 CC 187 SCAR 36.4
CC
187
Cov
30%
checkClientEvent
240.0
addClientHost
156.0
addClientUptime
56.0
CRAP 38.1
« blib/lib/Net/Peep/Client/Pinger.pm ↑ Summary blib/lib/Net/Peep/Host.pm »
1 package Net::Peep::Conf;
2  
3 11 require 5.00503;
4 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 # use warnings; # commented out for 5.005 compatibility
6 11 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 11 ▶use Socket;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 11 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 11 ▶use Sys::Hostname;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 11 ▶use Net::Peep::Log;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 11 ▶use Net::Peep::Host;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 11 require Exporter;
14  
15 11 ▶use vars qw{ @ISA %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION };
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 11 @ISA = qw(Exporter);
18 11 %EXPORT_TAGS = ( 'all' => [ qw( ) ] );
19 11 @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
20 11 @EXPORT = qw( );
21 11 $VERSION = do { my @r = (q$Revision: 1.8 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
22  
23 5 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
Pod undocumented
24  
25 5 my $self = shift;
26 5 ▶ my $class = ref($self) || $self;
Condition33%1/3
ref $self || $self
l!l&&r!l&&!r
050
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table33%1/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
27 5 my $this = {};
28 5 bless $this, $class;
29  
30 } # end sub new
31  
32 40 ▶sub logger {
Subroutine logger: called CC=2 SCAR=6.9
Pod undocumented
33  
34 # returns a logging object
35 40 my $self = shift;
36 40 ▶ if ( ! exists $self->{'__LOGGER'} ) { $self->{'__LOGGER'} = new Net::Peep::Log }
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $self->{"__LOGGER"}) 4 36 40
37 40 return $self->{'__LOGGER'};
38  
39 } # end sub logger
40  
41 117 ▶sub client {
Subroutine client: called CC=2 SCAR=6.9
Pod undocumented
42  
43 117 my $self = shift;
44 117 ▶ if (@_) { $self->{'CLIENT'} = shift; }
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 4 113 117
45 117 return $self->{'CLIENT'};
46  
47 } # end sub client
48  
49 4 ▶sub setVersion {
Subroutine setVersion: called CC=2 SCAR=7.0
Pod undocumented
50  
51 4 my $self = shift;
52 4 ▶ my $version = shift || confess "Cannot set version: No version information found";
Condition50%1/2
shift() || confess('Cannot set version: No version information found')
l!l
40
MC/DC0%0/1
shift() || confess('Cannot set version: No version information found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
53 4 $self->{"__VERSION"} = $version;
54 4 $self->logger()->debug(1,"Configuration file version [$version] identified.");
55 4 return 1;
56  
57 } # end sub setVersion
58  
59 5 ▶sub getVersion {
Subroutine getVersion: called CC=2 SCAR=7.6
Pod undocumented
60  
61 5 my $self = shift;
62  
63 5 ▶ if (exists $self->{"__VERSION"}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'__VERSION'}) { } 5 0 5
64 5 return $self->{"__VERSION"};
65 } else {
66 0 confess "Cannot get version: No version information has been set.";
67 }
68  
69 } # end sub getVersion
70  
71 5 ▶sub versionExists {
Subroutine versionExists: called CC=1 SCAR=0.0
Pod undocumented
72  
73 5 my $self = shift;
74 5 return exists $self->{"__VERSION"};
75  
76 } # end sub versionExists
77  
78 4 ▶sub setSoundPath {
Subroutine setSoundPath: called CC=2 SCAR=7.0
Pod undocumented
79  
80 4 my $self = shift;
81 4 ▶ my $soundpath = shift || confess "Cannot set sound path: No sound path information found";
Condition50%1/2
shift() || confess('Cannot set sound path: No sound path information found')
l!l
40
MC/DC0%0/1
shift() || confess('Cannot set sound path: No sound path information found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
82 4 $self->{"__SOUNDPATH"} = $soundpath;
83 4 $self->logger()->debug(1,"Configuration file soundpath [$soundpath] identified.");
84 4 return 1;
85  
86 } # end sub setSoundPath
87  
88 0 ▶sub getSoundPath {
Subroutine getSoundPath: not called CC=2 SCAR=17.9
Pod undocumented
89  
90 0 my $self = shift;
91  
92 0 ▶ if (exists $self->{"__SOUNDPATH"}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'__SOUNDPATH'}) { } 0 0 0
93 0 return $self->{"__SOUNDPATH"};
94 } else {
95 0 confess "Cannot get sound path: No sound path information has been set.";
96 }
97  
98 } # end sub getSoundPath
99  
100 0 ▶sub soundPathExists {
Subroutine soundPathExists: not called CC=1 SCAR=6.9
Pod undocumented
101  
102 0 my $self = shift;
103 0 return exists $self->{"__SOUNDPATH"};
104  
105 } # end sub soundPathExists
106  
107 0 ▶sub setApp {
Subroutine setApp: not called CC=2 SCAR=17.9
Pod undocumented
108  
109 0 my $self = shift;
110 0 ▶ my $app = shift || confess "Cannot set app: No app information found";
Condition0%0/2
shift() || confess('Cannot set app: No app information found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot set app: No app information found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
111 0 $self->{"__APP"} = $app;
112 0 $self->logger()->debug(1,"The application [$app] identified itself.");
113 0 return 1;
114  
115 } # end sub setApp
116  
117 0 ▶sub getApp {
Subroutine getApp: not called CC=2 SCAR=17.9
Pod undocumented
118  
119 0 my $self = shift;
120  
121 0 ▶ if (exists $self->{"__APP"}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'__APP'}) { } 0 0 0
122 0 return $self->{"__APP"};
123 } else {
124 0 confess "Cannot get app: No app information has been set.";
125 }
126  
127 } # end sub getApp
128  
129 16 ▶sub setClientPort {
Subroutine setClientPort: called CC=3 SCAR=11.3
Pod undocumented
130  
131 16 my $self = shift;
132 16 ▶ my $client = shift || confess "Cannot set port: No client information found";
Condition50%1/2
shift() || confess('Cannot set port: No client information found')
l!l
160
MC/DC0%0/1
shift() || confess('Cannot set port: No client information found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
133 16 ▶ my $port = shift || confess "Cannot set port: No port information found";
Condition50%1/2
shift() || confess('Cannot set port: No port information found')
l!l
160
MC/DC0%0/1
shift() || confess('Cannot set port: No port information found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
134 16 $self->{"__PORT"}->{$client} = $port;
135 16 return 1;
136  
137 } # end sub setClientPort
138  
139 3 ▶sub getClientPort {
Subroutine getClientPort: called CC=4 SCAR=16.4
Pod undocumented
140  
141 3 my $self = shift;
142 3 ▶ my $client = shift || confess "Cannot get port: No client information found";
Condition50%1/2
shift() || confess('Cannot get port: No client information found')
l!l
30
MC/DC0%0/1
shift() || confess('Cannot get port: No client information found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
143  
144 3 ▶ if (exists $self->{"__PORT"}->{$client}) {
Branch: 2 branches
BranchTrueFalseTotal
if (exists $self->{'__PORT'}{$client}) { } 0 3 3
elsif ($self->optionExists($client, 'port')) { } 3 0 3
145 0 return $self->{"__PORT"}->{$client};
146 } elsif ($self->optionExists($client,'port')) {
147 3 return $self->getOption($client,'port');
148 } else {
149 0 confess "Cannot get port: No port information has been defined for the client [$client].";
150 }
151  
152 } # end sub getClientPort
153  
154 4 ▶sub addBroadcast {
Subroutine addBroadcast: called CC=6 SCAR=20.2
Pod undocumented
155  
156 4 my $self = shift;
157 4 ▶ my $class = shift || confess "Cannot add broadcast: No class identifier found";
Condition50%1/2
shift() || confess('Cannot add broadcast: No class identifier found')
l!l
40
MC/DC0%0/1
shift() || confess('Cannot add broadcast: No class identifier found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
158 4 ▶ my $value = shift || confess "Cannot add broadcast: No broadcast information found";
Condition50%1/2
shift() || confess('Cannot add broadcast: No broadcast information found')
l!l
40
MC/DC0%0/1
shift() || confess('Cannot add broadcast: No broadcast information found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
159  
160 confess "Cannot add broadcast for class [$class]: Either the IP or port number has not been identified."
161 4 ▶ unless ref($value) eq 'HASH' and exists $value->{'ip'} and exists $value->{'port'};
Branch: 1 branch
BranchTrueFalseTotal
unless ref $value eq "HASH" and exists $value->{"ip"} and exists $value->{"port"} 0 4 4
Condition33%2/6
ref $value eq "HASH" and exists $value->{"ip"} and exists $value->{"port"}
!ll&&!rl&&r
004
ref $value eq "HASH" and exists $value->{"ip"}
!ll&&!rl&&r
004
MC/DC0%0/3
ref $value eq "HASH" and exists $value->{"ip"} and exists $value->{"port"}
ref $value eq "HASH" exists $value->{"ip"} exists $value->{"port"}
Truth table25%1/4
A and B and C
A= ref $value eq "HASH"B= exists $value->{"ip"}C= exists $value->{"port"}
ABCresult
0XX0
10X0
1100
1111
162  
163 4 my $broadcast = $value->{'ip'} . ':' . $value->{'port'};
164  
165 4 push @{$self->{"__BROADCAST"}->{$class}}, $value;
166  
167 4 return 1;
168  
169 } # end sub addBroadcast
170  
171 0 ▶sub getBroadcastList {
Subroutine getBroadcastList: not called CC=4 SCAR=30.0
Pod undocumented
172  
173 0 my $self = shift;
174  
175 confess "Cannot get broadcast list: No broadcast information has been set."
176 0 ▶ unless exists $self->{"__BROADCAST"};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__BROADCAST"} 0 0 0
177  
178 0 my @broadcasts = sort keys % { $self->{"__BROADCAST"} };
179  
180 0 my @return;
181  
182 0 for my $class (@broadcasts) {
183 0 push @return, @{$self->{"__BROADCAST"}->{$class}};
184 }
185  
186 0 ▶ return wantarray ? @return : [@return];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
187  
188 } # end sub getBroadcastList
189  
190 0 ▶sub getBroadcast {
Subroutine getBroadcast: not called CC=5 SCAR=34.0
Pod undocumented
191  
192 0 my $self = shift;
193 0 ▶ my $class = shift || confess "Cannot get broadcast: No class identifier found";
Condition0%0/2
shift() || confess('Cannot get broadcast: No class identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot get broadcast: No class identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
194  
195 confess "Cannot get information for the broadcast class [$class]: No information has been set."
196 0 ▶ unless exists $self->{"__BROADCAST"} && exists $self->{"__BROADCAST"}->{$class};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__BROADCAST"} and exists $self->{"__BROADCAST"}{$class} 0 0 0
Condition0%0/3
exists $self->{"__BROADCAST"} and exists $self->{"__BROADCAST"}{$class}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $self->{"__BROADCAST"} and exists $self->{"__BROADCAST"}{$class}
exists $self->{"__BROADCAST"} exists $self->{"__BROADCAST"}{$class}
Truth table0%0/3
A and B
A= exists $self->{"__BROADCAST"}B= exists $self->{"__BROADCAST"}{$class}
ABresult
0X0
100
111
197  
198 0 ▶ return wantarray ? @{$self->{"__BROADCAST"}->{$class}} : $self->{"__BROADCAST"}->{$class};
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
199  
200 } # end sub getBroadcast
201  
202 4 ▶sub addServer {
Subroutine addServer: called CC=6 SCAR=20.5
Pod undocumented
203  
204 4 my $self = shift;
205 4 ▶ my $class = shift || confess "Cannot add server: No class identifier found";
Condition50%1/2
shift() || confess('Cannot add server: No class identifier found')
l!l
40
MC/DC0%0/1
shift() || confess('Cannot add server: No class identifier found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
206 4 ▶ my $value = shift || confess "Cannot add server: No server information found";
Condition50%1/2
shift() || confess('Cannot add server: No server information found')
l!l
40
MC/DC0%0/1
shift() || confess('Cannot add server: No server information found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
207  
208 confess "Cannot add server for class [$class]: Either the name or port number has not been identified."
209 4 ▶ unless ref($value) eq 'HASH' and exists $value->{'name'} and exists $value->{'port'};
Branch: 1 branch
BranchTrueFalseTotal
unless ref $value eq "HASH" and exists $value->{"name"} and exists $value->{"port"} 0 4 4
Condition33%2/6
ref $value eq "HASH" and exists $value->{"name"} and exists $value->{"port"}
!ll&&!rl&&r
004
ref $value eq "HASH" and exists $value->{"name"}
!ll&&!rl&&r
004
MC/DC0%0/3
ref $value eq "HASH" and exists $value->{"name"} and exists $value->{"port"}
ref $value eq "HASH" exists $value->{"name"} exists $value->{"port"}
Truth table25%1/4
A and B and C
A= ref $value eq "HASH"B= exists $value->{"name"}C= exists $value->{"port"}
ABCresult
0XX0
10X0
1100
1111
210  
211 4 push @{$self->{"__SERVER"}->{$class}}, $value;
212  
213 4 return 1;
214  
215 } # end sub addServer
216  
217 0 ▶sub getServerList {
Subroutine getServerList: not called CC=4 SCAR=30.0
Pod undocumented
218  
219 0 my $self = shift;
220  
221 confess "Cannot get server list: No server information has been set."
222 0 ▶ unless exists $self->{"__SERVER"};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__SERVER"} 0 0 0
223  
224 0 my @servers = keys % { $self->{"__SERVER"} };
225  
226 0 my @return;
227  
228 0 for my $class (@servers) {
229 0 push @return, @{$self->{"__SERVER"}->{$class}};
230 }
231  
232 0 ▶ return wantarray ? @return : [@return];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
233  
234 } # end sub getServerList
235  
236 3 ▶sub getServer {
Subroutine getServer: called CC=5 SCAR=19.4
Pod undocumented
237  
238 3 my $self = shift;
239 3 ▶ my $class = shift || confess "Cannot get server: No class identifier found";
Condition50%1/2
shift() || confess('Cannot get server: No class identifier found')
l!l
30
MC/DC0%0/1
shift() || confess('Cannot get server: No class identifier found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
240  
241 confess "Cannot get information for the server in class [$class]: No information has been set."
242 3 ▶ unless exists $self->{"__SERVER"} && exists $self->{"__SERVER"}->{$class};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__SERVER"} and exists $self->{"__SERVER"}{$class} 0 3 3
Condition33%1/3
exists $self->{"__SERVER"} and exists $self->{"__SERVER"}{$class}
!ll&&!rl&&r
003
MC/DC0%0/2
exists $self->{"__SERVER"} and exists $self->{"__SERVER"}{$class}
exists $self->{"__SERVER"} exists $self->{"__SERVER"}{$class}
Truth table33%1/3
A and B
A= exists $self->{"__SERVER"}B= exists $self->{"__SERVER"}{$class}
ABresult
0X0
100
111
243  
244 0 ▶ return wantarray ? @{$self->{"__SERVER"}->{$class}} : $self->{"__SERVER"}->{$class};
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 3 3
245  
246 } # end sub getServer
247  
248 4 ▶sub addClass {
Subroutine addClass: called CC=4 SCAR=14.5
Pod undocumented
249  
250 4 my $self = shift;
251 4 ▶ my $key = shift || confess "Cannot add class: No class identifier found";
Condition50%1/2
shift() || confess('Cannot add class: No class identifier found')
l!l
40
MC/DC0%0/1
shift() || confess('Cannot add class: No class identifier found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
252 4 ▶ my $value = shift || confess "Cannot add class: No class information found";
Condition50%1/2
shift() || confess('Cannot add class: No class information found')
l!l
40
MC/DC0%0/1
shift() || confess('Cannot add class: No class information found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
253  
254 4 ▶ confess "Cannot set class [$key]: Expecting an array ref (instead of [$value])."
Branch: 1 branch
BranchTrueFalseTotal
unless ref $value eq "ARRAY" 0 4 4
255 unless ref($value) eq 'ARRAY';
256  
257 4 $self->{"__CLASS"}->{$key} = $value;
258  
259 4 return 1;
260  
261 } # end sub addClass
262  
263 6 ▶sub getClassList {
Subroutine getClassList: called CC=3 SCAR=11.3
Pod undocumented
264  
265 6 my $self = shift;
266  
267 confess "Cannot get class list: No class information has been set."
268 6 ▶ unless exists $self->{"__CLASS"};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CLASS"} 0 6 6
269  
270 6 my @classes = keys % { $self->{"__CLASS"} };
271  
272 6 ▶ return wantarray ? @classes : [@classes];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 6 0 6
273  
274 } # end sub getClassList
275  
276 16 ▶sub getClass {
Subroutine getClass: called CC=5 SCAR=19.4
Pod undocumented
277  
278 16 my $self = shift;
279 16 ▶ my $key = shift || confess "no class identifier found";
Condition50%1/2
shift() || confess('no class identifier found')
l!l
160
MC/DC0%0/1
shift() || confess('no class identifier found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
280  
281 confess "Cannot get information for the class [$key]: No information has been set."
282 16 ▶ unless exists $self->{"__CLASS"} && exists $self->{"__CLASS"}->{$key};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CLASS"} and exists $self->{"__CLASS"}{$key} 0 16 16
Condition33%1/3
exists $self->{"__CLASS"} and exists $self->{"__CLASS"}{$key}
!ll&&!rl&&r
0016
MC/DC0%0/2
exists $self->{"__CLASS"} and exists $self->{"__CLASS"}{$key}
exists $self->{"__CLASS"} exists $self->{"__CLASS"}{$key}
Truth table33%1/3
A and B
A= exists $self->{"__CLASS"}B= exists $self->{"__CLASS"}{$key}
ABresult
0X0
100
111
283  
284 0 ▶ return wantarray ? @ { $self->{"__CLASS"}->{$key} } : $self->{"__CLASS"}->{$key};
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 16 16
285  
286 } # end sub getClass
287  
288 0 ▶sub addClientClass {
Subroutine addClientClass: not called CC=3 SCAR=24.8
Pod undocumented
289  
290 0 my $self = shift;
291 0 ▶ my $client = shift || confess "Cannot add client class: No client identifier found";
Condition0%0/2
shift() || confess('Cannot add client class: No client identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot add client class: No client identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
292 0 ▶ my $value = shift || confess "Cannot add client class: No class identifier found";
Condition0%0/2
shift() || confess('Cannot add client class: No class identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot add client class: No class identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
293  
294 0 push @ { $self->{"__CLIENTCLASS"}->{$client} }, $value;
295  
296 0 return 1;
297  
298 } # end sub addClientClasses
299  
300 0 ▶sub getClientClassList {
Subroutine getClientClassList: not called CC=4 SCAR=30.0
Pod undocumented
301  
302 0 my $self = shift;
303 0 ▶ my $client = shift || confess "Cannot add client classes: No client identifier found";
Condition0%0/2
shift() || confess('Cannot add client classes: No client identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot add client classes: No client identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
304  
305 confess "Cannot get class list: No class information has been set."
306 0 ▶ unless exists $self->{"__CLIENTCLASS"}->{$client};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CLIENTCLASS"}{$client} 0 0 0
307  
308 0 my @classes = @ { $self->{"__CLIENTCLASS"}->{$client} };
309  
310 0 ▶ return wantarray ? @classes : [@classes];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
311  
312 } # end sub getClientClasses
313  
314 72 ▶sub addEvent {
Subroutine addEvent: called CC=4 SCAR=14.5
Pod undocumented
315  
316 72 my $self = shift;
317 72 ▶ my $name = shift || confess "Cannot add event: No event identifier found";
Condition50%1/2
shift() || confess('Cannot add event: No event identifier found')
l!l
720
MC/DC0%0/1
shift() || confess('Cannot add event: No event identifier found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
318 72 ▶ my $value = shift || confess "Cannot add event: No event information found";
Condition50%1/2
shift() || confess('Cannot add event: No event information found')
l!l
720
MC/DC0%0/1
shift() || confess('Cannot add event: No event information found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
319  
320 72 ▶ confess "Cannot set event [$name]: Expecting a hash ref (instead of [$value])."
Branch: 1 branch
BranchTrueFalseTotal
unless ref $value eq "HASH" 0 72 72
321 unless ref($value) eq 'HASH';
322  
323 72 $self->{"__EVENT"}->{$name} = $value;
324  
325 72 return 1;
326  
327 } # end sub addEvent
328  
329 0 ▶sub getEventList {
Subroutine getEventList: not called CC=3 SCAR=24.8
Pod undocumented
330  
331 0 my $self = shift;
332  
333 confess "Cannot get event list: No event information has been set."
334 0 ▶ unless exists $self->{"__EVENT"};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__EVENT"} 0 0 0
335  
336 0 my @events = keys % { $self->{"__EVENT"} };
337  
338 0 ▶ return wantarray ? @events : [@events];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
339  
340 } # end sub getEventList
341  
342 0 ▶sub getEvent {
Subroutine getEvent: not called CC=5 SCAR=34.0
Pod undocumented
343  
344 0 my $self = shift;
345 0 ▶ my $name = shift || confess "Cannot get event: No event identifier found";
Condition0%0/2
shift() || confess('Cannot get event: No event identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot get event: No event identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
346  
347 confess "Cannot get information for the event [$name]: No information has been set."
348 0 ▶ unless exists $self->{"__EVENT"} && exists $self->{"__EVENT"}->{$name};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__EVENT"} and exists $self->{"__EVENT"}{$name} 0 0 0
Condition0%0/3
exists $self->{"__EVENT"} and exists $self->{"__EVENT"}{$name}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $self->{"__EVENT"} and exists $self->{"__EVENT"}{$name}
exists $self->{"__EVENT"} exists $self->{"__EVENT"}{$name}
Truth table0%0/3
A and B
A= exists $self->{"__EVENT"}B= exists $self->{"__EVENT"}{$name}
ABresult
0X0
100
111
349  
350 0 ▶ return wantarray ? @ { $self->{"__EVENT"}->{$name} } : $self->{"__EVENT"}->{$name};
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
351  
352 } # end sub getEvent
353  
354 0 ▶sub isEvent {
Subroutine isEvent: not called CC=3 SCAR=24.8
Pod undocumented
355  
356 0 my $self = shift;
357 0 ▶ my $name = shift || confess "Cannot check event: No event identifier found";
Condition0%0/2
shift() || confess('Cannot check event: No event identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot check event: No event identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
358  
359 0 ▶ return exists $self->{"__EVENT"} && exists $self->{"__EVENT"}->{$name};
Condition0%0/3
exists $self->{'__EVENT'} && exists $self->{'__EVENT'}{$name}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $self->{'__EVENT'} && exists $self->{'__EVENT'}{$name}
exists $self->{'__EVENT'} exists $self->{'__EVENT'}{$name}
Truth table0%0/3
A && B
A= exists $self->{'__EVENT'}B= exists $self->{'__EVENT'}{$name}
ABresult
0X0
100
111
360  
361 } # end sub isEvent
362  
363 16 ▶sub setConfigurationText {
Subroutine setConfigurationText: called CC=3 SCAR=11.1
Pod undocumented
364  
365 16 my $self = shift;
366 16 my $client = shift;
367 16 my @text = @_;
368  
369 16 ▶ confess "Cannot set configuration text: No client found."
Branch: 1 branch
BranchTrueFalseTotal
unless $client 0 16 16
370 unless $client;
371  
372 16 ▶ confess "Cannot set configuration text: No text found."
Branch: 1 branch
BranchTrueFalseTotal
unless @text 0 16 16
373 unless @text;
374  
375 16 $self->{"__CONFIGURATIONTEXT"}->{$client} = join '', @text;
376  
377 $self->logger()->debug(1,"\tConfiguration text of length " .
378 16 length($self->{"__CONFIGURATIONTEXT"}->{$client}) .
379 " added to client [$client].");
380  
381 16 return 1;
382  
383 } # end sub setConfigurationText
384  
385 0 ▶sub getConfigurationText {
Subroutine getConfigurationText: not called CC=2 SCAR=17.9
Pod undocumented
386  
387 0 my $self = shift;
388 0 my $client = shift;
389  
390 confess "Cannot get configuration text: It has not been set yet."
391 0 ▶ unless exists $self->{"__CONFIGURATIONTEXT"}->{$client};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CONFIGURATIONTEXT"}{$client} 0 0 0
392  
393 0 return $self->{"__CONFIGURATIONTEXT"}->{$client};
394  
395 } # end sub getConfigurationText
396  
397 16 ▶sub setNotificationText {
Subroutine setNotificationText: called CC=3 SCAR=11.1
Pod undocumented
398  
399 16 my $self = shift;
400 16 my $client = shift;
401 16 my @text = @_;
402  
403 16 ▶ confess "Cannot set notification text: No client found."
Branch: 1 branch
BranchTrueFalseTotal
unless $client 0 16 16
404 unless $client;
405  
406 16 ▶ confess "Cannot set notification text: No text found."
Branch: 1 branch
BranchTrueFalseTotal
unless @text 0 16 16
407 unless @text;
408  
409 16 $self->{"__NOTIFICATIONTEXT"}->{$client} = join '', @text;
410  
411 $self->logger()->debug(1,"Notification text of length " .
412 16 length($self->{"__NOTIFICATIONTEXT"}->{$client}) .
413 " added to client [$client].");
414  
415 16 return 1;
416  
417 } # end sub setNotificationText
418  
419 0 ▶sub getNotificationText {
Subroutine getNotificationText: not called CC=2 SCAR=17.9
Pod undocumented
420  
421 0 my $self = shift;
422 0 my $client = shift;
423  
424 confess "Cannot get notification text: It has not been set yet."
425 0 ▶ unless exists $self->{"__NOTIFICATIONTEXT"}->{$client};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__NOTIFICATIONTEXT"}{$client} 0 0 0
426  
427 0 return $self->{"__NOTIFICATIONTEXT"}->{$client};
428  
429 } # end sub getNotificationText
430  
431 12 ▶sub addState {
Subroutine addState: called CC=4 SCAR=14.5
Pod undocumented
432  
433 12 my $self = shift;
434 12 ▶ my $name = shift || confess "Cannot add state: No state identifier found";
Condition50%1/2
shift() || confess('Cannot add state: No state identifier found')
l!l
120
MC/DC0%0/1
shift() || confess('Cannot add state: No state identifier found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
435 12 ▶ my $value = shift || confess "Cannot add state: No state information found";
Condition50%1/2
shift() || confess('Cannot add state: No state information found')
l!l
120
MC/DC0%0/1
shift() || confess('Cannot add state: No state information found')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
436  
437 12 ▶ confess "Cannot set state [$name]: Expecting a hash ref (instead of [$value])."
Branch: 1 branch
BranchTrueFalseTotal
unless ref $value eq "HASH" 0 12 12
438 unless ref($value) eq 'HASH';
439  
440 12 $self->{"__STATE"}->{$name} = $value;
441  
442 12 return 1;
443  
444 } # end sub addState
445  
446 0 ▶sub getStateList {
Subroutine getStateList: not called CC=3 SCAR=24.8
Pod undocumented
447  
448 0 my $self = shift;
449  
450 confess "Cannot get state list: No state information has been set."
451 0 ▶ unless exists $self->{"__STATE"};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__STATE"} 0 0 0
452  
453 0 my @states = keys % { $self->{"__STATE"} };
454  
455 0 ▶ return wantarray ? @states : [@states];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
456  
457 } # end sub getStateList
458  
459 0 ▶sub getState {
Subroutine getState: not called CC=5 SCAR=34.0
Pod undocumented
460  
461 0 my $self = shift;
462 0 ▶ my $name = shift || confess "Cannot get state: No state identifier found";
Condition0%0/2
shift() || confess('Cannot get state: No state identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot get state: No state identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
463  
464 confess "Cannot get information for the state [$name]: No information has been set."
465 0 ▶ unless exists $self->{"__STATE"} && exists $self->{"__STATE"}->{$name};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__STATE"} and exists $self->{"__STATE"}{$name} 0 0 0
Condition0%0/3
exists $self->{"__STATE"} and exists $self->{"__STATE"}{$name}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $self->{"__STATE"} and exists $self->{"__STATE"}{$name}
exists $self->{"__STATE"} exists $self->{"__STATE"}{$name}
Truth table0%0/3
A and B
A= exists $self->{"__STATE"}B= exists $self->{"__STATE"}{$name}
ABresult
0X0
100
111
466  
467 0 ▶ return wantarray ? @ { $self->{"__STATE"}->{$name} } : $self->{"__STATE"}->{$name};
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
468  
469 } # end sub getState
470  
471 0 ▶sub isState {
Subroutine isState: not called CC=3 SCAR=24.8
Pod undocumented
472  
473 0 my $self = shift;
474 0 ▶ my $name = shift || confess "Cannot check state: No state identifier found";
Condition0%0/2
shift() || confess('Cannot check state: No state identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot check state: No state identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
475  
476 0 ▶ return exists $self->{"__STATE"} && exists $self->{"__STATE"}->{$name};
Condition0%0/3
exists $self->{'__STATE'} && exists $self->{'__STATE'}{$name}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $self->{'__STATE'} && exists $self->{'__STATE'}{$name}
exists $self->{'__STATE'} exists $self->{'__STATE'}{$name}
Truth table0%0/3
A && B
A= exists $self->{'__STATE'}B= exists $self->{'__STATE'}{$name}
ABresult
0X0
100
111
477  
478 } # end sub isState
479  
480 0 ▶sub addClientEvent {
Subroutine addClientEvent: not called CC=4 SCAR=30.0
Pod undocumented
481  
482 0 my $self = shift;
483 0 ▶ my $name = shift || confess "Cannot add client event: No client event identifier found";
Condition0%0/2
shift() || confess('Cannot add client event: No client event identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot add client event: No client event identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
484 0 ▶ my $value = shift || confess "Cannot add client event: No client event information found";
Condition0%0/2
shift() || confess('Cannot add client event: No client event information found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot add client event: No client event information found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
485  
486 0 ▶ confess "Cannot set client event [$name]: Expecting a hash ref (instead of [$value])."
Branch: 1 branch
BranchTrueFalseTotal
unless ref $value eq "HASH" 0 0 0
487 unless ref($value) eq 'HASH';
488  
489 0 my $clientevent = $value->{'name'};
490  
491 0 push @ { $self->{"__CLIENTEVENT"}->{$name} }, $value;
492  
493 0 return 1;
494  
495 } # end sub addClientEvent
496  
497 0 ▶sub getClientEventList {
Subroutine getClientEventList: not called CC=4 SCAR=30.0
Pod undocumented
498  
499 0 my $self = shift;
500  
501 confess "Cannot get clientevent list: No clientevent information has been set."
502 0 ▶ unless exists $self->{"__CLIENTEVENT"};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CLIENTEVENT"} 0 0 0
503  
504 0 my @clientevents;
505  
506 0 for my $client (keys % { $self->{"__CLIENTEVENT"} }) {
507 0 push @clientevents, @ { $self->{"__CLIENTEVENT"}->{$client} };
508 }
509  
510 0 ▶ return wantarray ? @clientevents : [@clientevents];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
511  
512 } # end sub getClientEventList
513  
514 0 ▶sub getClientEvents {
Subroutine getClientEvents: not called CC=5 SCAR=34.0
Pod undocumented
515  
516 0 my $self = shift;
517 0 ▶ my $name = shift || confess "Cannot get clientevent: No clientevent identifier found";
Condition0%0/2
shift() || confess('Cannot get clientevent: No clientevent identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot get clientevent: No clientevent identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
518  
519 confess "Cannot get information for the clientevent [$name]: No information has been set."
520 0 ▶ unless exists $self->{"__CLIENTEVENT"} && exists $self->{"__CLIENTEVENT"}->{$name};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CLIENTEVENT"} and exists $self->{"__CLIENTEVENT"}{$name} 0 0 0
Condition0%0/3
exists $self->{"__CLIENTEVENT"} and exists $self->{"__CLIENTEVENT"}{$name}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $self->{"__CLIENTEVENT"} and exists $self->{"__CLIENTEVENT"}{$name}
exists $self->{"__CLIENTEVENT"} exists $self->{"__CLIENTEVENT"}{$name}
Truth table0%0/3
A and B
A= exists $self->{"__CLIENTEVENT"}B= exists $self->{"__CLIENTEVENT"}{$name}
ABresult
0X0
100
111
521  
522 0 ▶ return wantarray ? @ { $self->{"__CLIENTEVENT"}->{$name} } : $self->{"__CLIENTEVENT"}->{$name};
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
523  
524 } # end sub getClientEvents
525  
526 0 ▶sub checkClientEvent {
Subroutine checkClientEvent: not called CC=15 SCAR=54.8
Pod undocumented
527  
528 0 my $self = shift;
529 0 ▶ my $client = shift || confess "Client not found";
Condition0%0/2
shift() || confess('Client not found')
l!l
00
MC/DC0%0/1
shift() || confess('Client not found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
530 0 ▶ my $event = shift || confess "Event not found";
Condition0%0/2
shift() || confess('Event not found')
l!l
00
MC/DC0%0/1
shift() || confess('Event not found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
531  
532 0 my $return = 0;
533  
534 0 my ($group,$letter) = ('','');
535  
536 0 ▶ $group = $event->{'group'} if exists $event->{'group'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $event->{"group"} 0 0 0
537 0 ▶ $letter = $event->{'option-letter'} if exists $event->{'option-letter'};
Branch: 1 branch
BranchTrueFalseTotal
if exists $event->{"option-letter"} 0 0 0
538  
539 0 my @groups = ();
540 0 my @exclude = ();
541 0 my @events = ();
542  
543 0 ▶ @events = split //, $self->getOption($client,'events') if $self->optionExists($client,'events');
Branch: 1 branch
BranchTrueFalseTotal
if $self->optionExists($client, "events") 0 0 0
544 0 ▶ @groups = @{ $self->getOption($client,'groups') } if $self->optionExists($client,'groups');
Branch: 1 branch
BranchTrueFalseTotal
if $self->optionExists($client, "groups") 0 0 0
545 0 ▶ @exclude = @{ $self->getOption($client,'exclude') } if $self->optionExists($client,'exclude');
Branch: 1 branch
BranchTrueFalseTotal
if $self->optionExists($client, "exclude") 0 0 0
546  
547 # first check the events option
548
549 0 for my $letter_option (@events) {
550 0 ▶ $return = 1 if $letter eq $letter_option;
Branch: 1 branch
BranchTrueFalseTotal
if $letter eq $letter_option 0 0 0
551 }
552  
553 0 ▶ if (grep /^all$/, @groups) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep /^all$/, @groups) { } 0 0 0
554 0 $return = 1;
555 0 for my $exclude_option (@exclude) {
556 0 ▶ $return = 0 if $group eq $exclude_option;
Branch: 1 branch
BranchTrueFalseTotal
if $group eq $exclude_option 0 0 0
557 }
558 } else {
559 0 for my $group_option (@groups) {
560 0 ▶ $return = 1 if $group eq $group_option;
Branch: 1 branch
BranchTrueFalseTotal
if $group eq $group_option 0 0 0
561 }
562 }
563  
564 0 return $return;
565  
566 } # end sub checkClientEvent
567  
568 0 ▶sub checkClientHost {
Subroutine checkClientHost: not called CC=3 SCAR=24.8
Pod undocumented
569  
570 0 my $self = shift;
571 0 ▶ my $client = shift || confess "Client not found";
Condition0%0/2
shift() || confess('Client not found')
l!l
00
MC/DC0%0/1
shift() || confess('Client not found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
572 0 ▶ my $host = shift || confess "Host not found";
Condition0%0/2
shift() || confess('Host not found')
l!l
00
MC/DC0%0/1
shift() || confess('Host not found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
573  
574 0 my $return = 0;
575  
576 0 my $event = $host->getEvent();
577  
578 0 return $self->checkClientEvent($client,$event);
579  
580 } # end sub checkClientHost
581  
582 0 ▶sub addClientHost {
Subroutine addClientHost: not called CC=12 SCAR=50.5
Pod undocumented
583  
584 0 my $self = shift;
585 0 ▶ my $client = shift || confess "Cannot add client host: No client identifier found";
Condition0%0/2
shift() || confess('Cannot add client host: No client identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot add client host: No client identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
586 0 ▶ my $value = shift || confess "Cannot add client host: No client host information found";
Condition0%0/2
shift() || confess('Cannot add client host: No client host information found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot add client host: No client host information found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
587  
588 0 ▶ confess "Cannot set client host for client [$client]: Expecting a hash ref (instead of [$value])."
Branch: 1 branch
BranchTrueFalseTotal
unless ref $value eq "HASH" 0 0 0
589 unless ref($value) eq 'HASH';
590  
591 0 my $identifier = $value->{'host'};
592  
593 0 my ($iaddr,$host,$ip);
594 0 ▶ if ($identifier =~ /^(\d+\.)+\d+$/) {
Branch: 2 branches
BranchTrueFalseTotal
if ($identifier =~ /^(\d+\.)+\d+$/) { } 0 0 0
elsif ($identifier =~ /^([\w-]+\.)+\w+$/) { } 0 0 0
595 # we were given an IP address
596 0 $ip = $identifier;
597 0 $host = inet_aton($ip);
598 0 ▶ $host = gethostbyaddr($host,AF_INET) if $host;
Branch: 1 branch
BranchTrueFalseTotal
if $host 0 0 0
599 0 ▶ $self->logger()->log("\t\tThe host name for IP [$ip] could not be found. This host will be ignored.")
Branch: 1 branch
BranchTrueFalseTotal
unless $host 0 0 0
Condition0%0/5
$host || $self->logger->log("\t\tThe host name for IP [$ip] could not be found. This host will be ignored.") && (return 0)
l!l&&r!l&&!r
000
$self->logger->log("\t\tThe host name for IP [$ip] could not be found. This host will be ignored.") and return 0
!ll
00
MC/DC0%0/2
$host || $self->logger->log("\t\tThe host name for IP [$ip] could not be found. This host will be ignored.") && (return 0)
$host $self->logger->log("\t\tThe host name for IP [$ip] could not be found. This host will be ignored.")
Truth table0%0/3
A || B
A= $hostB= $self->logger->log("\t\tThe host name for IP [$ip] could not be found. This host will be ignored.")
ABresult
1X1
011
000
600 and return 0 unless $host;
601 0 $self->logger()->debug(9,"\t\tThe host name [$host] was found for host [$identifier].");
602 } elsif ($identifier =~ /^([\w-]+\.)+\w+$/) {
603 # we were given a host name
604 0 $host = $identifier;
605 0 $ip = gethostbyname($identifier);
606 # funny that the next line and previous line can't be combined ... but Socket complains!
607 0 ▶ $ip = inet_ntoa($ip) if $ip;
Branch: 1 branch
BranchTrueFalseTotal
if $ip 0 0 0
608 0 ▶ $self->logger()->log("\t\tThe IP address for host [$identifier] could not be found. This host will be ignored.")
Branch: 1 branch
BranchTrueFalseTotal
unless $ip 0 0 0
Condition0%0/5
$ip || $self->logger->log("\t\tThe IP address for host [$identifier] could not be found. This host will be ignored.") && (return 0)
l!l&&r!l&&!r
000
$self->logger->log("\t\tThe IP address for host [$identifier] could not be found. This host will be ignored.") and return 0
!ll
00
MC/DC0%0/2
$ip || $self->logger->log("\t\tThe IP address for host [$identifier] could not be found. This host will be ignored.") && (return 0)
$ip $self->logger->log("\t\tThe IP address for host [$identifier] could not be found. This host will be ignored.")
Truth table0%0/3
A || B
A= $ipB= $self->logger->log("\t\tThe IP address for host [$identifier] could not be found. This host will be ignored.")
ABresult
1X1
011
000
609 and return 0 unless $ip;
610 0 $self->logger()->debug(9,"\t\tThe IP address [$ip] was found for host [$identifier].");
611 } else {
612 0 $self->logger()->log("The host name or IP [$identifier] does not appear to be valid. This host will be ignored.");
613 0 return;
614 }
615
616 my $event = {
617 name => $value->{'name'},
618 group => $value->{'group'},
619 'option-letter' => $value->{'option-letter'},
620 location => $value->{'location'},
621 priority => $value->{'priority'},
622 0 status => $value->{'status'},
623  
624 };
625  
626 0 my $clienthost = new Net::Peep::Host;
627 0 $clienthost->setName($host);
628 0 $clienthost->setIP($ip);
629 0 $clienthost->setEvent($event);
630 0 $clienthost->setNotificationLevel($value->{'status'});
631  
632 0 push @ { $self->{"__CLIENTHOST"}->{$client} }, $clienthost;
633  
634 0 return 1;
635  
636 } # end sub addClientHost
637  
638 0 ▶sub getClientHostList {
Subroutine getClientHostList: not called CC=4 SCAR=30.0
Pod undocumented
639  
640 0 my $self = shift;
641  
642 confess "Cannot get clienthost list: No client host information has been set."
643 0 ▶ unless exists $self->{"__CLIENTHOST"};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CLIENTHOST"} 0 0 0
644  
645 0 my @clienthosts;
646  
647 0 for my $client (keys % { $self->{"__CLIENTHOST"} }) {
648 0 push @clienthosts, @ { $self->{"__CLIENTHOST"}->{$client} };
649 }
650  
651 0 ▶ return wantarray ? @clienthosts : [@clienthosts];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
652  
653 } # end sub getClientHostList
654  
655 0 ▶sub getClientHosts {
Subroutine getClientHosts: not called CC=6 SCAR=37.4
Pod undocumented
656  
657 0 my $self = shift;
658 0 ▶ my $client = shift || confess "Cannot get client host: No client identifier found";
Condition0%0/2
shift() || confess('Cannot get client host: No client identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot get client host: No client identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
659  
660 $self->logger()->log("Cannot get host information for the client [$client]: No information has been set.")
661 and return
662 0 ▶ unless exists $self->{"__CLIENTHOST"} && exists $self->{"__CLIENTHOST"}->{$client};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CLIENTHOST"} and exists $self->{"__CLIENTHOST"}{$client} 0 0 0
Condition0%0/8
exists $self->{'__CLIENTHOST'} && exists $self->{'__CLIENTHOST'}{$client} || $self->logger->log("Cannot get host information for the client [$client]: No information has been set.") && (return)
l!l&&r!l&&!r
000
exists $self->{"__CLIENTHOST"} and exists $self->{"__CLIENTHOST"}{$client}
!ll&&!rl&&r
000
$self->logger->log("Cannot get host information for the client [$client]: No information has been set.") and return
!ll
00
MC/DC0%0/3
exists $self->{'__CLIENTHOST'} && exists $self->{'__CLIENTHOST'}{$client} || $self->logger->log("Cannot get host information for the client [$client]: No information has been set.") && (return)
exists $self->{"__CLIENTHOST"} exists $self->{"__CLIENTHOST"}{$client} $self->logger->log("Cannot get host information for the client [$client]: No information has been set.")
Truth table0%0/5
A and B || C
A= exists $self->{"__CLIENTHOST"}B= exists $self->{"__CLIENTHOST"}{$client}C= $self->logger->log("Cannot get host information for the client [$client]: No information has been set.")
ABCresult
11X1
0X11
1011
0X00
1000
663  
664 0 ▶ return wantarray ? @{$self->{"__CLIENTHOST"}->{$client}} : $self->{"__CLIENTHOST"}->{$client};
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
665  
666 } # end sub getClientHosts
667  
668 0 ▶sub addClientUptime {
Subroutine addClientUptime: not called CC=7 SCAR=40.3
Pod undocumented
669  
670 0 my $self = shift;
671 0 ▶ my $client = shift || confess "Cannot add client uptime: No client identifier found";
Condition0%0/2
shift() || confess('Cannot add client uptime: No client identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot add client uptime: No client identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
672 0 ▶ my $value = shift || confess "Cannot add client uptime: No client uptime information found";
Condition0%0/2
shift() || confess('Cannot add client uptime: No client uptime information found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot add client uptime: No client uptime information found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
673  
674 0 ▶ confess "Cannot set client uptime setting for client [$client]: Expecting a hash ref (instead of [$value])."
Branch: 1 branch
BranchTrueFalseTotal
unless ref $value eq "HASH" 0 0 0
675 unless ref($value) eq 'HASH';
676  
677 confess "Cannot set client uptime setting for client [$client]: The hash ref is missing important keys."
678 0 ▶ unless exists($value->{'name'}) && exists($value->{'value'}) && exists($value->{'status'});
Branch: 1 branch
BranchTrueFalseTotal
unless exists $value->{"name"} and exists $value->{"value"} and exists $value->{"status"} 0 0 0
Condition0%0/6
exists $value->{"name"} and exists $value->{"value"} and exists $value->{"status"}
!ll&&!rl&&r
000
exists $value->{"name"} and exists $value->{"value"}
!ll&&!rl&&r
000
MC/DC0%0/3
exists $value->{"name"} and exists $value->{"value"} and exists $value->{"status"}
exists $value->{"name"} exists $value->{"value"} exists $value->{"status"}
Truth table0%0/4
A and B and C
A= exists $value->{"name"}B= exists $value->{"value"}C= exists $value->{"status"}
ABCresult
0XX0
10X0
1100
1111
679  
680 0 push @ { $self->{"__CLIENTUPTIME"}->{$client} }, $value;
681  
682 0 return 1;
683  
684 } # end sub addClientUptime
685  
686 0 ▶sub getClientUptimeList {
Subroutine getClientUptimeList: not called CC=4 SCAR=30.0
Pod undocumented
687  
688 0 my $self = shift;
689  
690 confess "Cannot get client uptime settings list: No client uptime information has been set."
691 0 ▶ unless exists $self->{"__CLIENTUPTIME"};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CLIENTUPTIME"} 0 0 0
692  
693 0 my @clientuptimes;
694  
695 0 for my $client (keys % { $self->{"__CLIENTUPTIME"} }) {
696 0 push @clientuptimes, @ { $self->{"__CLIENTUPTIME"}->{$client} };
697 }
698  
699 0 ▶ return wantarray ? @clientuptimes : [@clientuptimes];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
700  
701 } # end sub getClientUptimeList
702  
703 0 ▶sub getClientUptimes {
Subroutine getClientUptimes: not called CC=6 SCAR=37.4
Pod undocumented
704  
705 0 my $self = shift;
706 0 ▶ my $client = shift || confess "Cannot get client uptime settings: No client identifier found";
Condition0%0/2
shift() || confess('Cannot get client uptime settings: No client identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot get client uptime settings: No client identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
707  
708 $self->logger()->log("Cannot get uptime information for the client [$client]: No information has been set.")
709 and return
710 0 ▶ unless exists $self->{"__CLIENTUPTIME"} && exists $self->{"__CLIENTUPTIME"}->{$client};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CLIENTUPTIME"} and exists $self->{"__CLIENTUPTIME"}{$client} 0 0 0
Condition0%0/8
exists $self->{'__CLIENTUPTIME'} && exists $self->{'__CLIENTUPTIME'}{$client} || $self->logger->log("Cannot get uptime information for the client [$client]: No information has been set.") && (return)
l!l&&r!l&&!r
000
exists $self->{"__CLIENTUPTIME"} and exists $self->{"__CLIENTUPTIME"}{$client}
!ll&&!rl&&r
000
$self->logger->log("Cannot get uptime information for the client [$client]: No information has been set.") and return
!ll
00
MC/DC0%0/3
exists $self->{'__CLIENTUPTIME'} && exists $self->{'__CLIENTUPTIME'}{$client} || $self->logger->log("Cannot get uptime information for the client [$client]: No information has been set.") && (return)
exists $self->{"__CLIENTUPTIME"} exists $self->{"__CLIENTUPTIME"}{$client} $self->logger->log("Cannot get uptime information for the client [$client]: No information has been set.")
Truth table0%0/5
A and B || C
A= exists $self->{"__CLIENTUPTIME"}B= exists $self->{"__CLIENTUPTIME"}{$client}C= $self->logger->log("Cannot get uptime information for the client [$client]: No information has been set.")
ABCresult
11X1
0X11
1011
0X00
1000
711  
712 0 ▶ return wantarray ? @{$self->{"__CLIENTUPTIME"}->{$client}} : $self->{"__CLIENTUPTIME"}->{$client};
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
713  
714 } # end sub getClientUptimes
715  
716 0 ▶sub addClientProc {
Subroutine addClientProc: not called CC=7 SCAR=40.3
Pod undocumented
717  
718 0 my $self = shift;
719 0 ▶ my $client = shift || confess "Cannot add client proc: No client identifier found";
Condition0%0/2
shift() || confess('Cannot add client proc: No client identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot add client proc: No client identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
720 0 ▶ my $value = shift || confess "Cannot add client proc: No client proc information found";
Condition0%0/2
shift() || confess('Cannot add client proc: No client proc information found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot add client proc: No client proc information found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
721  
722 0 ▶ confess "Cannot set client proc setting for client [$client]: Expecting a hash ref (instead of [$value])."
Branch: 1 branch
BranchTrueFalseTotal
unless ref $value eq "HASH" 0 0 0
723 unless ref($value) eq 'HASH';
724  
725 confess "Cannot set client proc setting for client [$client]: The hash ref is missing important keys."
726 0 ▶ unless exists($value->{'name'}) && exists($value->{'value'}) && exists($value->{'status'});
Branch: 1 branch
BranchTrueFalseTotal
unless exists $value->{"name"} and exists $value->{"value"} and exists $value->{"status"} 0 0 0
Condition0%0/6
exists $value->{"name"} and exists $value->{"value"} and exists $value->{"status"}
!ll&&!rl&&r
000
exists $value->{"name"} and exists $value->{"value"}
!ll&&!rl&&r
000
MC/DC0%0/3
exists $value->{"name"} and exists $value->{"value"} and exists $value->{"status"}
exists $value->{"name"} exists $value->{"value"} exists $value->{"status"}
Truth table0%0/4
A and B and C
A= exists $value->{"name"}B= exists $value->{"value"}C= exists $value->{"status"}
ABCresult
0XX0
10X0
1100
1111
727  
728 0 push @ { $self->{"__CLIENTPROC"}->{$client} }, $value;
729  
730 0 return 1;
731  
732 } # end sub addClientProc
733  
734 0 ▶sub getClientProcList {
Subroutine getClientProcList: not called CC=4 SCAR=30.0
Pod undocumented
735  
736 0 my $self = shift;
737  
738 confess "Cannot get client proc settings list: No client proc information has been set."
739 0 ▶ unless exists $self->{"__CLIENTPROC"};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CLIENTPROC"} 0 0 0
740  
741 0 my @clientprocs;
742  
743 0 for my $client (keys % { $self->{"__CLIENTPROC"} }) {
744 0 push @clientprocs, @ { $self->{"__CLIENTPROC"}->{$client} };
745 }
746  
747 0 ▶ return wantarray ? @clientprocs : [@clientprocs];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
748  
749 } # end sub getClientProcList
750  
751 0 ▶sub getClientProcs {
Subroutine getClientProcs: not called CC=6 SCAR=37.4
Pod undocumented
752  
753 0 my $self = shift;
754 0 ▶ my $client = shift || confess "Cannot get client proc settings: No client identifier found";
Condition0%0/2
shift() || confess('Cannot get client proc settings: No client identifier found')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot get client proc settings: No client identifier found')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
755  
756 $self->logger()->log("Cannot get proc information for the client [$client]: No information has been set.")
757 and return
758 0 ▶ unless exists $self->{"__CLIENTPROC"} && exists $self->{"__CLIENTPROC"}->{$client};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__CLIENTPROC"} and exists $self->{"__CLIENTPROC"}{$client} 0 0 0
Condition0%0/8
exists $self->{'__CLIENTPROC'} && exists $self->{'__CLIENTPROC'}{$client} || $self->logger->log("Cannot get proc information for the client [$client]: No information has been set.") && (return)
l!l&&r!l&&!r
000
exists $self->{"__CLIENTPROC"} and exists $self->{"__CLIENTPROC"}{$client}
!ll&&!rl&&r
000
$self->logger->log("Cannot get proc information for the client [$client]: No information has been set.") and return
!ll
00
MC/DC0%0/3
exists $self->{'__CLIENTPROC'} && exists $self->{'__CLIENTPROC'}{$client} || $self->logger->log("Cannot get proc information for the client [$client]: No information has been set.") && (return)
exists $self->{"__CLIENTPROC"} exists $self->{"__CLIENTPROC"}{$client} $self->logger->log("Cannot get proc information for the client [$client]: No information has been set.")
Truth table0%0/5
A and B || C
A= exists $self->{"__CLIENTPROC"}B= exists $self->{"__CLIENTPROC"}{$client}C= $self->logger->log("Cannot get proc information for the client [$client]: No information has been set.")
ABCresult
11X1
0X11
1011
0X00
1000
759  
760 0 ▶ return wantarray ? @{$self->{"__CLIENTPROC"}->{$client}} : $self->{"__CLIENTPROC"}->{$client};
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
761  
762 } # end sub getClientProcs
763  
764 46 ▶sub setOption {
Subroutine setOption: called CC=8 SCAR=29.9
Pod undocumented
765  
766 46 my $self = shift;
767  
768 # The following bit of logic is a bit of a kludge. If you're
769 # wondering why it was done, please contact the author :-)
770  
771 46 ▶ if (@_ == 2) {
Branch: 2 branches
BranchTrueFalseTotal
if (@_ == 2) { } 46 0 46
elsif (@_ == 3) { } 0 0 0
772  
773 46 ▶ my $client = $self->client() || confess "Cannot set client option: Client not specified.";
Condition50%1/2
$self->client || confess('Cannot set client option: Client not specified.')
l!l
460
MC/DC0%0/1
$self->client || confess('Cannot set client option: Client not specified.')
$self->client
Truth table50%1/2
A
A= $self->client
Aresult
11
00
774 46 ▶ my $name = $client->name() || confess "Cannot set client option: Client name not specified.";
Condition50%1/2
$client->name || confess('Cannot set client option: Client name not specified.')
l!l
460
MC/DC0%0/1
$client->name || confess('Cannot set client option: Client name not specified.')
$client->name
Truth table50%1/2
A
A= $client->name
Aresult
11
00
775 46 ▶ my $option = shift || confess "Cannot set client option: Option name not specified.";
Condition50%1/2
shift() || confess('Cannot set client option: Option name not specified.')
l!l
460
MC/DC0%0/1
shift() || confess('Cannot set client option: Option name not specified.')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
776 46 my $value = shift;
777 46 $self->{"__OPTIONS"}->{$name}->{$option} = $value;
778 46 return 1;
779  
780 } elsif (@_ == 3) {
781  
782 0 ▶ my $client = shift || confess "Cannot set client option: Client name not specified.";
Condition0%0/2
shift() || confess('Cannot set client option: Client name not specified.')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot set client option: Client name not specified.')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
783 0 ▶ my $option = shift || confess "Cannot set client option: Option name not specified.";
Condition0%0/2
shift() || confess('Cannot set client option: Option name not specified.')
l!l
00
MC/DC0%0/1
shift() || confess('Cannot set client option: Option name not specified.')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
784 0 my $value = shift;
785 0 $self->{"__OPTIONS"}->{$client}->{$option} = $value;
786 0 return 1;
787  
788 } else {
789  
790 0 confess "Cannot set client option: Wrong number of arguments to setOption method.";
791  
792 }
793  
794 } # end sub setOption
795  
796 75 ▶sub getOption {
Subroutine getOption: called CC=9 SCAR=24.1
Pod undocumented
797  
798 75 my $self = shift;
799 75 my $name;
800 my $option;
801 75 ▶ if (@_ == 1) {
Branch: 2 branches
BranchTrueFalseTotal
if (@_ == 1) { } 21 54 75
elsif (@_ == 2) { } 54 0 54
802 21 ▶ $option = shift || confess "Cannot get client option: Option name not specified.";
Condition50%1/2
shift() || confess('Cannot get client option: Option name not specified.')
l!l
210
MC/DC0%0/1
shift() || confess('Cannot get client option: Option name not specified.')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
803 21 ▶ my $client = $self->client() || confess "Cannot get client option: Client not specified.";;
Condition50%1/2
$self->client || confess('Cannot get client option: Client not specified.')
l!l
210
MC/DC0%0/1
$self->client || confess('Cannot get client option: Client not specified.')
$self->client
Truth table50%1/2
A
A= $self->client
Aresult
11
00
804 21 ▶ $name = $client->name() || confess "Cannot get client option: Client name not specified.";
Condition50%1/2
$client->name || confess('Cannot get client option: Client name not specified.')
l!l
210
MC/DC0%0/1
$client->name || confess('Cannot get client option: Client name not specified.')
$client->name
Truth table50%1/2
A
A= $client->name
Aresult
11
00
805 } elsif (@_ == 2) {
806 54 ▶ $name = shift || confess "Cannot get client option: Client name not specified.";
Condition50%1/2
shift() || confess('Cannot get client option: Client name not specified.')
l!l
540
MC/DC0%0/1
shift() || confess('Cannot get client option: Client name not specified.')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
807 54 ▶ $option = shift || confess "Cannot get client option: Option name not specified.";
Condition50%1/2
shift() || confess('Cannot get client option: Option name not specified.')
l!l
540
MC/DC0%0/1
shift() || confess('Cannot get client option: Option name not specified.')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
808 } else {
809 0 confess "Cannot get option [$option]: Incorrect number of arguments to the getOption method.";
810 }
811 # $self->logger()->debug(9,"Getting option [$option] for client [$name] ...");
812 75 ▶ confess "Cannot get option [$option]: The option value has not been set yet."
Branch: 1 branch
BranchTrueFalseTotal
unless $self->optionExists($name, $option) 0 75 75
813 unless $self->optionExists($name,$option);
814 75 return $self->{"__OPTIONS"}->{$name}->{$option};
815  
816 } # end sub getOption
817  
818 108 ▶sub optionExists {
Subroutine optionExists: called CC=10 SCAR=24.6
Pod undocumented
819  
820 # The following bit of logic is a bit of a kludge. If you're
821 # wondering why it was done, please contact the author :-)
822  
823 108 my $self = shift;
824  
825 108 my $option;
826 my $name;
827 108 ▶ if (@_ == 1) {
Branch: 2 branches
BranchTrueFalseTotal
if (@_ == 1) { } 30 78 108
elsif (@_ == 2) { } 78 0 78
828 30 ▶ $option = shift || confess "Cannot evaluate client option: Option name not specified.";
Condition50%1/2
shift() || confess('Cannot evaluate client option: Option name not specified.')
l!l
300
MC/DC0%0/1
shift() || confess('Cannot evaluate client option: Option name not specified.')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
829 30 ▶ my $client = $self->client() || confess "Cannot evaluate client option: Client not specified.";;
Condition50%1/2
$self->client || confess('Cannot evaluate client option: Client not specified.')
l!l
300
MC/DC0%0/1
$self->client || confess('Cannot evaluate client option: Client not specified.')
$self->client
Truth table50%1/2
A
A= $self->client
Aresult
11
00
830 30 ▶ $name = $client->name() || confess "Cannot evaluate client option: Client name not specified.";
Condition50%1/2
$client->name || confess('Cannot evaluate client option: Client name not specified.')
l!l
300
MC/DC0%0/1
$client->name || confess('Cannot evaluate client option: Client name not specified.')
$client->name
Truth table50%1/2
A
A= $client->name
Aresult
11
00
831 } elsif (@_ == 2) {
832 78 ▶ $name = shift || confess "Cannot evaluate client option: Client name not specified.";
Condition50%1/2
shift() || confess('Cannot evaluate client option: Client name not specified.')
l!l
780
MC/DC0%0/1
shift() || confess('Cannot evaluate client option: Client name not specified.')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
833 78 ▶ $option = shift || confess "Cannot evaluate client option: Option name not specified.";
Condition50%1/2
shift() || confess('Cannot evaluate client option: Option name not specified.')
l!l
780
MC/DC0%0/1
shift() || confess('Cannot evaluate client option: Option name not specified.')
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
834 } else {
835 0 confess "Cannot evaluate client option: Wrong number of arguments to optionExists method.";
836 }
837 # $self->logger()->debug(9,"Checking existence of option [$option] for client [$name] ....");
838 108 ▶ if (exists $self->{"__OPTIONS"}->{$name}
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'__OPTIONS'}{$name} and exists $self->{'__OPTIONS'}{$name}{$option}) { } 84 24 108
Condition66%2/3
exists $self->{"__OPTIONS"}{$name} and exists $self->{"__OPTIONS"}{$name}{$option}
!ll&&!rl&&r
02484
MC/DC50%1/2
exists $self->{"__OPTIONS"}{$name} and exists $self->{"__OPTIONS"}{$name}{$option}
exists $self->{"__OPTIONS"}{$name} exists $self->{"__OPTIONS"}{$name}{$option}
Truth table66%2/3
A and B
A= exists $self->{"__OPTIONS"}{$name}B= exists $self->{"__OPTIONS"}{$name}{$option}
ABresult
0X0
100
111
839 and exists $self->{"__OPTIONS"}->{$name}->{$option}) {
840 84 return 1;
841 } else {
842 24 return 0;
843 }
844  
845 } # end sub optionExists
846  
847 0 ▶sub getOptions {
Subroutine getOptions: not called CC=6 SCAR=37.4
Pod undocumented
848  
849 # returns the names of all of the currently set options
850 0 my $self = shift;
851 0 my $name;
852 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 0 0 0
853 0 $name = shift;
854 } else {
855 0 ▶ my $client = $self->client() || confess "Cannot get client options: Client not specified.";;
Condition0%0/2
$self->client || confess('Cannot get client options: Client not specified.')
l!l
00
MC/DC0%0/1
$self->client || confess('Cannot get client options: Client not specified.')
$self->client
Truth table0%0/2
A
A= $self->client
Aresult
11
00
856 0 ▶ $name = $client->name() || confess "Cannot get client options: Client name not specified.";
Condition0%0/2
$client->name || confess('Cannot get client options: Client name not specified.')
l!l
00
MC/DC0%0/1
$client->name || confess('Cannot get client options: Client name not specified.')
$client->name
Truth table0%0/2
A
A= $client->name
Aresult
11
00
857 }
858 0 ▶ return () unless exists $self->{"__OPTIONS"}->{$name};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"__OPTIONS"}{$name} 0 0 0
859 return wantarray
860 0 ? ( keys % { $self->{"__OPTIONS"}->{$name} } )
861 0 ▶ : [ keys % { $self->{"__OPTIONS"}->{$name} } ];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
862  
863 } # end sub getOptions
864  
865 3 ▶sub getOptionsHash {
Subroutine getOptionsHash: called CC=5 SCAR=19.6
Pod undocumented
866  
867 # returns the names of all of the currently set options
868 3 my $self = shift;
869 3 my %return;
870 my $name;
871 3 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 3 0 3
872 3 $name = shift;
873 } else {
874 0 ▶ my $client = $self->client() || confess "Cannot get options hash: Client not specified.";;
Condition0%0/2
$self->client || confess('Cannot get options hash: Client not specified.')
l!l
00
MC/DC0%0/1
$self->client || confess('Cannot get options hash: Client not specified.')
$self->client
Truth table0%0/2
A
A= $self->client
Aresult
11
00
875 0 ▶ $name = $client->name() || confess "Cannot get options hash: Client name not specified.";
Condition0%0/2
$client->name || confess('Cannot get options hash: Client name not specified.')
l!l
00
MC/DC0%0/1
$client->name || confess('Cannot get options hash: Client name not specified.')
$client->name
Truth table0%0/2
A
A= $client->name
Aresult
11
00
876 }
877 3 for my $option (keys % { $self->{"__OPTIONS"}->{$name} }) {
878 36 $return{$option} = $self->getOption($name,$option);
879 }
880 3 return %return;
881  
882 } # end sub getOptionHash
883  
884 11 1;
885  
886 __END__
« blib/lib/Net/Peep/Client/Pinger.pm ↑ Summary blib/lib/Net/Peep/Host.pm »