Branch Coverage

scripts/jsonvalidate
Criterion Covered Total %
branch 48 152 31.5


line true false branch
96 0 1 if $opt_errors->length
97 0 1 if ($main::opts->{'quiet'})
113 0 0 if $LOG_LEVEL >= 5
117 1 0 unless ($LOG_LEVEL)
119 0 1 if $VERBOSE
120 0 1 if $DEBUG
130 3 0 if ref $main::opts->{$action} eq "CODE"
131 0 0 if ($main::opts->{$action} and $action_found and $action_found ne $action) { }
0 0 elsif ($main::opts->{$action} and not length $action_found) { }
138 0 0 unless "main"->can($action)
142 1 0 unless ($action_found)
148 0 1 if (@errors)
152 0 0 unless ($main::opts->{'quiet'})
167 0 1 exists $dict->{$action_found}{'code'} && ref $dict->{$action_found}{'code'} eq 'CODE' ? :
168 0 1 unless (defined $coderef)
173 1 0 &$coderef() ? :
191 0 1 if (not $sf->exists) { }
0 1 elsif ($sf->is_empty) { }
202 0 1 unless ($data)
215 0 1 if (not defined $main::opts->{'schema_base'} and defined $root_schema_path)
223 0 1 if ($main::opts->{'extensions'})
240 0 1 $main::opts->{'compile'} ? :
0 1 $main::opts->{'content_checks'} ? :
0 1 $main::opts->{'extensions'} ? :
0 1 $main::opts->{'ignore_vocab'} ? :
1 0 $main::opts->{'normalize'} ? :
0 1 $main::opts->{'trace'} ? :
0 1 $main::opts->{'unique_keys'} ? :
245 0 1 if ($main::opts->{'register_formats'})
252 0 1 if ($main::opts->{'content_checks'})
265 0 1 if (ref $s eq "HASH" and defined $s->{'$id'})
282 0 0 if (exists $by_id{$abs_uri} or exists $by_id{$doc_uri})
285 0 0 $by_id{$abs_uri} ? :
290 0 0 if ($main::opts->{'allow_file_refs'} and defined $main::opts->{'schema_base'})
293 0 0 if (not $doc_uri =~ /^[a-zA-Z][a-zA-Z0-9+.-]*:/u) { }
0 0 elsif ($doc_uri =~ m[^file://]iu) { }
296 0 0 if ($path->exists)
306 0 0 if ($path->exists)
316 0 0 if ($doc_uri =~ m[^https?://]iu)
320 0 0 if ($should_fetch) { }
324 0 0 if defined $doc
335 0 0 if ($path->exists and $path->is_file)
370 0 1 if ($main::opts->{'instance'}->is_empty) { }
372 0 0 if ($main::opts->{'jsonl'}) { }
377 0 0 if $line =~ /\A\s*\z/u
394 0 1 if (not $inst_file->exists) { }
0 1 elsif ($inst_file->is_empty) { }
404 0 1 unless (defined $raw)
410 1 0 if ($main::opts->{'jsonl'}) { }
417 1 4 if $line =~ /\A\s*\z/u
431 0 1 if ($main::opts->{'emit_js'}) { }
0 1 elsif (not $main::opts->{'quiet'} || $main::opts->{'json'}) { }
433 0 0 $main::opts->{'ecma'} ? :
450 0 0 $total_fail ? :
458 0 1 $total_fail ? :
459 0 1 $total_fail ? :
465 0 1 unless length($exit // "") and $exit =~ /^\d+$/u
480 0 4 unless (eval {
497 0 0 if ($res->is_success)
504 0 0 unless (eval {
514 1 0 if defined $p and $p->exists
522 0 0 if &_is_tty
539 5 0 if ($_[0] =~ /^\d{1,2}$/u) { }
547 5 0 if not $LOG_LEVEL or $LOG_LEVEL < $required_level
548 0 0 ref $_ eq 'CODE' ? :
549 0 0 if (index($msg, "</>") != -1)
569 0 0 if (length $sub) { }
584 0 0 if (ref $data eq 'ARRAY') { }
603 4 0 if ($main::opts->{'json'}) { }
605 2 2 if ($ok) { }
619 0 2 unless $js->errors
630 0 0 if ($ok) { }
632 0 0 unless ($main::opts->{'quiet'} or $main::opts->{'errors_only'} or $main::opts->{'emit_js'})
641 0 0 unless ($main::opts->{'quiet'})
659 2 2 if $ok
667 0 0 if (uc $sig eq 'TERM') { }