Client/MoreComments.pm

filter: Statementstmt 71.4% 20 / 28 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 1 totaltotal 50.9% 26 / 51 CC 7 SCAR 34.2
CC
7
Cov
49%
get_collapsed_comments
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 30.6
« Client.pm ↑ Summary Client/Request.pm »
1 package Reddit::Client::MoreComments;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 require Reddit::Client::Thing;
8  
9 5 ▶use base qw/Reddit::Client::Thing/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use fields qw/
Subroutine BEGIN: called CC=1 SCAR=0.0
11 children count depth parent_id link_id
12 5 /;
13  
14 5 ▶use constant type => "more";
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 0 ▶sub get_collapsed_comments {
Subroutine get_collapsed_comments: not called CC=7 SCAR=40.3
Pod undocumented
17 0 my ($this, %param) = @_;
18 0 ▶ my $linkid = $this->{link_id} || $param{link_id} || undef;
Condition0%0/5
$this->{'link_id'} || $param{'link_id'} || undef
l!l
00
$this->{"link_id"} or $param{"link_id"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$this->{'link_id'} || $param{'link_id'} || undef
$this->{"link_id"} $param{"link_id"}
Truth table0%0/3
A or B
A= $this->{"link_id"}B= $param{"link_id"}
ABresult
1X1
011
000
19 0 ▶ print "MoreComments::get_collapsed_comments: link_id is required. Normally this should populate on its own. It being undefined could be the sign of an issue elsewhere. You can set it manually by passing in a link_id." unless $linkid;
Branch: 1 branch
BranchTrueFalseTotal
unless $linkid 0 0 0
20 0 ▶ return unless $linkid;
Branch: 1 branch
BranchTrueFalseTotal
unless $linkid 0 0 0
21  
22 my %data = (
23 link_id => $linkid,
24 children=> $this->{children},
25 0 );
26 0 ▶ $data{sort} = $param{sort} if $param{sort};
Branch: 1 branch
BranchTrueFalseTotal
if $param{"sort"} 0 0 0
27 0 ▶ $data{id} = $param{id} if $param{id};
Branch: 1 branch
BranchTrueFalseTotal
if $param{"id"} 0 0 0
28  
29 0 return $this->{session}->get_collapsed_comments( %data );
30 }
31  
32 5 1;
33  
34 __END__
« Client.pm ↑ Summary Client/Request.pm »