Branch Coverage

blib/lib/CGI/Application/MailPage.pm
Criterion Covered Total %
branch 121 194 62.3


line true false branch
31 0 25 unless defined $self->param('document_root') or $self->param('remote_fetch')
34 0 25 unless defined $self->param('smtp_server')
38 24 1 unless defined $self->param('validation_profile')
47 0 5 unless (defined $page)
48 0 0 if (not $self->param('use_page_param')) { }
50 0 0 unless defined $page
57 0 0 unless defined $page
63 0 5 if ($self->param('form_template')) { }
72 0 5 if ref $path[0] eq 'ARRAY'
105 1 4 unless $query->param('subject')
108 4 1 if ($err_msgs and ref $err_msgs eq 'HASH')
111 1 4 if $self->param('extra_tmpl_params')
133 1 22 if ($self->param('max_emails_per_request') and scalar @emails > $self->param('max_emails_per_request'))
141 2 40 unless ('Email::Valid'->address($email))
155 21 1 if (grep {$val eq $_;} @valid_formats)
167 1 23 if ($self->param('validation_profile')->{'constraints'})
184 4 20 if ($results->has_invalid or $results->has_missing)
203 3 1 if ($err_msgs{'error_name'}) { }
0 1 elsif ($err_msgs{'invalid_from_email'}) { }
0 1 elsif ($err_msgs{'missing_from_email'}) { }
1 0 elsif ($err_msgs{'invalid_to_emails'}) { }
0 0 elsif ($err_msgs{'missing_to_emails'}) { }
0 0 elsif ($err_msgs{'error_subject'}) { }
227 2 0 if ($self->param('acceptable_domains') and ref $self->param('acceptable_domains') eq 'ARRAY' and $page =~ m[^https?://([^/:]+)])
235 1 1 unless grep {lc $domain eq lc $_;} @{$self->param('acceptable_domains');}
239 4 15 if ($self->param('max_emails_per_hour'))
241 0 4 unless ($file)
248 4 0 if (-e $file) { }
249 0 4 unless open my $IN, $file
251 0 4 unless close $IN
257 2 2 if ($current_time - $last_time < 3600) { }
259 2 0 if ($count > $self->param('max_emails_per_hour'))
273 0 4 unless open my $OUT, '>', $file
274 0 4 unless flock $OUT, 2
276 0 4 unless close $OUT
279 2 2 if $error
284 10 7 if (not $self->param('remote_fetch') && $page =~ m[^https?://]) { }
286 0 7 unless -e $filename and -r _ and -s _
294 0 7 unless (defined $file and length $file)
308 0 14 if ($self->param('email_template')) { }
315 0 14 if ref $path[0] eq 'ARRAY'
323 0 14 if $self->param('extra_tmpl_params')
332 7 7 if (index($format, '_attachment') != -1) { }
347 5 2 if ($format =~ /^(both|html)/)
349 0 5 if ($self->param('read_file_callback')) { }
3 2 elsif ($self->param('remote_fetch') and $page =~ m[^https?://]) { }
358 2 1 if ($response->is_success) { }
364 0 2 unless open HTML, $filename
370 4 0 if $base_url
373 2 2 $base ? :
382 4 2 if ($format =~ /^(both|text)/)
383 2 2 $base ? :
399 7 0 if $sender_ip
405 2 5 if ($format =~ /^(both|text)/)
410 2 5 if ($format =~ /^(both|html)/)
412 0 2 if ($self->param('read_file_callback')) { }
1 1 elsif ($self->param('remote_fetch') and $page =~ m[^https?://]) { }
422 1 0 if ($response->is_success) { }
429 0 1 unless open HTML, $filename
435 3 4 if ($format =~ /url/)
440 0 7 unless defined $msg
445 0 13 if (not $self->param('dump_mail')) { }
447 0 0 unless defined $smtp and UNIVERSAL::isa($smtp, 'Net::SMTP')
449 0 0 if $self->param('smtp_debug')
477 0 0 if ($self->param('thanks_template')) { }
484 0 0 if ref $path[0] eq 'ARRAY'
493 0 0 if $self->param('extra_tmpl_params')
503 0 20 if ($self->param('error_template')) { }
510 0 20 if ref $path[0] eq 'ARRAY'
519 0 20 if $self->param('extra_tmpl_params')
530 7 3 if ($url =~ m[^https?://([-\w\.:]+)/(.*)]) { }
536 0 3 $url =~ m[^/] ? :
596 0 3 unless defined $this->content
600 0 3 if (ref $child) { }
608 0 0 unless $startflag
610 0 0 if (ref $node) { }
619 0 0 if $node =~ /\S/
630 3 0 if $child =~ /\S/
655 3 3 if (ref $child) { }
663 3 6 unless $startflag
665 3 3 if (ref $node) { }
668 0 3 if ($node->tag =~ /^(?:li|dd|dt)$/) { }
690 3 0 if $node =~ /\S/
704 3 0 if $child =~ /\S/
719 0 6 if ($self->param('read_file_callback')) { }
3 3 elsif ($self->param('remote_fetch') and $page =~ m[^https?://]) { }
728 3 0 if ($response->is_success) { }
735 0 3 unless open HTML, $filename
746 6 654 if ref $node and $node->tag eq 'head'
748 228 426 unless $startflag
750 270 156 if (ref $node) { }
753 3 267 if ($node->tag eq 'p') { }
3 264 elsif ($node->tag =~ /^h(\d)/) { }
759 0 3 if (/^\* /) { }
0 3 elsif (s/^\+ //) { }
0 3 elsif (s/^- //) { }
824 60 96 unless $node =~ /\S/