Plugin/ExitResult.pm

filter: Statementstmt 92.3% 12 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 4 totaltotal 75.0% 18 / 24 CC 1 SCAR 1.3
CC
1
Cov
92%
code
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Plugin/Performance.pm ↑ Summary
1 # Tiny helper class to return both output and return_code when testing
2
3 package Nagios::Monitoring::Plugin::ExitResult;
4
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 # Stringify to message
8 3 ▶use overload '""' => sub { shift->{message} };
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
9
10 # Constructor
11 89 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
12 89 my $class = shift;
13 89 return bless { return_code => $_[0], message => $_[1] }, $class;
14 }
15
16 # Accessors
17 83 ▶sub message { shift->{message} }
Subroutine message: called CC=1 SCAR=0.0
Pod undocumented
18 76 ▶sub return_code { shift->{return_code} }
Subroutine return_code: called CC=1 SCAR=0.0
Pod undocumented
19 0 ▶sub code { shift->{return_code} }
Subroutine code: not called CC=1 SCAR=6.9
Pod undocumented
20
21 3 1;
22
23 __END__
« Plugin/Performance.pm ↑ Summary