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 SCAR 34.6
CC
7
Cov
20%
parse_args
20.0
get_maintenance_url
6.0
group_form
6.0
CRAP 31.8
« blib/lib/Mail/LMLM/Types/GoogleGroups.pm ↑ Summary Build »
1 package Mail::LMLM::Types::Mailman;
2 4 $Mail::LMLM::Types::Mailman::VERSION = '0.6806';
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 0 return $args;
44 }
45  
46 sub get_maintenance_url
47 {
48 0 ▶ my $self = shift;
Subroutine get_maintenance_url: not called CC=2 SCAR=17.9
Pod documented
49  
50 0 ▶ if ( exists( $self->{'maintenance_url'} ) )
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'maintenance_url'}) { } 0 0 0
51 {
52 0 return $self->{'maintenance_url'};
53 }
54 else
55 {
56 return
57 0 $self->{'homepage'}
58 . "mailman/listinfo/"
59 . $self->get_group_base() . "/";
60 }
61  
62 }
63  
64 sub group_form
65 {
66 0 ▶ my $self = shift;
Subroutine group_form: not called CC=2 SCAR=17.9
Pod documented
67  
68 0 my $add = shift;
69  
70 0 ▶ return ( ( $self->get_group_base() . ( $add ? ( "-" . $add ) : "" ) ),
Branch: 1 branch
BranchTrueFalseTotal
$add ? : 0 0 0
71 $self->get_hostname() );
72 }
73  
74 sub _get_post_address
75 {
76 0 ▶ my $self = shift;
Subroutine _get_post_address: not called CC=1 SCAR=6.9
77  
78 0 return $self->group_form();
79 }
80  
81 sub _get_owner_address
82 {
83 0 ▶ my $self = shift;
Subroutine _get_owner_address: not called CC=2 SCAR=17.9
84  
85 0 ▶ if ( $self->{owner} )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'owner'}) { } 0 0 0
86 {
87 0 return @{ $self->{owner} };
88 }
89 else
90 {
91 0 return $self->group_form("owner");
92 }
93 }
94  
95 sub render_maint_url
96 {
97 0 ▶ my $self = shift;
Subroutine render_maint_url: not called CC=1 SCAR=6.9
Pod documented
98 0 my $htmler = shift;
99  
100 0 $htmler->start_para();
101 0 $htmler->text("Go to ");
102 0 $htmler->url( $self->get_maintenance_url(), "to the maintenance URL" );
103 0 $htmler->text(" and follow the instructions there.");
104 0 $htmler->end_para();
105  
106 0 return 0;
107 }
108  
109 sub render_subscribe
110 {
111 0 ▶ my $self = shift;
Subroutine render_subscribe: not called CC=1 SCAR=6.9
Pod documented
112  
113 0 my $htmler = shift;
114  
115 0 return $self->render_maint_url($htmler);
116 }
117  
118 sub render_unsubscribe
119 {
120 0 ▶ my $self = shift;
Subroutine render_unsubscribe: not called CC=1 SCAR=6.9
Pod documented
121  
122 0 my $htmler = shift;
123  
124 0 return $self->render_maint_url($htmler);
125 }
126  
127 sub render_post
128 {
129 0 ▶ my $self = shift;
Subroutine render_post: not called CC=1 SCAR=6.9
Pod documented
130  
131 0 my $htmler = shift;
132  
133 0 return $self->render_something_with_email_addr( $htmler,
134 "Send your messages to the following address: ",
135 \&_get_post_address );
136 }
137  
138 sub render_owner
139 {
140 0 ▶ my $self = shift;
Subroutine render_owner: not called CC=1 SCAR=6.9
Pod documented
141  
142 0 my $htmler = shift;
143  
144 0 return $self->render_something_with_email_addr( $htmler,
145 "Send messages to the mailing-list owner to the following address: ",
146 \&_get_owner_address );
147 }
148  
149 4 1;
150  
151 __END__
« blib/lib/Mail/LMLM/Types/GoogleGroups.pm ↑ Summary Build »