blib/lib/Dancer/Plugin/reCAPTCHA.pm

filter: Statementstmt 69.5% 16 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod n/a totaltotal 63.3% 19 / 30 CC 2 SCAR 10.4
CC
2
Cov
64%
__ANON__
6.0
__ANON__
2.0
BEGIN
1.0
CRAP 2.8
↑ Summary
1 package Dancer::Plugin::reCAPTCHA;
2 # ABSTRACT: Easily integrate reCAPTCHA into your Dancer applications
3 {
4 1 $Dancer::Plugin::reCAPTCHA::VERSION = '0.91';
5 }
6  
7  
8 1 ▶use Dancer ':syntax';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Dancer::Plugin;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Captcha::reCAPTCHA::V2;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 my $rc = Captcha::reCAPTCHA::V2->new;
13  
14  
15 0 ▶register recaptcha_display => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
16 0 my $conf = plugin_setting();
17 0 ▶ my %options = map { $_ => $conf->$_ if defined $conf->$_ } (qw[ theme type size ]);
Branch: 1 branch
BranchTrueFalseTotal
if defined $conf->$_ 0 0 0
18 return $rc->html(
19 $conf->{ public_key },
20 0 { %options }
21 );
22 1 };
23  
24  
25 0 ▶register recaptcha_check => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
26 0 my ( $response ) = @_;
27 0 my $conf = plugin_setting();
28 return $rc->verify(
29 $conf->{ private_key },
30 0 $response,
31 request->remote_address,
32 );
33 1 };
34  
35  
36 1 register_plugin;
37 1 1;
38  
39 __END__
↑ Summary