Client/Link.pm

filter: Statementstmt 39.2% 20 / 51 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 31.5% 6 / 19 Podpod 53.8% 7 / 13 totaltotal 37.9% 33 / 87 CC 3 SCAR 11.5
CC
3
Cov
36%
edit
12.0
reply
2.0
remove
2.0
CRAP 3.1
« Client/Comment.pm ↑ Summary Client/VotableThing.pm »
1 package Reddit::Client::Link;
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::VotableThing;
8 # is_original_content in base class
9 5 ▶use base qw/Reddit::Client::VotableThing/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use fields qw/
Subroutine BEGIN: called CC=1 SCAR=0.0
11 approved_at_utc
12 approved_by
13 archived
14 author
15 author_flair_background_color
16 author_flair_css_class
17 author_flair_richtext
18 author_flair_template_id
19 author_flair_text
20 author_flair_text_color
21 author_flair_type
22 author_fullname
23 author_patreon_flair
24 author_premium
25 awarders
26 banned_at_utc
27 banned_by
28 brand_safe
29 can_gild
30 can_mod_post
31 category
32 clicked
33 content_categories
34 contest_mode
35 created
36 created_utc
37 crosspost_parent
38 discussion_type
39 distinguished
40 domain
41 gallery_data
42 gilded
43 gildings
44 hidden
45 hide_score
46 is_crosspostable
47 is_gallery
48 is_meta
49 is_reddit_media_domain
50 is_robot_indexable
51 is_self
52 is_video
53 link_flair_background_color
54 link_flair_css_class
55 link_flair_richtext
56 link_flair_template_id
57 link_flair_text
58 link_flair_text_color
59 link_flair_type
60 locked
61 media
62 media_embed
63 media_metadata
64 mod_reports
65 morecomments
66 num_comments
67 num_reports
68 over_18
69 permalink
70 pwls
71 quarantine
72 removal_reason
73 removed
74 removed_by
75 removed_by_category
76 report_reasons
77 saved
78 secure_media
79 selftext
80 selftext_html
81 send_replies
82 spam
83 spoiler
84 sr_detail
85 steward_reports
86 stickied
87 subreddit
88 subreddit_id
89 subreddit_name_prefixed
90 subreddit_subscribers
91 subreddit_type
92 suggested_sort
93 thumbnail
94 thumbnail_height
95 thumbnail_width
96 title
97 total_awards_received
98 url
99 user_reports
100 view_count
101 visited
102 whitelist_status
103 wls
104 5 /;
105  
106 5 ▶use constant type => "t3";
Subroutine BEGIN: called CC=1 SCAR=0.0
107  
108 0 ▶sub reply {
Subroutine reply: not called CC=1 SCAR=6.9
Pod undocumented
109 0 my ($self, $text) = @_;
110 0 my $cmtid = $self->{session}->submit_comment(parent_id=>$self->{name}, text=>$text);
111 0 return $cmtid;
112 }
113 0 ▶sub remove {
Subroutine remove: not called CC=1 SCAR=6.9
Pod documented
114 0 my $self = shift;
115 0 return $self->{session}->remove($self->{name});
116 }
117 0 ▶sub spam {
Subroutine spam: not called CC=1 SCAR=6.9
Pod documented
118 0 my $self = shift;
119 0 return $self->{session}->spam($self->{name});
120 }
121 0 ▶sub approve {
Subroutine approve: not called CC=1 SCAR=6.9
Pod documented
122 0 my $self = shift;
123 0 return $self->{session}->approve($self->{name});
124 }
125 0 ▶sub ignore_reports {
Subroutine ignore_reports: not called CC=1 SCAR=6.9
Pod documented
126 0 my $self = shift;
127 0 return $self->{session}->ignore_reports($self->{name});
128 }
129 0 ▶sub edit {
Subroutine edit: not called CC=3 SCAR=24.8
Pod undocumented
130 0 my ($self, $text) = @_;
131 0 ▶ croak 'This is not a self post' unless $self->{is_self};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"is_self"} 0 0 0
132 0 my $post = $self->{session}->edit($self->{name}, $text);
133 0 ▶ $self->{selftext} = $text if $post;
Branch: 1 branch
BranchTrueFalseTotal
if $post 0 0 0
134 0 return $post;
135 }
136 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
Pod undocumented
137 0 my $self = shift;
138 0 my $cmtid = $self->{session}->delete($self->{name});
139 0 return $cmtid;
140 }
141  
142 0 ▶sub hide {
Subroutine hide: not called CC=1 SCAR=6.9
Pod documented
143 0 my $self = shift;
144 0 $self->{session}->hide($self->{name});
145 }
146  
147 0 ▶sub unhide {
Subroutine unhide: not called CC=1 SCAR=6.9
Pod documented
148 0 my $self = shift;
149 0 $self->{session}->unhide($self->{name});
150 }
151  
152 0 ▶sub get_permalink { # deprecated
Subroutine get_permalink: not called CC=1 SCAR=6.9
Pod undocumented
153 0 my $self = shift;
154 0 return $self->{session}->get_origin().$self->{permalink};
155 }
156 0 ▶sub get_web_url {
Subroutine get_web_url: not called CC=1 SCAR=6.9
Pod undocumented
157 0 my $self = shift;
158 0 return $self->{session}->get_origin().$self->{permalink};
159 }
160  
161 0 ▶sub comments { # deprecated. Only existed briefly.
Subroutine comments: not called CC=1 SCAR=6.9
Pod undocumented
162 0 my $self = shift;
163 0 return $self->get_comments();
164 }
165 0 ▶sub get_comments {
Subroutine get_comments: not called CC=1 SCAR=6.9
Pod documented
166 0 my $self = shift;
167 0 return $self->{session}->get_comments(permalink=>$self->{permalink});
168 }
169  
170 5 1;
171  
172 __END__
« Client/Comment.pm ↑ Summary Client/VotableThing.pm »