Insight/Device.pm

filter: Statementstmt 85.1% 23 / 27 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 81.0% 30 / 37 CC 2 SCAR 3.7
CC
2
Cov
83%
__ANON__
2.1
get_all_mib_roles
2.0
BEGIN
1.0
CRAP 1.4
« Insight/Utils.pm ↑ Summary Insight/MIB/HostResources.pm »
1 package SNMP::Insight::Device;
2  
3 #ABSTRACT: Base class for devices
4 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '0.002'; #TRIAL VERSION:
8 3 ▶use SNMP::Insight::Session;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use SNMP::Insight::MIB::Utils qw(sysObjectID2vendor);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 has 'session' => (
12 isa => 'SNMP::Insight::Session',
13 is => 'ro',
14 );
15  
16 3 has model => (
17 is => 'ro',
18 isa => 'Str'
19 );
20  
21 3 has os => (
22 is => 'ro',
23 isa => 'Str'
24 );
25  
26 3 has os_ver => (
27 is => 'ro',
28 isa => 'Str'
29 );
30  
31 has vendor => (
32 is => 'ro',
33 isa => 'Str',
34 3 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.2
35 3 my $self = shift;
36 3 ▶ return sysObjectID2vendor( $self->sysObjectID ) || "";
Condition50%1/2
sysObjectID2vendor($self->sysObjectID) || ''
l!l
30
MC/DC0%0/1
sysObjectID2vendor($self->sysObjectID) || ''
sysObjectID2vendor($self->sysObjectID)
Truth table50%1/2
A
A= sysObjectID2vendor($self->sysObjectID)
Aresult
11
00
37 }
38 3 );
39  
40 0 ▶sub get_all_mib_roles {
Subroutine get_all_mib_roles: not called CC=1 SCAR=6.9
Pod documented
41 0 my $self = shift;
42  
43 0 my @roles = grep { $_->can('mib_name') }
44 $self->meta->calculate_all_roles_with_inheritance;
45  
46 0 return @roles;
47 }
48  
49 3 with 'SNMP::Insight::MIB::SNMPv2';
50  
51 3 __PACKAGE__->meta->make_immutable;
52 3 1;
53  
54 # Local Variables:
55 # mode: cperl
56 # indent-tabs-mode: nil
57 # cperl-indent-level: 4
58 # cperl-indent-parens-as-block: t
59 # End:
60  
61 __END__
« Insight/Utils.pm ↑ Summary Insight/MIB/HostResources.pm »