Achievements/Achievement/WeekendWarrior.pm

filter: Statementstmt 75.0% 21 / 28 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 6 / 7 Podpod n/a totaltotal 61.3% 27 / 44 CC 4 SCAR 21.5
CC
4
Cov
60%
scan
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 8.6
↑ Summary Achievements.pm »
1 package Perl::Achievements::Achievement::WeekendWarrior;
2 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 $Perl::Achievements::Achievement::WeekendWarrior::AUTHORITY = 'cpan:YANICK';
4 }
5 {
6 1 $Perl::Achievements::Achievement::WeekendWarrior::VERSION = '0.4.0';
7 }
8 # ABSTRACT: code over the week-end
9  
10 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use MooseX::SemiAffordanceAccessor;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 ▶no warnings qw/ uninitialized /;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 with 'Perl::Achievements::Achievement';
19  
20 1 has days => (
21 traits => [ qw/ Counter Perl::Achievements::Role::ConfigItem / ],
22 isa => 'Num',
23 is => 'rw',
24 default => 0,
25 handles => {
26 inc_days => 'inc',
27 },
28 );
29  
30 0 ▶sub scan {
Subroutine scan: not called CC=4 SCAR=30.0
31 0 my $self = shift;
32  
33 0 my $wday = (localtime)[6];
34  
35 0 ▶ return unless $wday == 0 or $wday == 6;
Branch: 1 branch
BranchTrueFalseTotal
unless $wday == 0 or $wday == 6 0 0 0
Condition0%0/3
$wday == 0 or $wday == 6
l!l&&r!l&&!r
000
MC/DC0%0/2
$wday == 0 or $wday == 6
$wday == 0 $wday == 6
Truth table0%0/3
A or B
A= $wday == 0B= $wday == 6
ABresult
1X1
011
000
36  
37 0 $self->inc_days;
38  
39 0 ▶ return unless $self->days >= 2**$self->level;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->days >= 2 ** $self->level 0 0 0
40  
41 0 $self->inc_level;
42 0 $self->unlock(
43 sprintf "Was at the computer %d days during week-ends", $self->days
44 );
45 }
46  
47 1 1;
48  
49 __END__
↑ Summary Achievements.pm »