Branch Coverage

blib/lib/Data/RuledValidator.pm
Criterion Covered Total %
branch 166 238 69.7


line true false branch
27 53 0 if (@_ == 2) { }
28 51 2 if (exists $RULES{$rule})
31 2 49 if ($RULES{$rule}{'time'} < $t)
45 4 25 @_ == 3 ? :
50 0 26 unless $rule ||= $self->rule
51 1 25 @_ == 3 ? :
56 0 2 if (@_ == 3) { }
59 2 0 unless $RULES{$rule}{'_regex_group'}
68 0 10 $option{$_} ? :
2 10 ref $option{$_} ? :
75 18 0 if (not 'Class::Inspector'->loaded($plugin)) { }
76 15 3 if (not @{$option{'plugin'};} && @{$option{'filter'};} or exists $import{$plugin})
80 0 18 if ($@ and my $er = $option{'import_error'})
81 0 0 if ($er == 1) { }
87 0 18 if ($plugin =~ /^$class::Filter::/)
95 1 5 unless ('Class::Inspector'->loaded('Data::RuledValidator::Plugin::Core'))
98 1 5 if (@{$option{'plugin'};} || @{$option{'filter'};} and %import)
104 78 1 @_ ? :
109 0 120 if ($MK_CLOSURE{$op})
119 0 64 if (defined $COND_OP{$op})
130 0 1 if ($MK_CLOSURE{$alias}) { }
0 1 elsif (not $MK_CLOSURE{$original}) { }
140 0 1 if ($COND_OP{$alias}++)
153 0 22 if ($option{'rule_path'} and not $option{'rule_path'} =~ m[/$])
156 22 0 unless (defined $option{'auto_reset'})
165 0 26 if (@_ == 2) { }
188 0 30 defined $method ? :
193 0 410 if (@_ == 2) { }
206 16 111 $def =~ s/^\s*(\w+)\s*=\s*// ? :
207 4 123 if ($alias and $alias eq $required_name) { }
11 112 elsif ($def =~ /filter\s+(.+?)\s+with\s+(.+?)\s*$/) { }
208 3 1 if ($def =~ m[^\s*n/a\s*$]) { }
1 0 elsif (my(@keys) = grep($_, split(/\s*,\s*/, $def, 0))) { }
216 0 11 if ($def =~ m[^\s*n/a\s*$]) { }
2 9 elsif ($keys eq '*') { }
9 0 elsif (my(@keys) = grep($_, split(/\s*,\s*/, $keys, 0))) { }
225 1 111 if ($def =~ s[\s+with\s+n/a\s*$][]) { }
5 106 elsif ($def =~ s/\s+with\s+(.+?)\s*$//) { }
231 112 0 $MK_CLOSURE{$op} ? :
233 0 111 if ($flg & NEED_ALIAS() and not $alias)
239 3 28 $no_required ? :
0 31 $no_filter ? :
244 0 6 if ref $_[-1] eq 'HASH'
247 6 0 if $self->auto_reset
248 0 6 if ref $definition[0] eq 'ARRAY'
255 18 593 ref $method ? :
263 0 30 ref $method ? :
275 3 27 if defined $required and %$required
280 0 30 if (not my $key_method = $self->key_method) { }
292 273 0 if defined $result
309 17 305 if ($here_filter) { }
268 37 elsif ($$value{$key}) { }
312 0 268 unless $$value{$key}
316 1 321 if exists $$result{$alias . '_' . $op}
320 321 0 if (defined $MK_CLOSURE{$op})
321 283 38 if ($flg & ALLOW_NO_VALUE() or any sub { defined $_; } , @value) { }
325 22 4 if (not $r and @value and not defined $$failure{$alias . '_' . $op})
329 4 34 if (exists $$required{$alias})
343 34 537 unless $all_filter
17 571 if (ref $here_filter eq 'ARRAY') { }
81 490 elsif (@{[] unless $all_filter;} or my $key_filter = $$filter{$key}) { }
347 79 2 unless $self->_filtered_value($key)
79 2 unless (@value = @{[] unless $self->_filtered_value($key);})
360 1 29 if @_ == 2
366 0 4 if @_ == 2
372 0 31 if @_ == 2
378 28 1 unless my $filter = $self->filter_replace
380 0 1 unless $$self{'filtered_value'}
382 0 1 if (ref $filter) { }
395 79 81 if @_ == 3
402 2 114 unless defined $value
411 59 0 if @_ == 2
417 29 27 if @_ == 2
440 29 0 if (@_ == 2)
448 0 29 if (defined $valid)
451 27 2 if (exists $$self{'valid'}) { }
453 27 0 exists $$self{'failure'} ? :
454 0 27 if (exists $$self{'result'}{$required_valid}) { }
455 0 0 $self->ok($required_valid) ? :
471 18 7 if ref $_[-1] eq 'HASH'
474 25 0 if $self->auto_reset
475 0 25 $rule ? :
476 0 25 unless $rule
477 0 25 unless $self->_rules($rule)
4 21 unless %{{} unless $self->_rules($rule);}
480 25 0 unless ($group_name)
482 0 25 $id_key =~ /^ENV_(.+)$/i ? :
484 24 1 defined $group_name ? :
486 2 23 unless ($defs)
488 0 0 if $defs = $self->_rules($rule)->{$r}
492 24 1 $group_name ? :
503 9 13 if (my $rule_global = $$rule{'GLOBAL'})
505 9 0 if (ref $def eq 'ARRAY' and $$def[1] eq 'GLOBAL' and $$def[2] eq 'is' and $$def[3] eq 'n/a')
515 13 9 unless ($global_is_na)
523 0 174 unless $$def[2]
526 174 0 if (exists $MK_CLOSURE{$op}) { }
527 13 161 if $cond eq 'n/a'
528 161 13 unless $na{$alias}{$op} or $has{$alias}{$op}++
543 8 0 unless exists $$filter{$k}
553 0 4 if (ref $rule eq 'SCALAR') { }
556 0 4 unless @rule = File::Slurp::read_file($self->rule_path . $rule)
564 75 124 unless $line and not $line =~ /^\s*#/
566 0 124 if ($line =~ s/^;+path;+/;/ or $line =~ s/path\{/{/) { }
0 124 elsif ($line =~ s/^;+r;+/;/ or $line =~ s/r\{/{/) { }
573 4 120 if ($line =~ s/^ID_KEY\s+//i) { }
1 119 elsif ($line =~ s/^ID_METHOD\s+//i) { }
26 93 elsif ($line =~ /^\s*\{\s*([^\s]+)\s*\}\s*$/ or $line =~ /^\s*;+\s*([^\s]+)\s*$/) { }
582 0 26 if $is_regex
594 4 22 if $id_name eq 'GLOBAL'
599 19 3 if (defined $required)
600 9 10 $global_is_na ? :
0 19 %$required ? :
602 22 0 if (defined $filter)
603 9 13 $global_is_na ? :
614 26 39 if exists $$self{'result'}{$alias . '_valid'}
621 0 0 exists $COND_OP{$name} ? :
0 0 @_ == 3 ? :
629 0 0 exists $MK_CLOSURE{$name} ? :
0 0 @_ == 3 ? :