| 1 | package Dancer2::Plugin::FormValidator::Role::Validator; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 18 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 18 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 18 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 18 | ▶ | use Types::Standard qw(ConsumerOf); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 18 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 18 | has extension => ( | |||||||||||||||||||||||||||||||||||||||||
| 11 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||
| 12 | isa => ConsumerOf['Dancer2::Plugin::FormValidator::Role::Extension'], | ||||||||||||||||||||||||||||||||||||||||||
| 13 | predicate => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 14 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | 18 | requires 'validate'; | |||||||||||||||||||||||||||||||||||||||||
| 17 | 18 | requires 'message'; | |||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | sub stop_on_fail { | ||||||||||||||||||||||||||||||||||||||||||
| 20 | 29 | ▶ | return 0; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
stop_on_fail: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | sub _field_defined_and_non_empty { | ||||||||||||||||||||||||||||||||||||||||||
| 24 | 106 | ▶ | my ($self, $field, $input) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_field_defined_and_non_empty: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 106 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
exists $input->{$field} and defined $input->{$field} and $input->{$field} ne ""
exists $input->{$field} and defined $input->{$field}
MC/DC66%2/3
exists $input->{$field} and defined $input->{$field} and $input->{$field} ne ""
exists $input->{$field}
defined $input->{$field}
$input->{$field} ne ""
Truth table75%3/4
A and B and C
A= exists $input->{$field}B= defined $input->{$field}C= $input->{$field} ne ""
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | exists $input->{$field} | ||||||||||||||||||||||||||||||||||||||||||
| 28 | and defined $input->{$field} | ||||||||||||||||||||||||||||||||||||||||||
| 29 | and $input->{$field} ne '' | ||||||||||||||||||||||||||||||||||||||||||
| 30 | ) { | ||||||||||||||||||||||||||||||||||||||||||
| 31 | 94 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | 12 | return 0; | |||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 18 | 1; | |||||||||||||||||||||||||||||||||||||||||