blib/lib/Mojolicious/Plugin/AntiSpamMailTo.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 28 / 28 CC 3 SCAR 4.5
CC
3
Cov
100%
__ANON__
2.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.6
↑ Summary
1 package Mojolicious::Plugin::AntiSpamMailTo;
2  
3 4 ▶use Mojo::Base 'Mojolicious::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 4 our $VERSION = '1.001004'; # VERSION
6  
7 4 ▶use HTML::Entities;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 my $email;
10  
11 2 ▶sub register {
Subroutine register: called CC=1 SCAR=0.0
Pod documented
12 2 my ($self, $app) = @_;
13  
14 $app->helper(
15 2 ▶ mailto_href => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
16 2 shift; # dump the controller
17 2 ▶ @_ and $email = shift;
Branch: 1 branch
BranchTrueFalseTotal
@_ and $email = shift() 1 1 2
18 2 encode_entities 'mailto:' . $email, '\w\W';
19 },
20 2 );
21  
22 $app->helper(
23 3 ▶ mailto => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
24 3 shift; # dump the controller
25 3 ▶ @_ and $email = shift;
Branch: 1 branch
BranchTrueFalseTotal
@_ and $email = shift() 2 1 3
26 # the ''. is to ensure encode_entities doesn't modify
27 # email in-place
28 3 encode_entities ''.$email, '\w\W';
29 },
30 2 );
31 }
32  
33 4 '
34 Q: Whats the object-oriented way to become wealthy?
35 A: Inheritance
36 ';
37  
38 __END__
↑ Summary