blib/lib/Zabbix2/API/Trigger.pm

filter: Statementstmt 62.8% 22 / 35 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 58.3% 7 / 12 Podpod 100% 2 / 2 totaltotal 58.4% 31 / 53 CC 3 SCAR 9.7
CC
3
Cov
56%
id
6.0
_prefix
6.0
_readonly_properties
2.0
CRAP 2.6
« blib/lib/Zabbix2/API/Host.pm ↑ Summary blib/lib/Zabbix2/API/GraphItem.pm »
1 package Zabbix2::API::Trigger;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use autodie;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use Moo::Lax;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 extends qw/Zabbix2::API::CRUDE/;
12  
13 sub _readonly_properties {
14 return {
15 0 ▶ triggerid => 1,
Subroutine _readonly_properties: not called CC=1 SCAR=6.9
16 error => 1,
17 flags => 1,
18 lastchange => 1,
19 state => 1,
20 templateid => 1,
21 value => 1,
22 };
23 }
24  
25 sub id {
26 ## mutator for id
27 0 ▶ my ($self, $value) = @_;
Subroutine id: not called CC=2 SCAR=17.9
Pod documented
28 0 ▶ if (defined $value) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 0 0 0
29 0 $self->data->{triggerid} = $value;
30 0 return $self->data->{triggerid};
31 } else {
32 0 return $self->data->{triggerid};
33 }
34 }
35  
36 sub _prefix {
37 0 ▶ my (undef, $suffix) = @_;
Subroutine _prefix: not called CC=2 SCAR=17.9
38 0 ▶ if ($suffix) {
Branch: 1 branch
BranchTrueFalseTotal
if ($suffix) { } 0 0 0
39 0 return 'trigger'.$suffix;
40 } else {
41 0 return 'trigger';
42 }
43 }
44  
45 sub _extension {
46 0 ▶ return (output => 'extend',
Subroutine _extension: not called CC=1 SCAR=6.9
47 selectHosts => ['hostid'],
48 selectItems => ['itemid'],
49 selectFunctions => 'extend',
50 selectDependencies => ['triggerid']);
51 }
52  
53 sub name {
54 0 ▶ my $self = shift;
Subroutine name: not called CC=1 SCAR=6.9
Pod documented
55 # can't think of a good name for triggers -- descriptions are too long
56 0 return $self->data->{description};
57 }
58  
59 2 1;
60 __END__
« blib/lib/Zabbix2/API/Host.pm ↑ Summary blib/lib/Zabbix2/API/GraphItem.pm »