Branch Coverage

blib/lib/JSON/Relaxed/Parser.pm
Criterion Covered Total %
branch 150 244 61.4


line true false branch
58 0 2 if @_
59 0 2 if @_
60 0 0 if @_
76 0 95 unless defined $data and length $data
84 0 95 if $self->is_error
87 0 95 unless @tokens
286 190 431 $typ eq 'Q' ? :
186 621 $typ eq 'U' || $typ eq 'N' ? :
309 0 170 if $opts{'tokens'}
311 163 7 if ($implied_outer_hash and not $strict)
313 5 106 if (@tokens > 2 and $tokens[0]->is_string and $tokens[1]->token =~ /[:={]/u)
324 55 115 if ($this->is_string) { }
329 56 59 if ($t eq '{') { }
59 0 elsif ($t eq '[') { }
342 3 1 if ($opts{'top'} and @tokens and $strict || !$extra_tokens_ok and not $self->is_error)
357 4 0 $aux ? :
360 0 4 if $croak_on_error_internal
371 0 0 unless require DDP
372 0 0 if (-t STDERR) { }
394 55 92 if ($t eq "}")
395 2 2 if $key_order and not $strict and @ko > 1
401 13 79 if $t eq ","
406 79 0 if ($this->is_string) { }
412 6 73 if ($key_order)
413 6 0 if ($combined_keys and not $strict) { }
423 0 79 unless defined $next
426 0 79 if $next->token eq "," or $next->token eq "}"
430 75 4 if ($next->token =~ /^[:=]$/u) { }
4 0 elsif ($prp and $next->token eq '{') { }
435 0 75 unless @tokens
441 1 74 if $self->is_error
450 0 4 if $self->is_error
481 56 23 if ($this->is_string) { }
23 0 elsif ($this->is_list_opener) { }
496 137 18 unless $combined_keys and not $strict and $key =~ /\./su
502 0 36 if (/^[+-]?\d+$/u) { }
522 58 299 if $t eq "]"
526 88 211 if ($t eq ',' and !$strict || @$rv) { }
52 159 elsif ($this->is_list_opener) { }
158 1 elsif ($this->is_string) { }
533 0 52 unless defined $object
543 158 0 if (@tokens)
550 0 46 unless ($next->token =~ /^[,\]]$/u or $next->is_string or $next->is_list_opener)
570 0 0 unless $pretok eq "//"
587 0 17 if ($strict)
591 0 17 if $schema
603 10 0 unless $p->{$topic}
604 0 0 unless $did++
611 5 12 unless ($level)
619 0 25 unless (defined $str)
623 1 24 if (UNIVERSAL::isa($str, "JSON::Boolean") or UNIVERSAL::isa($str, "JSON::PP::Boolean"))
638 0 0 ord $1 < 65535 ? :
24 0 unless $nouesc
641 7 11 if ($v ne $str or $v =~ /^$p_number$/u and 0 + $v ne $v or $v =~ /$p_reserved/u or $v =~ /$p_quotes/u or $v =~ /\s/u or $v =~ /^(true|false|null)$/u or not length $v)
652 13 0 unless ($v =~ /\"/u)
655 0 0 unless ($v =~ /\'/u)
658 0 0 unless ($v =~ /\`/u)
670 0 4 unless @$rv
679 2 2 unless $pretty
682 2 0 if ($i + length(join $", @v) < 72 and not join("", @v) =~ /\s|$p_newlines/u)
697 0 8 unless keys %$rv
702 3 5 if ($level or not $impoh)
703 1 2 $pretty ? :
709 2 6 $rv->{' key order '} ? :
718 8 2 if length $_ > $ll
726 0 10 if ($props->{$k})
728 0 0 if $comment
740 3 7 if $pretty
746 0 10 $comment ? :
750 3 7 $r ? :
753 3 7 if (ref $r eq 'HASH') { }
4 3 elsif (ref $r eq 'ARRAY') { }
0 3 elsif ($pretty) { }
755 1 2 if ($pretty) { }
0 2 elsif (not $prpmode) { }
756 1 0 $prpmode ? :
766 2 2 $pretty ? :
775 0 0 if ($t =~ /^["'`].*\\n/u) { }
788 0 0 if @a
790 0 0 if @a
802 3 7 if $pretty
806 6 2 unless $pretty
809 3 5 if ($level or not $impoh) { }
811 1 2 if $pretty
823 0 17 $r ? :
826 5 12 if (ref $r eq 'HASH') { }
0 12 elsif (ref $r eq 'ARRAY') { }
838 1 16 if ($pretty and not $level)
840 1 0 unless $s =~ /\n$/u
851 0 0 if (is_hash($d)) { }
0 0 elsif (is_array($d)) { }
853 0 0 if ($k eq 'allOf') { }
0 0 elsif ($k eq 'oneOf' or $k eq 'anyOf') { }
0 0 elsif ($k eq '$ref') { }
863 0 0 if ($v =~ m[^#/definitions/(.*)]u) { }
889 0 0 unless $right
897 0 0 if ($hr and $hl) { }
912 0 123 if @_
913 0 1023 if @_
914 0 0 if @_
915 0 18 if @_
922 76 158 if $type eq "C"
931 0 0 if (not defined $token) { }
0 0 elsif ($self->is_string) { }
1018 0 0 if @_
1023 11 14 if defined $quote
1052 307 58 unless $str =~ /\\/u
1056 3 557 if (defined $1)
1057 3 0 defined $quote ? :
1061 7 550 if defined $2
1064 8 542 if defined $3
1069 14 528 if defined $5
1072 528 0 if defined $6
1078 58 0 unless defined pos $str
1107 50 113 if $options{'always_string'}
1110 14 99 if ($content =~ /^(?:true|false)$/u)
1111 9 5 $content eq 'true' ? :
1113 4 95 if ($self->parent->prp and $content =~ /^(?:on|off)$/u) { }
4 91 elsif ($content eq 'null') { }
1114 2 2 $content eq 'on' ? :
1143 4 4 ${$_[0];} ? :
1149 0 0 if (${$_[0];}) { }