Branch Coverage

blib/lib/Data/FormValidator/Constraints.pm
Criterion Covered Total %
branch 73 148 49.3


line true false branch
50 708 59 unless ($func eq 'cc_number')
70 0 0 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
0 0 unless $dfv->get_current_constraint_name
0 0 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
0 0 unless $dfv->get_current_constraint_name
0 1 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
1 0 unless $dfv->get_current_constraint_name
0 0 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
0 0 unless $dfv->get_current_constraint_name
0 0 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
0 0 unless $dfv->get_current_constraint_name
0 0 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
0 0 unless $dfv->get_current_constraint_name
0 0 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
0 0 unless $dfv->get_current_constraint_name
0 0 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
0 0 unless $dfv->get_current_constraint_name
0 0 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
0 0 unless $dfv->get_current_constraint_name
0 0 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
0 0 unless $dfv->get_current_constraint_name
0 0 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
0 0 unless $dfv->get_current_constraint_name
0 0 unless &Scalar::Util::blessed($dfv) and $dfv->can('name_this')
0 0 unless $dfv->get_current_constraint_name
71 0 708 if $@
157 1 125 if (grep {/^:regexp_common$/;} @_)
169 9 0 unless $dfv->get_current_constraint_name
239 34 0 if (defined $prefix and $prefix eq 'valid_')
282 0 8 unless (defined $min and defined $max)
287 7 1 unless $dfv->get_current_constraint_name
288 5 3 if length $value > $max or length $value < $min
297 0 6 unless defined $max
300 5 1 unless $dfv->get_current_constraint_name
301 4 2 if length $value > $max
310 0 5 unless defined $min
313 4 0 unless $dfv->get_current_constraint_name
314 2 2 if length $value < $min
338 2 0 unless $dfv->get_current_constraint_name
344 0 2 ref $data->{$other_field} ? :
376 3 0 if (defined $value and ref $value eq 'ARRAY') { }
0 0 elsif ($size == 1) { }
408 0 2 unless $min and $max
417 2 0 if ref $value eq 'ARRAY'
418 0 0 if $min == 0 and $max >= 2
445 10 26 if ($valid_email = 'Email::Valid'->address($in_email) and $valid_email eq $in_email) { }
473 0 4 if ($match = match_state(@_)) { }
490 2 9 if ($state =~ /\b($val)\b/i) { }
505 4 6 if ($province =~ /\b($val)\b/i) { }
520 2 2 if ($match = match_zip(@_)) { }
538 2 4 if ($val =~ /^([ABCEGHJKLMNPRSTVXYabceghjklmnprstvxy][_\W]*\d[_\W]*[A-Za-z][_\W]*[- ]?[_\W]*\d[_\W]*[A-Za-z][_\W]*\d[_\W]*)$/) { }
553 6 6 if ($val =~ /^(\s*\d{5}(?:[-]\d{4})?\s*)$/) { }
569 4 2 if ($val =~ /^((?:\D*\d\D*){6,})$/) { }
585 2 3 if ($val =~ /^((?:\D*\d\D*){7,})$/) { }
617 0 1 unless $attrs and ref $attrs eq 'HASH' and exists $attrs->{'fields'} and ref $attrs->{'fields'} eq 'ARRAY'
620 0 1 unless $cc_type_field
640 0 28 if length $the_card == 0
643 0 28 unless $card_type =~ /^[admv]/i
645 2 6 if $card_type =~ /^v/i and substr($the_card, 0, 1) ne '4' or $card_type =~ /^m/i and substr($the_card, 0, 1) ne '5' or $card_type =~ /^d/i and substr($the_card, 0, 4) ne '6011' or $card_type =~ /^a/i and substr($the_card, 0, 2) ne '34' and substr($the_card, 0, 2) ne '37'
653 0 24 unless $the_card =~ /^\d+$/
657 0 4 if $digit == 3 and $index != 14 or $digit == 4 and $index != 12 and $index != 15 or $digit == 5 and $index != 15 or $digit == 6 and $index != 13 and $index != 15
668 50 304 $product > 9 ? :
672 22 2 if $the_sum
675 18 6 if ($the_sum == substr($the_card, -1)) { }
676 18 0 if ($orig_card =~ /^([\d\s]*)$/) { }
696 2 2 unless $month =~ /^(\d+)$/
699 0 2 unless $year =~ /^(\d+)$/
702 0 2 if $month < 1 or $month > 12
703 2 0 $year < 70 ? :
2 0 if $year < 1900
706 0 2 if $year < $now[5] or $year == $now[5] and $month <= $now[4]
720 2 2 if ($val =~ /^([MVAD].*)$/i) { }
737 4 2 if ($val =~ /^((\d+)\.(\d+)\.(\d+)\.(\d+))$/) { }
738 3 1 if ($2 >= 0 and $2 <= 255 and ($3 >= 0 and $3 <= 255) and ($4 >= 0 and $4 <= 255) and ($5 >= 0 and $5 <= 255)) { }