blib/lib/Net/Peep/Client/Sysmonitor/Uptime.pm

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