LiveJournal/Entry.pm

filter: Statementstmt 26.3% 10 / 38 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 15 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 17.6% 3 / 17 Podpod 0.0% 0 / 14 totaltotal 13.8% 13 / 94 CC 8 SCAR 32.3
CC
8
Cov
18%
new
72.0
year
2.0
month
2.0
CRAP 25.2
↑ Summary LiveJournal.pm »
1 package Net::LiveJournal::Entry;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶sub new {
Subroutine new: not called CC=8 SCAR=42.8
Pod undocumented
7 0 my ($class, %opts) = @_;
8 0 my $self = bless {}, $class;
9  
10 0 ▶ $self->{body} = delete $opts{body} || delete $opts{event};
Condition0%0/3
delete $opts{'body'} || delete $opts{'event'}
l!l&&r!l&&!r
000
MC/DC0%0/2
delete $opts{'body'} || delete $opts{'event'}
delete $opts{'body'} delete $opts{'event'}
Truth table0%0/3
A || B
A= delete $opts{'body'}B= delete $opts{'event'}
ABresult
1X1
011
000
11 0 ▶ $self->{subject} = delete $opts{subject} || "";
Condition0%0/2
delete $opts{'subject'} || ''
l!l
00
MC/DC0%0/1
delete $opts{'subject'} || ''
delete $opts{'subject'}
Truth table0%0/2
A
A= delete $opts{'subject'}
Aresult
11
00
12 0 ▶ $self->{security} = delete $opts{security} || "public";
Condition0%0/2
delete $opts{'security'} || 'public'
l!l
00
MC/DC0%0/1
delete $opts{'security'} || 'public'
delete $opts{'security'}
Truth table0%0/2
A
A= delete $opts{'security'}
Aresult
11
00
13 0 ▶ $self->{allowmask} = delete $opts{allowmask} || 0;
Condition0%0/2
delete $opts{'allowmask'} || 0
l!l
00
MC/DC0%0/1
delete $opts{'allowmask'} || 0
delete $opts{'allowmask'}
Truth table0%0/2
A
A= delete $opts{'allowmask'}
Aresult
11
00
14 0 ▶ $self->{usejournal} = delete $opts{usejournal} || delete $opts{community} || delete $opts{journal};
Condition0%0/6
delete $opts{'usejournal'} || delete $opts{'community'} || delete $opts{'journal'}
l!l&&r!l&&!r
000
delete $opts{"usejournal"} or delete $opts{"community"}
l!l&&r!l&&!r
000
MC/DC0%0/3
delete $opts{'usejournal'} || delete $opts{'community'} || delete $opts{'journal'}
delete $opts{"usejournal"} delete $opts{"community"} delete $opts{'journal'}
Truth table0%0/4
A or B || C
A= delete $opts{"usejournal"}B= delete $opts{"community"}C= delete $opts{'journal'}
ABCresult
1XX1
01X1
0011
0000
15  
16 0 my @now = localtime();
17 0 $self->{year} = $now[5]+1900;
18 0 $self->{mon} = $now[4]+1;
19 0 $self->{day} = $now[3];
20 0 $self->{hour} = $now[2];
21 0 $self->{min} = $now[1];
22  
23 0 ▶ croak("Unknown options: " . join(", ", %opts)) if %opts;
Branch: 1 branch
BranchTrueFalseTotal
if %opts 0 0 0
24 0 return $self;
25 }
26  
27 0 ▶sub year { $_[0]{year} }
Subroutine year: not called CC=1 SCAR=6.9
Pod undocumented
28 0 ▶sub month { $_[0]{mon} }
Subroutine month: not called CC=1 SCAR=6.9
Pod undocumented
29 0 ▶sub mon { $_[0]{mon} }
Subroutine mon: not called CC=1 SCAR=6.9
Pod undocumented
30 0 ▶sub day { $_[0]{day} }
Subroutine day: not called CC=1 SCAR=6.9
Pod undocumented
31 0 ▶sub hour { $_[0]{hour} }
Subroutine hour: not called CC=1 SCAR=6.9
Pod undocumented
32 0 ▶sub min { $_[0]{min} }
Subroutine min: not called CC=1 SCAR=6.9
Pod undocumented
33 0 ▶sub minute { $_[0]{min} }
Subroutine minute: not called CC=1 SCAR=6.9
Pod undocumented
34  
35 0 ▶sub body { $_[0]{body} }
Subroutine body: not called CC=1 SCAR=6.9
Pod undocumented
36 0 ▶sub subject { $_[0]{subject} }
Subroutine subject: not called CC=1 SCAR=6.9
Pod undocumented
37 0 ▶sub allowmask { $_[0]{allowmask} }
Subroutine allowmask: not called CC=1 SCAR=6.9
Pod undocumented
38 0 ▶sub security { $_[0]{security} }
Subroutine security: not called CC=1 SCAR=6.9
Pod undocumented
39  
40 0 ▶sub usejournal { $_[0]{usejournal} }
Subroutine usejournal: not called CC=1 SCAR=6.9
Pod undocumented
41 0 ▶sub journal { $_[0]{usejournal} }
Subroutine journal: not called CC=1 SCAR=6.9
Pod undocumented
42  
43 1 1;
↑ Summary LiveJournal.pm »