| 1 | package HTML::FormHandlerX::Widget::Field::reCAPTCHA; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 3 | ▶ | sub render { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
render: called CC=5 SCAR=21.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 3 | my ( $self, $result ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 7 | 3 | ▶ | $result ||= $self->result; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$result ||= $self->result
MC/DC0%0/2
$result ||= $self->result
$result
$self->result
Truth table33%1/3
A ||= B
A= $resultB= $self->result
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 3 | ▶ | if( !$self->value || ($self->value && $self->has_errors)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition16%1/6
not $self->value or $self->value and $self->has_errors
$self->value and $self->has_errors
MC/DC0%0/3
not $self->value or $self->value and $self->has_errors
not $self->value
$self->value
$self->has_errors
Truth table25%1/4
not(A) or B and C
A= not $self->valueB= $self->valueC= $self->has_errors
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 3 | my @args = $self->prepare_public_recaptcha_args; | |||||||||||||||||||||||||||||||||||||||||
| 11 | 3 | my $output = $self->recaptcha_instance->get_html(@args); | |||||||||||||||||||||||||||||||||||||||||
| 12 | 3 | return $self->wrap_field($result, $output); | |||||||||||||||||||||||||||||||||||||||||
| 13 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 0 | my $security_code = $self->encrypt_hex($self->public_key); | |||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | return <<"END"; | |||||||||||||||||||||||||||||||||||||||||
| 16 | <input type='hidden' name='recaptcha_response_field' value='$security_code' /> | ||||||||||||||||||||||||||||||||||||||||||
| 17 | <input type='hidden' name='recaptcha_already_validated' value='1' /> | ||||||||||||||||||||||||||||||||||||||||||
| 18 | END | ||||||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 3 | ▶ | sub prepare_public_recaptcha_args { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prepare_public_recaptcha_args: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 3 | my $self = shift @_; | |||||||||||||||||||||||||||||||||||||||||
| 24 | return ( | ||||||||||||||||||||||||||||||||||||||||||
| 25 | $self->public_key, | ||||||||||||||||||||||||||||||||||||||||||
| 26 | $self->{recaptcha_error}, | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 3 | $self->use_ssl, | |||||||||||||||||||||||||||||||||||||||||
| 28 | $self->recaptcha_options, | ||||||||||||||||||||||||||||||||||||||||||
| 29 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 3 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||