Condition Coverage

lib/HTTP/Validate.pm
Criterion Covered Total %
condition 232 345 67.2


and 3 conditions

line !l l&&!r l&&r condition
784 1 1 91 defined $ruleset_name and not ref $ruleset_name
2 1 90 defined $ruleset_name and not ref $ruleset_name and $ruleset_name ne ""
1186 216 0 0 do { builtin::reftype($rule) ne 'HASH' } && do { croak(q[The arguments to 'define_ruleset' must all be hashrefs and/or strings]) }
1278 1 0 0 $rule_i->{'type'} eq "param" and $search_for eq ($rule_i->{'param'} || $rule_i->{'optional'} || $rule_i->{'mandatory'})
0 0 1 $rule_i->{'type'} eq "include" and $search_for eq $rule_i->{'ruleset'}
1308 4 154 215 defined $DIRECTIVE{$key} and $DIRECTIVE{$key} == 2
1335 3 1 0 ref $value and ref $value ne "ARRAY"
1365 7 1 0 ref $value and ref $value ne "Regexp"
1422 0 1 159 defined $typevalue and not ref $typevalue
1 0 159 defined $typevalue and not ref $typevalue and $typevalue ne ""
1431 55 104 2 defined $v and $VALIDATOR_DEF{$v}
1435 2 0 0 $v eq "ANY_VALUE" and @validators > 1
1440 1 1 102 ref $v and builtin::reftype($v) eq "CODE"
1465 1 0 2 ref $rr->{'validators'} eq "ARRAY" and @{$rr->{'validators'};}
1507 1 1 31 defined $typevalue and not ref $typevalue
2 0 31 defined $typevalue and not ref $typevalue and $typevalue ne ""
1534 0 0 10 defined $typevalue and ref $typevalue eq "ARRAY"
1539 0 0 20 defined $arg and $arg ne ""
1625 117 12 1 @lines and $lines[0] =~ /^[!]/
1630 5 123 1 defined $rr and $rr->{'undocumented'}
1663 2 24 0 do { $rr->{'type'} eq 'include' if defined $rr } && do { push @{$$rs{'doc_items'};}, "=INCLUDE $rr->{'ruleset'}"; if ($body ne '') { push @{$$rs{'doc_items'};}, '=ORDINARY'; push @{$$rs{'doc_items'};}, process_doc($body) if defined $body; } }
1766 0 0 6 ref $rs and ref $rs->{'doc_items'} eq "ARRAY"
1775 28 0 10 ref $item and defined $item->{'param'}
1809 0 0 2 $doc ne "" and $subdoc ne ""
1818 3 1 14 $doc ne "" and $item ne ""
1887 0 3 1 ref $item and $item->{'type'} eq "include"
1913 0 78 0 defined $context and !ref($context) || builtin::reftype($context) ne 'HASH'
1939 36 0 4 ref $input_params[0] and builtin::reftype($input_params[0]) eq "HASH"
1998 102 0 1 ref $hash->{$param} and builtin::reftype($hash->{$param}) eq "ARRAY"
97 1 4 defined $hash->{$param} and $hash->{$param} ne ""
2000 1 0 0 ref $value && builtin::reftype($value) eq 'ARRAY'
2009 4 0 0 ref $value && builtin::reftype($value) eq 'ARRAY'
2033 0 0 76 defined $ruleset_name and $ruleset_name ne ""
2072 71 0 4 defined $vr->{'content_type'} and $vr->{'content_type'} ne ""
71 1 3 defined $vr->{'content_type'} and $vr->{'content_type'} ne "" and $vr->{'content_type'} ne "unknown"
2133 0 41 57 ref $rs->{'fulfill_order'} and @{$rs->{'fulfill_order'};}
2170 3 12 140 defined $subv and $subv ne ""
3 0 12 defined $subv and $subv eq ""
2193 213 0 1 keys %names_found > 1 and not $rr->{'multiple'}
133 80 0 not @raw_values and exists $rr->{'default'}
208 2 2 @raw_values > 1 and not $rr->{'multiple'} || $rr->{'split'} || $rr->{'list'}
2247 11 8 1 @raw_values and not @new_values
2254 207 1 2 $rr->{'flag'} and keys %names_found
1 0 2 $rr->{'flag'} and keys %names_found and not @raw_values
2272 73 3 2 $rr->{'allow_empty'} and keys %names_found
2295 0 0 47 defined $raw_val and $raw_val ne ""
2318 4 0 95 ref $result and builtin::reftype($result) eq "HASH"
2330 4 68 27 ref $result and $result->{'error'}
2359 4 67 1 ref $result and $result->{'warn'}
2369 4 1 67 ref $result && exists $result->{'value'}
2383 131 1 2 $rr->{'allow_empty'} and not @raw_values
2414 20 1 2 defined $rr->{'bad_value'} and $rr->{'bad_value'} eq "ERROR"
2485 7 4 1 $rr->{'type'} eq "together" and @present > 0
11 0 1 $rr->{'type'} eq "together" and @present > 0 and @present < @{$rr->{'param'};}
4 5 2 $rr->{'type'} eq "at_most_one" and @present > 1
2516 16 6 1 $rr->{'require'} and not $vr->{'rs'}{$rs_name} == 2
2540 2 0 4 @fulfilled == 0 and $rr->{'constraint'} eq 'require_one' || $rr->{'constraint'} eq 'require_any'
0 2 0 @fulfilled > 1 and $rr->{'constraint'} eq 'allow_one' || $rr->{'constraint'} eq 'require_one'
2728 0 0 4 defined $value and not $value =~ /^'/
2752 0 0 48 defined $value and $value ne ""
2789 15 0 4 ref $self->{'er'} eq "ARRAY" and @{$self->{'er'};}
3074 4 27 7 defined $min and $value < $min
3084 27 3 1 defined $max and $value > $max
3140 5 0 8 defined $min and defined $max
5 7 1 defined $min and defined $max and $value < $min || $value > $max
3145 5 4 0 defined $min and $value < $min
3150 5 4 0 defined $max and $value > $max
3162 8 6 1 defined $min and not &looks_like_number($min)
3163 8 6 0 defined $max and not &looks_like_number($max)
3194 1 2 7 defined $pattern and !ref($pattern) || ref $pattern eq 'Regexp'
3240 0 0 14 defined $k and $k ne ""

or 2 conditions

line l !l condition
1847 2 1 $uniq ||= {}
1879 1 1 $uniq ||= {}
1916 77 0 $context ||= {}
2580 2 2 $vr->{'raw'}{$param} || ''
2598 0 1 $rr->{'key'} ||= "_content_type"
2628 36 0 $msg ||= "ERR_DEFAULT"
2667 11 0 $msg ||= "ERR_DEFAULT"
2816 3 0 $self->{'ec'}{$key} || 0
2868 2 0 $self->{'wc'}{$key} || 0

or 3 conditions

line l !l&&r !l&&!r condition
1102 0 0 90 $ruleset_name eq "" or ref $ruleset_name
1199 1 0 0 $doc_rule or @doc_lines
1278 0 0 0 $rule_i->{'param'} || $rule_i->{'optional'} || $rule_i->{'mandatory'}
0 1 0 $rule_i->{'type'} eq "param" and $search_for eq ($rule_i->{'param'} || $rule_i->{'optional'} || $rule_i->{'mandatory'}) or $rule_i->{'type'} eq "include" and $search_for eq $rule_i->{'ruleset'}
1306 369 4 2 $DIRECTIVE{$key} or $ERROR_MSG{$key}
1324 3 5 244 $key eq "split" or $key eq "list"
0 7 237 $key eq "error" or $key eq "errmsg"
1327 104 4 0 $CATEGORY{$type} eq "param" or $type eq "content_type"
1346 3 1 0 $CLEANER_DEF{$value} || $value
1447 33 4 120 $type eq "optional" or $type eq "mandatory"
1558 0 0 4 ref $typevalue or not $typevalue =~ /\w/
1571 3 6 1 $long ||= $MEDIA_TYPE{$short}
1619 125 5 82 defined $rr or @lines
1651 0 0 4 $last_pod or $this_pod
1734 0 0 0 $list_level > 0 or $is_item_body
1913 1 0 77 !ref($context) || builtin::reftype($context) ne 'HASH'
2034 0 0 76 ref $ruleset_name or not $ruleset_name =~ /\w/
2089 141 0 4 exists $vr->{'ps'}{$key} or exists $vr->{'ig'}{$key}
2143 1 230 29 $rr->{'key'} || $param
2149 5 7 33 $rr->{'type'} eq "together" or $rr->{'type'} eq "at_most_one"
2193 0 0 2 $rr->{'multiple'} || $rr->{'split'} || $rr->{'list'}
2197 0 0 1 $rr->{'optional'} or $rr->{'mandatory'}
2231 0 0 2 $rr->{'optional'} or $rr->{'mandatory'}
2338 0 7 0 $rr->{'ERR_INVALID'} || $rr->{'errmsg'} || $result->{'error'}
2347 0 18 0 $rr->{'ERR_INVALID'} || $rr->{'errmsg'} || $result->{'error'}
2442 31 5 98 $rr->{'optional'} or $rr->{'mandatory'}
2463 0 2 0 $rr->{'key'} || $param
2540 3 1 0 $rr->{'constraint'} eq 'require_one' || $rr->{'constraint'} eq 'require_any'
0 2 0 $rr->{'constraint'} eq 'allow_one' || $rr->{'constraint'} eq 'require_one'
2581 0 4 0 $rr->{'key'} || $rr->{'param'}
2636 4 0 0 $rr->{$msg} || $vr->{'settings'}{$msg} || $ERROR_MSG{$msg} || $ERROR_MSG{'ERR_DEFAULT'}
2675 0 0 0 $rr->{$msg} || $vr->{'settings'}{$msg} || $ERROR_MSG{$msg} || $ERROR_MSG{'ERR_DEFAULT'}
3098 8 6 1 not defined $min or $min =~ /^[+-]?\d+$/
3099 9 5 0 not defined $max or $max =~ /^[+-]?\d+$/
3101 6 0 8 defined $min or defined $max
3140 3 1 4 $value < $min || $value > $max
3165 6 0 8 defined $min or defined $max
3194 4 4 1 !ref($pattern) || ref $pattern eq 'Regexp'