lib/App/MadEye/Plugin/Agent/SSLExpireDate.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 35 CC 2 SCAR 12.0
CC
2
Cov
0%
is_dead
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.3
1 package App::MadEye::Plugin::Agent::SSLExpireDate;
2 use strict;
3 use warnings;
4 use App::MadEye::Plugin::Agent::Base;
5 use Net::SSL::ExpireDate;
6  
7 sub is_dead {
8 my ($self, $target) = @_;
9  
10 my $conf = $self->config->{config};
11 my $type = $conf->{type} or die "missing type";
12 my $duration = $conf->{duration} or die "missing duration";
13  
14 my $ed = Net::SSL::ExpireDate->new( $type, $target );
15  
16 if ($ed->is_expired($duration)) {
17 return "$target will expire at " . $ed->expire_date->ymd;
18 } else {
19 return; # ok.
20 }
21 }
22  
23 1;
24 __END__