blib/lib/UID2/Client/Key.pm

filter: Statementstmt 100% 16 / 16 Branchbran 100% 2 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 86.2% 25 / 29 SCAR 11.0
CC
3
Cov
95%
is_active
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/UID2/Client/KeyContainer.pm ↑ Summary Build »
1 package UID2::Client::Key;
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 use Class::Accessor::Lite (
6 4 new => 1,
7 ro => [qw(id site_id created activates expires secret)],
8 4 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶use UID2::Client::Timestamp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub is_active {
12 35 ▶ my ($self, $now) = @_;
Subroutine is_active: called CC=3 SCAR=11.0
Pod undocumented
13 35 ▶ $now //= UID2::Client::Timestamp->now;
Condition66%2/3
$now //= "UID2::Client::Timestamp"->now
l!l&&r!l&&!r
2870
MC/DC0%0/2
$now //= "UID2::Client::Timestamp"->now
$now "UID2::Client::Timestamp"->now
Truth table66%2/3
A //= B
A= $nowB= "UID2::Client::Timestamp"->now
ABresult
1X1
011
000
14 35 ▶ $self->activates <= $now->get_epoch_second && $now->get_epoch_second < $self->expires;
Branch: 1 branch
BranchTrueFalseTotal
$self->activates <= $now->get_epoch_second and $now->get_epoch_second < $self->expires 33 2 35
15 }
16  
17 4 1;
18 __END__
« blib/lib/UID2/Client/KeyContainer.pm ↑ Summary Build »