blib/lib/Mail/LMLM/Types/Base.pm

filter: Statementstmt 13.6% 15 / 110 Branchbran 0.0% 0 / 30 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 16.6% 4 / 24 Podpod 100% 20 / 20 totaltotal 20.6% 39 / 189 SCAR 55.2
CC
18
Cov
10%
parse_args
110.0
render_field
30.0
render_online_archive
12.0
CRAP 250.4
↑ Summary blib/lib/Mail/LMLM/Render/HTML.pm »
1 package Mail::LMLM::Types::Base;
2 9 $Mail::LMLM::Types::Base::VERSION = '0.6806';
3 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 9 ▶use Mail::LMLM::Object;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 9 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 9 @ISA = qw(Mail::LMLM::Object);
11  
12 sub parse_args
13 {
14 0 ▶ my $self = shift;
Subroutine parse_args: not called CC=10 SCAR=47.0
Pod documented
15  
16 0 my $args = shift;
17  
18 0 my ( @left, $key, $value );
19  
20 0 ▶ while ( scalar(@$args) )
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @$args) 0 0 0
21 {
22 0 $key = shift(@$args);
23 0 $value = shift(@$args);
24 0 ▶ if ( $key =~ /^-?(id)$/ )
Branch: 8 branches
BranchTrueFalseTotal
if ($key =~ /^-?(id)$/) { } 0 0 0
elsif ($key =~ /^-?(group_base)$/) { } 0 0 0
elsif ($key =~ /^-?(desc|description)$/) { } 0 0 0
elsif ($key =~ /^-?(hostname|host)$/) { } 0 0 0
elsif ($key =~ /^-?(homepage)$/) { } 0 0 0
elsif ($key =~ /^-?(online_archive)$/) { } 0 0 0
elsif ($key =~ /^-?(guidelines)$/) { } 0 0 0
elsif ($key =~ /^-?(notes)$/) { } 0 0 0
25 {
26 0 $self->{'id'} = $value;
27 }
28 elsif ( $key =~ /^-?(group_base)$/ )
29 {
30 0 $self->{'group_base'} = $value;
31 }
32 elsif ( $key =~ /^-?(desc|description)$/ )
33 {
34 0 $self->{'description'} = $value;
35 }
36 elsif ( $key =~ /^-?(hostname|host)$/ )
37 {
38 0 $self->{'hostname'} = $value;
39 }
40 elsif ( $key =~ /^-?(homepage)$/ )
41 {
42 0 $self->{'homepage'} = $value;
43 }
44 elsif ( $key =~ /^-?(online_archive)$/ )
45 {
46 0 $self->{'online_archive'} = $value;
47 }
48 elsif ( $key =~ /^-?(guidelines)$/ )
49 {
50 0 $self->{'guidelines'} = $value;
51 }
52 elsif ( $key =~ /^-?(notes)$/ )
53 {
54 0 $self->{'notes'} = $value;
55 }
56 else
57 {
58 0 push @left, $key, $value;
59 }
60 }
61  
62 0 return ( \@left );
63 }
64  
65 sub initialize
66 {
67 0 ▶ my $self = shift;
Subroutine initialize: not called CC=1 SCAR=6.9
Pod documented
68  
69 0 $self->parse_args( [@_] );
70  
71 0 return 0;
72 }
73  
74 sub get_id
75 {
76 0 ▶ my $self = shift;
Subroutine get_id: not called CC=1 SCAR=6.9
Pod documented
77  
78 0 return $self->{'id'};
79 }
80  
81 sub get_description
82 {
83 0 ▶ my $self = shift;
Subroutine get_description: not called CC=1 SCAR=6.9
Pod documented
84  
85 0 return $self->{'description'};
86 }
87  
88 sub get_homepage
89 {
90 0 ▶ my $self = shift;
Subroutine get_homepage: not called CC=1 SCAR=6.9
Pod documented
91  
92 0 return $self->{'homepage'};
93 }
94  
95 sub get_group_base
96 {
97 0 ▶ my $self = shift;
Subroutine get_group_base: not called CC=1 SCAR=6.9
Pod documented
98  
99 0 return $self->{'group_base'};
100 }
101  
102 sub get_hostname
103 {
104 0 ▶ my $self = shift;
Subroutine get_hostname: not called CC=2 SCAR=17.9
Pod documented
105  
106 0 ▶ return $self->{'hostname'} || $self->get_default_hostname();
Condition0%0/3
$self->{'hostname'} || $self->get_default_hostname
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{'hostname'} || $self->get_default_hostname
$self->{'hostname'} $self->get_default_hostname
Truth table0%0/3
A || B
A= $self->{'hostname'}B= $self->get_default_hostname
ABresult
1X1
011
000
107 }
108  
109 sub get_online_archive
110 {
111 0 ▶ my $self = shift;
Subroutine get_online_archive: not called CC=1 SCAR=6.9
Pod documented
112  
113 0 return $self->{'online_archive'};
114 }
115  
116 sub get_guidelines
117 {
118 0 ▶ my $self = shift;
Subroutine get_guidelines: not called CC=1 SCAR=6.9
Pod documented
119  
120 0 return $self->{'guidelines'};
121 }
122  
123 sub render_subscribe
124 {
125 0 ▶ my $self = shift;
Subroutine render_subscribe: not called CC=1 SCAR=6.9
Pod documented
126  
127 0 my $htmler = shift;
128  
129 0 return 0;
130 }
131  
132 sub render_unsubscribe
133 {
134 0 ▶ my $self = shift;
Subroutine render_unsubscribe: not called CC=1 SCAR=6.9
Pod documented
135  
136 0 my $htmler = shift;
137  
138 0 return 0;
139 }
140  
141 sub render_post
142 {
143 0 ▶ my $self = shift;
Subroutine render_post: not called CC=1 SCAR=6.9
Pod documented
144  
145 0 my $htmler = shift;
146  
147 0 return 0;
148 }
149  
150 sub render_owner
151 {
152 0 ▶ my $self = shift;
Subroutine render_owner: not called CC=1 SCAR=6.9
Pod documented
153  
154 0 my $htmler = shift;
155  
156 0 return 0;
157 }
158  
159 sub render_none
160 {
161 0 ▶ my $self = shift;
Subroutine render_none: not called CC=1 SCAR=6.9
Pod documented
162  
163 0 my $htmler = shift;
164  
165 0 $htmler->para("None.");
166  
167 0 return 0;
168 }
169  
170 sub render_homepage
171 {
172 0 ▶ my $self = shift;
Subroutine render_homepage: not called CC=2 SCAR=17.9
Pod documented
173  
174 0 my $htmler = shift;
175  
176 0 my $homepage = $self->get_homepage();
177  
178 0 ▶ if ($homepage)
Branch: 1 branch
BranchTrueFalseTotal
if ($homepage) { } 0 0 0
179 {
180 0 $htmler->start_para();
181 0 $htmler->url($homepage);
182 0 $htmler->end_para();
183 }
184 else
185 {
186 0 $self->render_none($htmler);
187 }
188  
189 0 return 0;
190 }
191  
192 sub render_online_archive
193 {
194 0 ▶ my $self = shift;
Subroutine render_online_archive: not called CC=3 SCAR=24.8
Pod documented
195  
196 0 my $htmler = shift;
197  
198 0 my $archive = $self->get_online_archive();
199  
200 0 ▶ if ( ref($archive) eq "CODE" )
Branch: 2 branches
BranchTrueFalseTotal
if (ref $archive eq 'CODE') { } 0 0 0
elsif (ref $archive eq '') { } 0 0 0
201 {
202 0 $archive->( $self, $htmler );
203 }
204 elsif ( ref($archive) eq "" )
205 {
206 0 $htmler->start_para();
207 0 $htmler->url($archive);
208 0 $htmler->end_para();
209 }
210 else
211 {
212 0 $self->render_none($htmler);
213 }
214  
215 0 return 0;
216 }
217  
218 sub render_field
219 {
220 0 ▶ my $self = shift;
Subroutine render_field: not called CC=5 SCAR=34.0
Pod documented
221  
222 0 my $htmler = shift;
223  
224 0 my $desc = shift;
225  
226 0 ▶ if ( ref($desc) eq "CODE" )
Branch: 3 branches
BranchTrueFalseTotal
if (ref $desc eq 'CODE') { } 0 0 0
elsif (ref $desc eq 'ARRAY') { } 0 0 0
elsif (ref $desc eq '') { } 0 0 0
227 {
228 0 $desc->( $self, $htmler );
229 }
230 elsif ( ref($desc) eq "ARRAY" )
231 {
232 0 foreach my $paragraph (@$desc)
233 {
234 0 $htmler->para($paragraph);
235 }
236 }
237 elsif ( ref($desc) eq "" )
238 {
239 0 $htmler->para($desc);
240 }
241 0 return 0;
242 }
243  
244 sub render_description
245 {
246 0 ▶ my $self = shift;
Subroutine render_description: not called CC=1 SCAR=6.9
Pod documented
247 0 my $htmler = shift;
248 0 $self->render_field( $htmler, $self->get_description() );
249 }
250  
251 sub render_guidelines
252 {
253 0 ▶ my $self = shift;
Subroutine render_guidelines: not called CC=1 SCAR=6.9
Pod documented
254 0 my $htmler = shift;
255 0 $self->render_field( $htmler, $self->get_guidelines() );
256 }
257  
258 sub render_something_with_email_addr
259 {
260 0 ▶ my $self = shift;
Subroutine render_something_with_email_addr: not called CC=1 SCAR=6.9
Pod documented
261  
262 0 my $htmler = shift;
263 0 my $begin_msg = shift;
264 0 my $address_method = shift;
265  
266 0 $htmler->para($begin_msg);
267 0 $htmler->indent_inc();
268 0 $htmler->start_para();
269 0 $htmler->email_address( $self->$address_method() );
270 0 $htmler->end_para();
271 0 $htmler->indent_dec();
272  
273 0 return 0;
274 }
275  
276 9 1;
277  
278 __END__
↑ Summary blib/lib/Mail/LMLM/Render/HTML.pm »