blib/lib/Bootylicious/ArticleArchiveMonthly.pm

filter: Statementstmt 96.3% 26 / 27 Branchbran 100% 4 / 4 Conditioncond 66.6% 4 / 6 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 3 totaltotal 82.6% 43 / 52 CC 5 SCAR 10.2
CC
5
Cov
92%
__ANON__
5.0
is_yearly
2.0
build
1.0
CRAP 2.8
« blib/lib/Bootylicious/Page.pm ↑ Summary blib/lib/Bootylicious/Plugin/GoogleAnalytics.pm »
1 package Bootylicious::ArticleArchiveMonthly;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use base 'Bootylicious::ArticleArchiveBase';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Bootylicious::IteratorSearchable;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 __PACKAGE__->attr('month');
11 2 __PACKAGE__->attr('iterator');
12  
13 sub build {
14 1 ▶ my $self = shift;
Subroutine build: called CC=1 SCAR=0.0
Pod undocumented
15  
16 my $iterator = Bootylicious::IteratorSearchable->new($self->articles)->find_all(
17 sub {
18 3 ▶ my ($iterator, $article) = @_;
Subroutine __ANON__: called CC=5 SCAR=16.2
19  
20 3 my $year = $article->created->year;
21 3 my $month = $article->created->month;
22  
23 3 ▶ return if $self->year && $self->year != $year;
Branch: 1 branch
BranchTrueFalseTotal
if $self->year and $self->year != $year 1 2 3
Condition66%2/3
$self->year and $self->year != $year
!ll&&!rl&&r
021
MC/DC50%1/2
$self->year and $self->year != $year
$self->year $self->year != $year
Truth table66%2/3
A and B
A= $self->yearB= $self->year != $year
ABresult
0X0
100
111
24 2 ▶ return if $self->month && $self->month != $month;
Branch: 1 branch
BranchTrueFalseTotal
if $self->month and $self->month != $month 1 1 2
Condition66%2/3
$self->month and $self->month != $month
!ll&&!rl&&r
011
MC/DC50%1/2
$self->month and $self->month != $month
$self->month $self->month != $month
Truth table66%2/3
A and B
A= $self->monthB= $self->month != $month
ABresult
0X0
100
111
25  
26 1 return $article;
27 }
28 1 );
29  
30 1 $self->articles($iterator);
31  
32 1 return $self;
33 }
34  
35 1 ▶sub is_monthly {1}
Subroutine is_monthly: called CC=1 SCAR=0.0
Pod undocumented
36 0 ▶sub is_yearly {0}
Subroutine is_yearly: not called CC=1 SCAR=6.9
Pod undocumented
37  
38 2 1;
« blib/lib/Bootylicious/Page.pm ↑ Summary blib/lib/Bootylicious/Plugin/GoogleAnalytics.pm »