Condition Coverage

blib/lib/JSON/Validator.pm
Criterion Covered Total %
condition 161 190 84.7


and 2 conditions

line l !l condition
433 0 6882 push @refs, [$topic, $base] and next
598 0 24 push @errors, [$i, @e] and next
617 0 28 push @passed, $i and next
619 0 12 push @errors, [$i, @e] and next

and 3 conditions

line !l l&&!r l&&r condition
67 6 6 3 $from_type eq 'HASH' and $tied = tied %$from
78 91 52 35 $from_type eq 'HASH' && tied %$from
87 1 26 8 not $args->{'schema'} and $tied->fqn =~ /^\Q$self->{'root_schema_url'}\E\#/
154 3 0 267 not $self->{'version'} and $schema =~ /draft-0+(\w+)/
279 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 13618 6 6882 $topic->{'$ref'} and not ref $topic->{'$ref'}
435 13065 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[^/]
503 65 4014 819 ref $schema eq 'HASH' and $schema->{'$ref'}
515 4407 120 4 &blessed($data) && $data->can('TO_JSON')
582 13 93 1 not @errors and @expected
721 77 147 4 defined $schema->{'minItems'} and $schema->{'minItems'} > @$data
725 218 7 3 defined $schema->{'maxItems'} and $schema->{'maxItems'} < @$data
778 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)$/
820 32 3 50 $self->{'coerce'}{'numbers'} and $value =~ /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/
830 357 12 10 $d and ($value / $d) =~ /\.[^0]+$/
845 1347 4 2 defined $schema->{'maxProperties'} and $schema->{'maxProperties'} < @dkeys
849 1346 4 3 defined $schema->{'minProperties'} and $schema->{'minProperties'} > @dkeys
870 28011 2 48 $self->{'coerce'}{'defaults'} and ref $r eq 'HASH'
28013 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}
906 29 1942 637 ref $r eq 'HASH' and $r->{'$ref'}
929 459 0 22 B::svref_2object(\$value)->FLAGS & 12288 and 0 + $value eq $value
459 0 22 B::svref_2object(\$value)->FLAGS & 12288 and 0 + $value eq $value and $value * 0 == 0

or 2 conditions

line l !l condition
21 0 48 $ENV{'JSON_VALIDATOR_DEBUG'} || 0
22 0 48 $ENV{'JSON_VALIDATOR_RECURSION_LIMIT'} || 100
91 15 12 _node($schema, $path, 1, 0) || {}
126 5 0 $self->{'coerce'} ||= {}
153 2 268 $args->{'schema'} || 'http://json-schema.org/draft-04/schema#'
347 49 36 $$node{$path->[$n]} ||= {}
383 6965 898 $self->{'level'} || 0
386 7289 0 $schema // ''
387 2 572 $schema->{$id_key} // ''
637 6 373 $schema->{'exclusiveMaximum'} // ''
661 14 365 $schema->{'exclusiveMinimum'} // ''
747 5 12 $schema->{'additionalItems'} // {'type', 'any'}
812 254 177 $expected ||= 'number'
863 2 0 $schema->{'else'} // {}
2 0 $schema->{'then'} // {}
890 1253 696 $rules{$_} ||= [$additional]

or 3 conditions

line l !l&&r !l&&!r condition
116 15 186 7 $to->{$key} //= &$cloner($from->{$key})
138 4 14 0 $short->{$_} or $_
180 48 862 7 $schema ||= $self->schema->data
228 0 3 1 $self->{'bundled_refs'}{$ref->fqn} or not $node
3 1 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 572 $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
518 2626 242 1663 $schema->{'type'} || schema_type($schema, $data)
576 1 15 2 not $schema_type or $schema_type eq $type
598 12 12 103 not $schema_type or $schema_type eq $type
619 2 10 19 not $schema_type or $schema_type eq $type
691 0 12 100 !defined($_) || ref $_
778 10 17 3 B::svref_2object(\$value)->FLAGS & 12288 || $value =~ /^(true|false)$/
814 3 14 414 not defined $value or ref $value
909 130 30 2448 @e or not is_type($r, 'HASH')
926 4 12 481 not defined $value or ref $value