Condition Coverage

blib/lib/JSON/Validator.pm
Criterion Covered Total %
condition 162 190 85.2


and 2 conditions

line l !l condition
433 0 6882 push @refs, [$topic, $base] and next
607 0 28 push @errors, [$i, @e] and next
626 0 30 push @passed, $i and next
628 0 18 push @errors, [$i, @e] and next

and 3 conditions

line !l l&&!r l&&r condition
69 6 6 3 $from_type eq 'HASH' and $tied = tied %$from
80 91 54 35 $from_type eq 'HASH' && tied %$from
89 1 26 8 not $args->{'schema'} and $tied->fqn =~ /^\Q$self->{'root_schema_url'}\E\#/
156 3 0 267 not $self->{'version'} and $schema =~ /draft-0+(\w+)/
281 0 1 0 $url =~ m[^/] and $self->ua->server->app
324 15 0 2 $tx->error && $tx->error->{'message'}
328 4 11 0 $cache_path and $cache_path ne $BUNDLED_CACHE_DIR || $ENV{'JSON_VALIDATOR_CACHE_ANYWAYS'}
11 0 0 $cache_path and $cache_path ne $BUNDLED_CACHE_DIR || $ENV{'JSON_VALIDATOR_CACHE_ANYWAYS'} and -w $cache_path
433 13697 6 6882 $topic->{'$ref'} and not ref $topic->{'$ref'}
435 13144 271 288 $topic->{$id_key} and not ref $topic->{$id_key}
482 86 4407 2472 length $location and not length $pointer
487 2469 18 4475 defined $pointer and length $pointer
2487 3 4472 defined $pointer and length $pointer and $pointer =~ m[^/]
502 65 4073 819 ref $schema eq 'HASH' and $schema->{'$ref'}
514 4466 120 4 &blessed($data) && $data->can('TO_JSON')
591 14 96 1 not @errors and @expected
730 86 147 4 defined $schema->{'minItems'} and $schema->{'minItems'} > @$data
734 224 9 4 defined $schema->{'maxItems'} and $schema->{'maxItems'} < @$data
787 3 48 30 defined $value and $self->{'coerce'}{'booleans'}
48 11 19 defined $value and $self->{'coerce'}{'booleans'} and B::svref_2object(\$value)->FLAGS & 12288 || $value =~ /^(true|false)$/
829 32 3 50 $self->{'coerce'}{'numbers'} and $value =~ /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/
839 358 12 10 $d and ($value / $d) =~ /\.[^0]+$/
854 1350 4 2 defined $schema->{'maxProperties'} and $schema->{'maxProperties'} < @dkeys
858 1349 4 3 defined $schema->{'minProperties'} and $schema->{'minProperties'} > @dkeys
873 28027 2 48 $self->{'coerce'}{'defaults'} and ref $r eq 'HASH'
28029 28 20 $self->{'coerce'}{'defaults'} and ref $r eq 'HASH' and exists $r->{'default'}
28 2 18 $self->{'coerce'}{'defaults'} and ref $r eq 'HASH' and exists $r->{'default'} and not exists $data->{$k}
923 29 1948 637 ref $r eq 'HASH' and $r->{'$ref'}
946 499 0 22 B::svref_2object(\$value)->FLAGS & 12288 and 0 + $value eq $value
499 0 22 B::svref_2object(\$value)->FLAGS & 12288 and 0 + $value eq $value and $value * 0 == 0

or 2 conditions

line l !l condition
22 0 49 $ENV{'JSON_VALIDATOR_DEBUG'} || 0
23 0 49 $ENV{'JSON_VALIDATOR_RECURSION_LIMIT'} || 100
93 15 12 _node($schema, $path, 1, 0) || {}
128 5 0 $self->{'coerce'} ||= {}
155 2 268 $args->{'schema'} || 'http://json-schema.org/draft-04/schema#'
347 51 34 $$node{$path->[$n]} ||= {}
383 6965 911 $self->{'level'} || 0
386 7290 0 $schema // ''
387 2 584 $schema->{$id_key} // ''
569 7 0 $rules // {}
646 6 374 $schema->{'exclusiveMaximum'} // ''
670 14 366 $schema->{'exclusiveMinimum'} // ''
756 5 12 $schema->{'additionalItems'} // {'type', 'any'}
821 254 178 $expected ||= 'number'
893 1260 695 $rules{$_} ||= [$additional]
906 773 577 $schema->{'dependencies'} || {}

or 3 conditions

line l !l&&r !l&&!r condition
118 15 188 7 $to->{$key} //= &$cloner($from->{$key})
140 4 14 0 $short->{$_} or $_
182 48 875 7 $schema ||= $self->schema->data
230 0 1 3 $self->{'bundled_refs'}{$ref->fqn} or not $node
1 3 0 $self->{'bundled_refs'}{$ref->fqn} or not $node or not $node->{$key}
4 0 0 $self->{'bundled_refs'}{$ref->fqn} or not $node or not $node->{$key} or data_checksum($ref->schema) eq data_checksum($node->{$key})
328 0 0 11 $cache_path ne $BUNDLED_CACHE_DIR || $ENV{'JSON_VALIDATOR_CACHE_ANYWAYS'}
403 274 29 584 $schema->{$id_key} // $id
407 289 11 2 $rid =~ /^\w+:/ or -e $rid
300 0 2 $rid =~ /^\w+:/ or -e $rid or $rid =~ m[^/]
478 6866 0 6965 not $ref or ref $ref
517 2650 270 1670 $schema->{'type'} || schema_type($schema, $data)
585 1 16 2 not $schema_type or $schema_type eq $type
607 12 16 103 not $schema_type or $schema_type eq $type
628 2 16 19 not $schema_type or $schema_type eq $type
700 0 12 100 !defined($_) || ref $_
787 10 17 3 B::svref_2object(\$value)->FLAGS & 12288 || $value =~ /^(true|false)$/
823 3 14 415 not defined $value or ref $value
926 130 30 2454 @e or not is_type($r, 'HASH')
943 4 12 521 not defined $value or ref $value