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

filter: Statementstmt 24.1% 15 / 62 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 28.5% 4 / 14 Podpod 100% 8 / 8 totaltotal 28.1% 27 / 96 CC 7 SCAR 18.9
CC
7
Cov
20%
parse_args
20.0
get_maintenance_url
6.0
group_form
6.0
CRAP 6.6
« blib/lib/Mail/LMLM/Types/GoogleGroups.pm ↑ Summary Build »
1 package Mail::LMLM::Types::Mailman;
2 4 $Mail::LMLM::Types::Mailman::VERSION = '0.6805';
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use Mail::LMLM::Types::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 @ISA=qw(Mail::LMLM::Types::Base);
11  
12 sub parse_args
13 {
14 0 ▶ my $self = shift;
Subroutine parse_args: not called CC=4 SCAR=30.0
Pod documented
15  
16 0 my $args = shift;
17  
18 0 $args = $self->SUPER::parse_args($args);
19  
20 0 my (@left, $key, $value);
21  
22 0 ▶ while (scalar(@$args))
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @$args) 0 0 0
23 {
24 0 $key = shift(@$args);
25 0 $value = shift(@$args);
26  
27 0 ▶ if ($key =~ /^-?(maintenance[-_]url)$/)
Branch: 2 branches
BranchTrueFalseTotal
if ($key =~ /^-?(maintenance[-_]url)$/) { } 0 0 0
elsif ($key =~ /^-?(owner)$/) { } 0 0 0
28 {
29 0 $self->{'maintenance_url'} = $value;
30 }
31 elsif ($key =~ /^-?(owner)$/)
32 {
33 0 $self->{'owner'} = $value;
34 }
35 else
36 {
37 0 push @left, $key, $value;
38 }
39 }
40  
41 0 return \@left;
42  
43  
44 0 return $args;
45 }
46  
47 sub get_maintenance_url
48 {
49 0 ▶ my $self = shift;
Subroutine get_maintenance_url: not called CC=2 SCAR=17.9
Pod documented
50  
51 0 ▶ if (exists($self->{'maintenance_url'}))
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'maintenance_url'}) { } 0 0 0
52 {
53 0 return $self->{'maintenance_url'};
54 }
55 else
56 {
57 0 return $self->{'homepage'} . "mailman/listinfo/" . $self->get_group_base(). "/";
58 }
59  
60 }
61  
62 sub group_form
63 {
64 0 ▶ my $self = shift;
Subroutine group_form: not called CC=2 SCAR=17.9
Pod documented
65  
66 0 my $add = shift;
67  
68 return (
69 0 ▶ ( $self->get_group_base() .
Branch: 1 branch
BranchTrueFalseTotal
$add ? : 0 0 0
70 ($add ? ("-" . $add) : "") )
71 ,
72 $self->get_hostname()
73 );
74 }
75  
76 sub _get_post_address
77 {
78 0 ▶ my $self = shift;
Subroutine _get_post_address: not called CC=1 SCAR=6.9
79  
80 0 return $self->group_form();
81 }
82  
83 sub _get_owner_address
84 {
85 0 ▶ my $self = shift;
Subroutine _get_owner_address: not called CC=2 SCAR=17.9
86  
87 0 ▶ if ($self->{owner})
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'owner'}) { } 0 0 0
88 {
89 0 return @{$self->{owner}};
90 }
91 else
92 {
93 0 return $self->group_form("owner");
94 }
95 }
96  
97 sub render_maint_url
98 {
99 0 ▶ my $self = shift;
Subroutine render_maint_url: not called CC=1 SCAR=6.9
Pod documented
100 0 my $htmler = shift;
101  
102 0 $htmler->start_para();
103 0 $htmler->text("Go to ");
104 0 $htmler->url($self->get_maintenance_url(), "to the maintenance URL");
105 0 $htmler->text(" and follow the instructions there.");
106 0 $htmler->end_para();
107  
108 0 return 0;
109 }
110  
111 sub render_subscribe
112 {
113 0 ▶ my $self = shift;
Subroutine render_subscribe: not called CC=1 SCAR=6.9
Pod documented
114  
115 0 my $htmler = shift;
116  
117 0 return $self->render_maint_url($htmler);
118 }
119  
120 sub render_unsubscribe
121 {
122 0 ▶ my $self = shift;
Subroutine render_unsubscribe: not called CC=1 SCAR=6.9
Pod documented
123  
124 0 my $htmler = shift;
125  
126 0 return $self->render_maint_url($htmler);
127 }
128  
129 sub render_post
130 {
131 0 ▶ my $self = shift;
Subroutine render_post: not called CC=1 SCAR=6.9
Pod documented
132  
133 0 my $htmler = shift;
134  
135 0 return $self->render_something_with_email_addr(
136 $htmler,
137 "Send your messages to the following address: ",
138 \&_get_post_address
139 );
140 }
141  
142 sub render_owner
143 {
144 0 ▶ my $self = shift;
Subroutine render_owner: not called CC=1 SCAR=6.9
Pod documented
145  
146 0 my $htmler = shift;
147  
148 0 return $self->render_something_with_email_addr(
149 $htmler,
150 "Send messages to the mailing-list owner to the following address: ",
151 \&_get_owner_address
152 );
153 }
154  
155 4 1;
156  
157 __END__
« blib/lib/Mail/LMLM/Types/GoogleGroups.pm ↑ Summary Build »