blib/lib/Dancer/Plugin/reCAPTCHA.pm

filter: Statementstmt 76.1% 16 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod n/a totaltotal 73.0% 19 / 26 SCAR 0.1
CC
1
Cov
76%
__ANON__
2.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 package Dancer::Plugin::reCAPTCHA;
2 # ABSTRACT: Easily integrate reCAPTCHA into your Dancer applications
3 {
4 1 $Dancer::Plugin::reCAPTCHA::VERSION = '0.4';
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;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 my $rc = Captcha::reCAPTCHA->new;
13  
14  
15 register recaptcha_display => sub {
16 0 ▶ my $conf = plugin_setting();
Subroutine __ANON__: not called CC=1 SCAR=6.9
17 return $rc->get_html(
18 $conf->{ public_key },
19 undef,
20 $conf->{ use_ssl },
21 { theme => $conf->{ theme }},
22 0 );
23 1 };
24  
25  
26 register recaptcha_check => sub {
27 0 ▶ my ( $challenge, $response ) = @_;
Subroutine __ANON__: not called CC=1 SCAR=6.9
28 0 my $conf = plugin_setting();
29 return $rc->check_answer(
30 $conf->{ private_key },
31 0 request->remote_address,
32 $challenge,
33 $response,
34 );
35 1 };
36  
37  
38 1 register_plugin;
39 1 1;
40  
41 __END__
↑ Summary