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 CC 3 SCAR 6.2
CC
3
Cov
95%
is_active
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« Client/KeyContainer.pm ↑ Summary Client/AdvertisingTokenVersion.pm »
1 package UID2::Client::Key;
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 5 ▶use Class::Accessor::Lite (
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 new => 1,
7 ro => [qw(id site_id created activates expires secret)],
8 5 );
9 5 ▶use UID2::Client::Timestamp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 61 ▶sub is_active {
Subroutine is_active: called CC=3 SCAR=11.0
Pod undocumented
12 61 my ($self, $now) = @_;
13 61 ▶ $now //= UID2::Client::Timestamp->now;
Condition66%2/3
$now //= "UID2::Client::Timestamp"->now
l!l&&r!l&&!r
5470
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 61 ▶ $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 57 4 61
15 }
16  
17 5 1;
18 __END__
« Client/KeyContainer.pm ↑ Summary Client/AdvertisingTokenVersion.pm »