Branch Coverage

blib/lib/HTML/FormFu/Constraint.pm
Criterion Covered Total %
branch 71 100 71.0


line true false branch
35 1 48 if (my $name = $when->{'field'}) { }
0 48 elsif (my $names = $when->{'fields'}) { }
39 1 0 if (defined $field)
40 0 1 if DEBUG_CONSTRAINTS()
54 0 0 if (defined $field)
67 15 428 unless $self->_run_this_rep
74 29 399 unless ($self->_process_when($params))
75 0 29 if DEBUG_CONSTRAINTS()
79 14 385 if (ref $value eq 'ARRAY') { }
82 1 13 if ($@)
93 0 385 if DEBUG_CONSTRAINTS()
94 0 385 if DEBUG_CONSTRAINTS()
96 113 272 $@ || !$ok ? :
109 416 61 unless my $only_on_reps = $self->only_on_reps
112 0 61 unless my $current_rep = $self->field->repeatable_count
115 18 43 if (&reftype($only_on_reps) || '') ne 'ARRAY'
129 10 418 if (@fields_with_this_name > 1)
134 10 5 if ($fields_with_this_name[$i] eq $field)
140 0 10 unless defined $index
143 10 0 if ((&reftype($value) || '') eq 'ARRAY') { }
0 0 elsif ($index == 0) { }
166 0 45 if DEBUG_CONSTRAINTS()
167 0 45 if DEBUG_CONSTRAINTS()
169 1 44 $@ || !$ok ? :
192 128 310 if (CORE::not $pass or $force)
195 8 120 if $pass
206 196 0 unless (&blessed($err) and $err->isa('HTML::FormFu::Exception::Constraint'))
223 463 76 unless defined $when
226 0 76 if ref $when ne 'HASH'
236 0 76 if &all(sub { CORE::not defined $_; } , $when_field, $when_fields, $when_any_field, $when_callback)
240 20 56 if ($when_callback)
249 10 46 if ($when_any_field)
250 0 10 unless @$when_any_field
257 17 39 if ($when_fields) { }
258 0 17 unless @$when_fields
263 54 0 if defined $value
272 39 0 if defined $value
276 0 56 if DEBUG_CONSTRAINTS_WHEN()
278 0 56 unless (@when_fields_value)
279 0 0 if DEBUG_CONSTRAINTS_WHEN()
286 24 32 if (defined(my $value = $when->{'value'})) { }
10 22 elsif (defined(my $values = $when->{'values'})) { }
296 34 22 if (@values) { }
303 29 30 $value ? :
307 0 56 if DEBUG_CONSTRAINTS_WHEN()
311 0 21 $when->{'not'} ? :
312 14 35 $when->{'not'} ? :
10 46 $any ? :
314 0 56 if DEBUG_CONSTRAINTS_WHEN()
336 1 50 if (defined(my $when = $self->when))