| 1 | package Catalyst::Plugin::Email::Page; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 5 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 5 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 5 | ▶ | use Catalyst::Request; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 5 | ▶ | use Readonly; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 5 | ▶ | use URI::Escape qw( uri_escape_utf8 ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 5 | our $VERSION = '0.26'; | |||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 5 | Readonly my $address => q{webmaster@example.com}; | |||||||||||||||||||
| 12 | 5 | Readonly my $subject => q{User Report for}; | |||||||||||||||||||
| 13 | 5 | Readonly my $text => q{Report Page}; | |||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 0 | ▶ | sub _construct_url { | ||||||||||||||||||
|
Subroutine
_construct_url: not called CC=3 SCAR=24.8
| |||||||||||||||||||||
| 16 | 0 | my $c = shift; | |||||||||||||||||||
| 17 | 0 | my $page = $c->request->uri; | |||||||||||||||||||
| 18 | 0 | ▶ | my $email_add = $c->config->{email_page}{email} || $address; | ||||||||||||||||||
|
Condition0%0/3
$c->config->{'email_page'}{'email'} || $address
MC/DC0%0/2
$c->config->{'email_page'}{'email'} || $address
$c->config->{'email_page'}{'email'}
$address
Truth table0%0/3
A || B
A= $c->config->{'email_page'}{'email'}B= $address
| |||||||||||||||||||||
| 19 | 0 | ▶ | my $email_subject = $c->config->{email_page}{subject} || $subject; | ||||||||||||||||||
|
Condition0%0/3
$c->config->{'email_page'}{'subject'} || $subject
MC/DC0%0/2
$c->config->{'email_page'}{'subject'} || $subject
$c->config->{'email_page'}{'subject'}
$subject
Truth table0%0/3
A || B
A= $c->config->{'email_page'}{'subject'}B= $subject
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | # Only mailto subject needs to be escaped | ||||||||||||||||||||
| 22 | 0 | my $mailto_subject = uri_escape_utf8( "$email_subject $page" ); | |||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 0 | return "mailto:$email_add?subject=$mailto_subject"; | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 0 | ▶ | sub email_page_url { | ||||||||||||||||||
|
Subroutine
email_page_url: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 28 | 0 | my $c = shift; | |||||||||||||||||||
| 29 | 0 | my $link = $c->_construct_url; | |||||||||||||||||||
| 30 | 0 | ▶ | my $link_text = $c->config->{email_page}{link_text} || $text; | ||||||||||||||||||
|
Condition0%0/3
$c->config->{'email_page'}{'link_text'} || $text
MC/DC0%0/2
$c->config->{'email_page'}{'link_text'} || $text
$c->config->{'email_page'}{'link_text'}
$text
Truth table0%0/3
A || B
A= $c->config->{'email_page'}{'link_text'}B= $text
| |||||||||||||||||||||
| 31 | 0 | my $email_link = "<a href=\"$link\">$link_text</a>"; | |||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 0 | return $email_link; | |||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 5 | 1; # Magic true value required at end of module | |||||||||||||||||||
| 37 | __END__ | ||||||||||||||||||||