Posterous/Object.pm

filter: Statementstmt 36.3% 4 / 11 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 1 / 3 Podpod 100% 1 / 1 totaltotal 27.2% 6 / 22 CC 3 SCAR 20.5
CC
3
Cov
25%
_handle_datetime
12.0
new
2.0
BEGIN
1.0
CRAP 7.8
« Posterous/Post.pm ↑ Summary Posterous/Media/Local.pm »
1 package Net::Posterous::Object;
2  
3 2 ▶use Class::Accessor "antlers";
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 =head1 NAME
6  
7 Net::Posterous::Object - base class for Net::Posterous objects
8  
9 =head1 METHODS
10  
11 =cut
12  
13 =head2 new
14  
15 Basic constructor.
16  
17 =cut
18 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
19 0 my $class = shift;
20 0 my %opts = @_;
21 0 return bless \%opts, $class;
22 }
23  
24 0 ▶sub _handle_datetime {
Subroutine _handle_datetime: not called CC=3 SCAR=24.8
25 0 my $self = shift;
26 # Make sure date is in RFC822 format e.g Sun, 03 May 2009 19:58:58 -0700
27 0 ▶ $self->{_strp} ||= DateTime::Format::Strptime->new( pattern => "%a, %d %b %Y %H:%M:%S %z");
Condition0%0/3
$self->{"_strp"} ||= "DateTime::Format::Strptime"->new("pattern", "%a, %d %b %Y %H:%M:%S %z")
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"_strp"} ||= "DateTime::Format::Strptime"->new("pattern", "%a, %d %b %Y %H:%M:%S %z")
$self->{"_strp"} "DateTime::Format::Strptime"->new("pattern", "%a, %d %b %Y %H:%M:%S %z")
Truth table0%0/3
A ||= B
A= $self->{"_strp"}B= "DateTime::Format::Strptime"->new("pattern", "%a, %d %b %Y %H:%M:%S %z")
ABresult
1X1
011
000
28  
29 0 ▶ $self->date($self->{_strp}->format_datetime(shift)) if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
30 0 return $self->{_strp}->parse_datetime($self->date);
31
32 }
33  
34 2 1;
« Posterous/Post.pm ↑ Summary Posterous/Media/Local.pm »