blib/lib/Bootylicious/Comment.pm

filter: Statementstmt 86.1% 31 / 36 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 84.6% 11 / 13 Podpod 14.2% 1 / 7 totaltotal 77.5% 45 / 58 CC 3 SCAR 4.3
CC
3
Cov
87%
new
3.0
url
2.0
article
2.0
CRAP 1.5
« blib/lib/Bootylicious/PingbackIterator.pm ↑ Summary blib/lib/Bootylicious/PingbackIteratorFinder.pm »
1 package Bootylicious::Comment;
2  
3 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 10 ▶use base 'Bootylicious::Document';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 10 ▶use Bootylicious::Article;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 10 ▶use Bootylicious::Timestamp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 10 ▶use File::stat;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub new {
13 30 ▶ my $self = shift->SUPER::new;
Subroutine new: called CC=3 SCAR=11.0
Pod documented
14 30 my %params = @_;
15  
16 30 foreach my $method (qw/author email url content/) {
17 120 ▶ $self->$method($params{$method}) if defined $params{$method};
Branch: 1 branch
BranchTrueFalseTotal
if defined $params{$method} 15 105 120
18 }
19  
20 30 return $self;
21 }
22  
23 sub created {
24 60 ▶ Bootylicious::Timestamp->new(epoch => stat(shift->path)->mtime);
Subroutine created: called CC=1 SCAR=0.0
Pod undocumented
25 }
26 5 ▶sub email { shift->metadata(email => @_) }
Subroutine email: called CC=1 SCAR=0.0
Pod undocumented
27 0 ▶sub url { shift->metadata(url =>) }
Subroutine url: not called CC=1 SCAR=6.9
Pod undocumented
28  
29 10 ▶sub content { shift->inner(content => @_) }
Subroutine content: called CC=1 SCAR=0.0
Pod undocumented
30  
31 sub number {
32 2 ▶ my $self = shift;
Subroutine number: called CC=1 SCAR=0.0
Pod undocumented
33  
34 2 my $path = $self->path;
35  
36 2 my ($number) = ($path =~ m/-(\d+)$/);
37  
38 2 return $number;
39 }
40  
41 sub article {
42 0 ▶ my $self = shift;
Subroutine article: not called CC=1 SCAR=6.9
Pod undocumented
43  
44 0 my $path = $self->path;
45 0 $path =~ s/\.comment-(\d+)$//;
46  
47 0 return Bootylicious::Article->new(path => $path);
48 }
49  
50 10 1;
« blib/lib/Bootylicious/PingbackIterator.pm ↑ Summary blib/lib/Bootylicious/PingbackIteratorFinder.pm »