Condition Coverage

blib/lib/JSONLD.pm
Criterion Covered Total %
condition 55 747 7.3


and 2 conditions

line l !l condition
115 0 0 ref $out_ctx eq 'HASH' and scalar @{[keys %$out_ctx];}
0 0 ref $out_ctx eq 'ARRAY' and scalar @$out_ctx

and 3 conditions

line !l l&&!r l&&r condition
104 0 0 0 ref $context eq 'HASH' and exists $context->{'@context'}
139 0 0 0 ref $ec eq 'HASH' and exists $ec->{'@context'}
234 0 1 0 scalar @keys == 1 and $keys[0] eq '@graph'
296 0 0 3 $is_str && !$is_num
325 0 0 0 defined $i->scheme && $value eq $i->abs
366 6 0 0 defined $container_mapping && $container_mapping eq $value
462 0 0 0 $as_array and ref $value ne 'ARRAY'
553 0 1 0 ref $localCtx eq 'HASH' and exists $localCtx->{'@propagate'}
577 0 0 0 not $override_protected and $self->_ctx_contains_protected_terms($activeCtx)
606 0 0 0 not $validate_scoped_context and $already{$context}
708 1 0 0 exists $context->{'@base'} and scalar @$remote_contexts == 0
714 0 0 0 $self->_is_iri($value) and defined $result->{'@base'}
780 0 0 0 $value ne 'ltr' and $value ne 'rtl'
795 0 0 0 $p ne '1' and $p ne '0'
0 0 0 $p ne '1' and $p ne '0' and ref $p ne 'JSON::PP::Boolean'
865 0 0 0 $self->processing_mode eq 'json-ld-1.1' and $term eq '@type'
872 0 0 0 scalar @keys == 1 and $keys[0] eq '@container'
913 0 0 0 not exists $value->{'@protected'} and $protected
935 0 0 0 $type eq '@json' || $type eq '@none' and $self->processing_mode eq 'json-ld-1.0'
941 0 0 0 $type ne '@id' and $type ne '@vocab'
0 0 0 $type ne '@id' and $type ne '@vocab' and $type ne '@none'
0 0 0 $type ne '@id' and $type ne '@vocab' and $type ne '@none' and $type ne '@json'
0 0 0 $type ne '@id' and $type ne '@vocab' and $type ne '@none' and $type ne '@json' and not $self->_is_abs_iri($type)
981 0 0 0 $c ne '@set' and $c ne '@index'
0 0 0 $c ne '@set' and $c ne '@index' and defined $c
1002 0 0 0 exists $value->{'@id'} and !defined($value->{'@id'}) || $value->{'@id'} ne $term
1015 0 0 0 defined $id and not exists $keywords{$id}
0 0 0 defined $id and not exists $keywords{$id} and $id =~ /^\@[A-Za-z]+$/u
1042 0 0 0 not $term =~ m[[:/]]u and $simple_term
0 0 0 not $term =~ m[[:/]]u and $simple_term and $definition->{'iri_mapping'} =~ m[[][:/?#@]$]u
1098 0 0 0 &any(sub {
1139 0 0 0 $tm ne '@id' and $tm ne '@vocab'
1183 0 0 0 exists $value->{'@language'} and not exists $value->{'@type'}
1187 0 0 0 defined $language and ref $language
1197 0 0 0 exists $value->{'@direction'} and not exists $value->{'@type'}
1202 0 0 0 $direction ne 'ltr' and $direction ne 'rtl'
1219 0 0 0 exists $keywords{$nv} and $nv ne '@nest'
1240 0 0 0 $definition->{'prefix_flag'} and exists $keywords{$definition->{'iri_mapping'}}
1252 0 0 0 not $override_protected and $previous_defn->{'protected'}
1369 0 0 0 exists $tdef->{'language_mapping'} and exists $tdef->{'direction_mapping'}
1374 0 0 0 defined $tdef->{'language_mapping'} and defined $tdef->{'direction_mapping'}
1515 1 1 0 defined $activeProp and $activeProp eq '@default'
1523 2 0 0 $tdef and exists $tdef->{'@context'}
1565 0 0 0 $self->_cm_contains($container_mapping, '@list') and ref $expandedItem eq 'ARRAY'
1594 0 0 0 scalar @keys == 1 and $self->_5_2_2_iri_expansion($activeCtx, $keys[0], 'vocab', 1) eq '@id'
1605 0 0 0 $tdef and exists $tdef->{'__source_base_iri'}
1681 1 0 0 exists $result->{'@type'} and ref $result->{'@type'} ne 'ARRAY'
1698 0 0 0 defined $result->{'@type'} and $result->{'@type'} eq '@json'
0 0 0 ref $result->{'@value'} eq 'ARRAY' and not scalar @{$result->{'@value'};}
0 0 0 ref $result->{'@value'} and exists $result->{'@language'}
0 0 0 exists $result->{'@type'} and not $self->_is_iri($result->{'@type'})
1733 0 0 0 scalar @keys == 1 and $keys[0] eq '@index'
1745 0 1 0 scalar @keys == 1 and $keys[0] eq '@language'
1755 0 1 0 ref $result eq 'HASH' and scalar @keys == 0 || exists $result->{'@value'} || exists $result->{'@list'}
0 0 1 ref $result eq 'HASH' and scalar @keys == 1
0 1 0 ref $result eq 'HASH' and scalar @keys == 1 and $keys[0] eq '@id'
1802 0 1 0 defined $expandedProperty and $expandedProperty =~ /:/u || exists $keywords{$expandedProperty}
1812 0 0 0 defined $activeProp and $activeProp eq '@reverse'
1819 0 0 0 $expandedProperty ne '@included' and $expandedProperty ne '@type'
1842 0 0 0 $is_array && &all(sub {
1848 0 0 0 ref $value eq 'HASH' and scalar %$value == 0
1960 0 0 0 $value ne 'ltr' and $value ne 'rtl'
2021 0 0 0 ref $expandedValue eq 'HASH' and exists $expandedValue->{'@reverse'}
2095 0 0 0 not defined $expandedValue and $expandedProperty eq '@value'
0 0 0 not defined $expandedValue and $expandedProperty eq '@value' and $input_type ne '@json'
2113 1 0 0 exists $tdef->{'type_mapping'} and $tdef->{'type_mapping'} eq '@json'
1 0 0 $self->_cm_contains($container_mapping, '@language') and ref $value eq 'HASH'
1 0 0 $self->_cm_contains_any($container_mapping, '@index', '@type', '@id') and ref $value eq 'HASH'
2157 0 0 0 $item ne '@none' and not $well_formed
2202 0 0 0 $self->_cm_contains_any($container_mapping, '@type') and exists $index_tdef->{'@context'}
2227 0 0 0 $self->_cm_contains($container_mapping, '@graph') and not $self->_is_graph_object($item)
2234 0 0 0 $self->_cm_contains($container_mapping, '@index') and $index_key ne '@index'
0 0 0 $self->_cm_contains($container_mapping, '@index') and $index_key ne '@index' and $expanded_index ne '@none'
0 0 0 $self->_cm_contains($container_mapping, '@index') and not exists $item->{'@index'}
0 0 0 $self->_cm_contains($container_mapping, '@index') and not exists $item->{'@index'} and $expanded_index ne '@none'
0 0 0 $self->_cm_contains($container_mapping, '@id') and not exists $item->{'@id'}
0 0 0 $self->_cm_contains($container_mapping, '@id') and not exists $item->{'@id'} and $expanded_index ne '@none'
0 0 0 $self->_cm_contains($container_mapping, '@type') and $expanded_index ne '@none'
2299 1 0 0 $self->_cm_contains($container_mapping, '@list') and not $self->_is_list_object($expandedValue)
2309 1 0 0 $self->_cm_contains($container_mapping, '@graph') and not $self->_cm_contains($container_mapping, '@id')
1 0 0 $self->_cm_contains($container_mapping, '@graph') and not $self->_cm_contains($container_mapping, '@id') and not $self->_cm_contains($container_mapping, '@index')
2458 0 2 4 defined $value and not exists $keywords{$value}
2469 0 4 0 defined $localCtx and my $v = $localCtx->{$value}
2484 1 3 0 $vocab and my $tdef = $self->_ctx_term_defn($activeCtx, $value)
2501 0 0 0 $localCtx and exists $localCtx->{$prefix}
0 0 0 $localCtx and exists $localCtx->{$prefix} and not $defined->{$prefix}
2507 0 0 0 $tdef and $tdef->{'iri_mapping'}
0 0 0 $tdef and $tdef->{'iri_mapping'} and $tdef->{'prefix_flag'}
2519 1 0 2 $vocab and exists $activeCtx->{'@vocab'}
2549 0 0 0 $tdef->{'type_mapping'} eq '@id' and _is_string($value)
2555 0 0 0 $tdef->{'type_mapping'} eq '@vocab' and _is_string($value)
2566 1 0 0 exists $tdef->{'type_mapping'} and $tm ne '@id'
1 0 0 exists $tdef->{'type_mapping'} and $tm ne '@id' and $tm ne '@vocab'
0 0 0 exists $tdef->{'type_mapping'} and $tm ne '@id' and $tm ne '@vocab' and $tm ne '@none'
2640 0 0 0 scalar @$result == 1 and $not_graph && $not_set || !$self->_cm_contains_any($container_mapping, '@list', '@set') && $compactArrays
2655 0 0 0 scalar @keys == 1 and $keys[0] eq '@id'
2683 0 0 0 _is_list_object($element) and $self->_cm_contains($container_mapping, '@list')
2691 0 0 0 defined $activeProp && $activeProp eq '@reverse'
2724 0 0 0 $expandedProperty eq '@index' and $self->_cm_contains($container_mapping, '@index')
2823 0 0 0 ref $expandedValue eq 'ARRAY' and scalar @$expandedValue == 0
2840 0 0 0 ref $expandedValue eq 'ARRAY' and scalar @$expandedValue == 0
2908 0 0 0 (ref $expandedItem ne 'HASH' || !exists $expandedItem->{'@list'}) && !($self->_is_graph_object($expandedItem) && exists $expandedItem->{'@list'})
2932 0 0 0 $self->_cm_contains_any($container, '@language', '@index', '@id', '@type') and not $self->_cm_contains($container, '@graph')
2934 0 0 0 $self->_cm_contains($container, '@graph') and $self->_cm_contains($container, '@id')
0 0 0 $self->_cm_contains($container, '@graph') and $self->_cm_contains($container, '@index')
0 0 0 $self->_cm_contains($container, '@graph') and $self->_cm_contains($container, '@index') and $self->_is_simple_graph_object($expandedItem)
0 0 0 $container eq '@graph' and $self->_is_simple_graph_object($expandedItem)
2956 0 0 0 ref $compactedItem eq 'ARRAY' and scalar @$compactedItem > 1
3005 0 0 0 $self->_cm_contains_any($container, '@language') and exists $expandedItem->{'@value'}
0 0 0 $self->_cm_contains_any($container, '@index') and $index_key eq '@index'
0 0 0 $self->_cm_contains_any($container, '@index') and $index_key ne '@index'
3041 0 0 0 scalar @keys == 1 and $keys[0] eq '@id'
3056 0 0 0 not $compactArrays and $as_array
0 0 0 not $compactArrays and $as_array and ref $compactedItem ne 'ARRAY'
3108 0 0 0 $vocab and exists $inverseCtx->{$var}
3124 0 0 0 ref $value eq 'HASH' and exists $value->{'@preserve'}
3136 0 0 0 ref $value eq 'HASH' and exists $value->{'@index'}
0 0 0 ref $value eq 'HASH' and exists $value->{'@index'} and not $self->_is_graph_object($value)
3189 0 0 0 $item_language ne $common_language and exists $item->{'@value'}
3205 0 0 0 $common_language eq '@none' and $common_type eq '@none'
3265 0 0 0 exists $value->{'@direction'} and not exists $value->{'@index'}
0 0 0 exists $value->{'@language'} and not exists $value->{'@index'}
3296 0 0 0 ref $value eq 'HASH' && exists $value->{'@index'}
0 0 0 $self->processing_mode ne 'json-ld-1.0' and not ref $value eq 'HASH' && exists $value->{'@index'}
3303 0 0 0 $self->processing_mode ne 'json-ld-1.0' and scalar @keys == 1
0 0 0 $self->processing_mode ne 'json-ld-1.0' and scalar @keys == 1 and $keys[0] eq '@value'
3321 0 0 0 $type_language_value eq '@id' || $type_language_value eq '@reverse' and ref $value eq 'HASH'
0 0 0 $type_language_value eq '@id' || $type_language_value eq '@reverse' and ref $value eq 'HASH' and exists $value->{'@id'}
3326 0 0 0 $tdef and $tdef->{'iri_mapping'} eq $value->{'@id'}
3336 0 0 0 $self->_is_list_object($value) and not scalar @{$value->{'@list'};}
3360 0 0 0 $vocab and exists $activeCtx->{'@vocab'}
3363 0 0 0 substr($var, 0, length $vm) eq $vm and length $var > length $vm
3384 0 0 0 exists $tdef->{'prefix_flag'} && $tdef->{'prefix_flag'}
3398 0 0 0 length $candidate == length $compact_iri && ($candidate cmp $compact_iri) == -1
3402 0 0 0 $shorter || $less and $no_tdef
0 0 0 exists $cand_tdef->{'iri_mapping'} and $cand_tdef->{'iri_mapping'} eq $var
0 0 0 exists $cand_tdef->{'iri_mapping'} and $cand_tdef->{'iri_mapping'} eq $var and not defined $value
3421 0 0 0 $scheme_tdef and $scheme_tdef->{'prefix_flag'}
0 0 0 $scheme_tdef and $scheme_tdef->{'prefix_flag'} and substr($var, length($scheme) + 1, 2) ne '//'
3472 0 0 0 exists $value->{'@id'} and scalar @keys == 0
0 0 0 exists $value->{'@type'} and $value->{'@type'} eq $type_mapping
0 0 0 exists $value->{'@type'} and $value->{'@type'} ne $type_mapping
3494 0 0 0 scalar @keys == 1 and $keys[0] eq '@value'
0 0 0 exists $value->{'@index'} and $self->_cm_contains($container_mapping, '@index')
3527 0 0 0 $lang_cmp_1 and $dir_cmp_1
3529 0 0 0 exists $value->{'@index'} and $self->_cm_contains($container_mapping, '@index')
3601 0 0 0 ref $element and ref $element ne 'HASH'
3788 0 0 0 defined $ident and exists $self->identifier_map->{$ident}
3849 0 0 0 $property =~ /^_:(.*)$/u and not $produce_genrdf
3909 0 0 0 $self->_is_node_object($item) and not $self->_is_well_formed_graph_node($item->{'@id'})
3936 0 0 0 defined $datatype and not $self->_is_well_formed_datatype($datatype)
3942 0 0 0 exists $item->{'@language'} and not $self->_is_well_formed_language($item->{'@language'})
3948 0 0 0 defined $datatype and $datatype eq '@json'
3966 0 0 0 $is_int && length $int_repr >= 22 && $int_repr =~ /^[^-+0]/u
3967 0 0 0 $is_num and $double_or_not_int
3996 0 0 0 exists $item->{'@direction'} and defined(my $dir = $self->rdf_direction)

or 2 conditions

line l !l condition
91 0 0 shift() // {}
114 0 0 $context->{'@context'} || {}
228 1 0 shift() // {}
256 0 0 $args{'compactArrays'} //= 1
257 0 0 $args{'compactToRelative'} //= 1
258 0 0 $args{'ordered'} //= 0
461 0 0 $args{'as_array'} // 0
544 0 1 $args{'propagate'} // 1
545 0 1 $args{'remote_contexts'} // []
546 0 1 $args{'validate_scoped_context'} // 1
547 0 1 $args{'override_protected'} // 0
826 0 0 shift() // {}
834 0 0 $args{'protected'} // 0
835 0 0 $args{'override_protected'} // 0
836 0 0 $args{'remote_contexts'} // []
837 0 0 $args{'validate_scoped_context'} // 1
1304 0 0 $tdef->{'container_mapping'} || []
1337 0 0 $tdef->{'type_mapping'} // ''
1507 1 1 $args{'frameExpansion'} // 0
1508 1 1 $args{'ordered'} // 0
1509 0 2 $args{'fromMap'} // 0
2081 0 0 $nests->{$key} //= []
2185 0 0 $tdef->{'index_mapping'} // '@index'
2447 4 2 $args{'vocab'} // 0
2448 1 5 $args{'documentRelative'} // 0
2449 0 6 $args{'localCtx'} // {}
2450 0 6 $args{'defined'} // {}
2477 0 0 $tdef->{'iri_mapping'} // ''
2608 0 0 $args{'compactArrays'} // 0
2609 0 0 $args{'ordered'} // 0
2634 0 0 $activeProp // ''
2635 0 0 $activeProp // ''
2675 0 0 $tdef->{'type_mapping'} // ''
2721 0 0 $self->_ctx_term_defn($activeCtx, $activeProp) || {}
2887 0 0 $result->{$nest_term} // {}
2937 0 0 $nest_result->{$item_active_property} //= {}
2940 0 0 $expandedItem->{'@id'} // '@none'
2947 0 0 $nest_result->{$item_active_property} //= {}
2950 0 0 $expandedItem->{'@index'} // '@none'
2991 0 0 $nest_result->{$item_active_property} //= {}
3001 0 0 $self->_ctx_term_defn($activeCtx, $item_active_property) // {}
3002 0 0 $tdef->{'index_mapping'} // '@index'
3093 0 0 $args{'vocab'} || 0
3094 0 0 $args{'reverse'} || 0
3173 0 0 $item->{'@language'} // ''
3267 0 0 $value->{'@language'} // ''
3384 0 0 $iri_mapping // ''
3470 0 0 $tdef->{'type_mapping'} // ''
3504 0 0 $value->{'@language'} // ''
3559 0 0 shift() // 0
3569 0 0 shift() // '@default'
3585 0 0 $map->{$activeGraph} ||= {}
3814 0 0 $args{'produceGeneralizedRdf'} || 0
4000 0 0 $item->{'@language'} // ''
4043 0 0 $item->{'@language'} // ''

or 3 conditions

line l !l&&r !l&&!r condition
115 0 0 0 ref $out_ctx eq 'HASH' and scalar @{[keys %$out_ctx];} or ref $out_ctx eq 'ARRAY' and scalar @$out_ctx
295 0 0 3 $flags & 512 || $flags & 256
313 0 0 0 $flags & 512 || $flags & 256
520 0 0 0 $self->_is_abs_iri($value) || $value eq '@default' || $value =~ /^_:(\w+)$/u
548 0 1 0 $args{'base_iri'} // $self->base_iri->abs
558 1 0 0 $propagate or exists $result->{'previous_context'}
735 0 1 0 $value =~ /^_/u or $self->_is_iri($value)
838 0 0 0 $args{'base_iri'} // $self->base_iri->abs
935 0 0 0 $type eq '@json' || $type eq '@none'
954 0 0 0 exists $value->{'@id'} or exists $value->{'@nest'}
971 0 0 0 $self->_is_abs_iri($m) or $m =~ /^:/u
1002 0 0 0 !defined($value->{'@id'}) || $value->{'@id'} ne $term
1022 0 0 0 exists $keywords{$iri} or $self->_is_abs_iri($iri)
0 0 0 exists $keywords{$iri} or $self->_is_abs_iri($iri) or $iri =~ /:/u
1030 0 0 0 $term =~ /.:./u or index($term, '/') >= 0
1118 0 0 0 &any(sub {
1149 0 0 0 $self->processing_mode eq 'json-ld-1.0' or not $self->_cm_contains($container_mapping, '@index')
1219 0 0 0 not defined $nv or ref $nv
1229 0 0 0 $self->processing_mode eq 'json-ld-1.0' or $term =~ m[[:/]]u
1533 0 0 1 not defined $activeProp or $activeProp eq '@graph'
1681 0 0 1 exists $result->{'@set'} or exists $result->{'@list'}
1692 0 0 0 exists $result->{'@language'} or exists $result->{'@direction'}
1698 0 0 0 not defined $result->{'@value'} or ref $result->{'@value'} eq 'ARRAY' and not scalar @{$result->{'@value'};}
1751 1 0 0 not defined $activeProp or $activeProp eq '@graph'
1755 0 0 1 scalar @keys == 0 || exists $result->{'@value'} || exists $result->{'@list'}
1802 1 0 0 $expandedProperty =~ /:/u || exists $keywords{$expandedProperty}
1828 0 0 0 ref $value or not defined $value
1843 0 0 0 $is_string or $is_array_of_strings
1915 0 0 0 _is_scalar($value) || !defined($value)
1988 0 0 0 not defined $activeProp or $activeProp eq '@graph'
2059 0 0 0 $self->_is_value_object($item) or $self->_is_list_object($item)
2163 0 0 0 $language eq '@none' or $expandedLanguage eq '@none'
2196 0 0 0 $activeCtx->{'previous_context'} // $activeCtx
2344 0 0 0 $self->_is_value_object($item) or $self->_is_list_object($item)
2405 0 0 0 not ref $nested_values or ref $nested_values ne 'ARRAY'
2496 0 1 0 $prefix eq '_' or $suffix =~ m[^//]u
2640 0 0 0 $not_graph && $not_set || !$self->_cm_contains_any($container_mapping, '@list', '@set') && $compactArrays
2672 0 0 0 exists $element->{'@value'} or exists $element->{'@id'}
2676 0 0 0 _is_scalar($v) or $tm eq '@json'
2903 0 0 0 $self->_cm_contains($container_mapping, '@set') || $item_active_property eq '@graph' || $item_active_property eq '@list'
3321 0 0 0 $type_language_value eq '@id' || $type_language_value eq '@reverse'
3384 0 0 0 not defined $tdef or ($iri_mapping // '') eq $var
0 0 0 not defined $tdef or ($iri_mapping // '') eq $var or not $iri_is_prefix
0 0 0 not defined $tdef or ($iri_mapping // '') eq $var or not $iri_is_prefix or not exists $tdef->{'prefix_flag'} && $tdef->{'prefix_flag'}
3402 0 0 0 $shorter || $less
3472 0 0 0 $type_mapping eq '@none' or exists $value->{'@type'} and $value->{'@type'} ne $type_mapping
3505 0 0 0 defined $value->{'@language'} || defined $language
3506 0 0 0 $lang_both_undef || defined $vlang && defined $language && lc $vlang eq lc $language
3507 0 0 0 defined $language || exists $value->{'@language'}
3509 0 0 0 defined $value->{'@direction'} || defined $direction
3510 0 0 0 $dir_both_undef || $dir eq $direction
3511 0 0 0 defined $direction || exists $value->{'@direction'}
3529 0 0 0 exists $value->{'@index'} and $self->_cm_contains($container_mapping, '@index') or not exists $value->{'@index'}
3965 0 0 0 !$is_int || defined $datatype && $datatype eq 'http://www.w3.org/2001/XMLSchema#double'
3967 0 0 0 $is_large_int or $is_num and $double_or_not_int