Branch Coverage

blib/lib/Image/ExifTool/XMPStruct.pl
Criterion Covered Total %
branch 237 418 56.7


line true false branch
40 0 0 if (ref $obj eq 'HASH') { }
0 0 elsif (ref $obj eq 'ARRAY') { }
0 0 elsif (defined $obj) { }
0 0 elsif ($sfmt) { }
43 0 0 $sfmt ? :
53 0 0 if ref $obj eq "SCALAR"
55 0 0 if ($sfmt) { }
58 0 0 $ket ? :
85 13 96 if ($$obj =~ s/^\s*\{//) { }
5 91 elsif ($$obj =~ s/^\s*\[//) { }
88 0 20 $sfmt ? :
1 19 unless $sfmt ? $$obj =~ s/^\s*"(.*?)"\s*://s : $$obj =~ s/^\s*([-\w:.]+#?)\s*=//s
92 0 19 if $w and not $warn
93 0 19 unless defined $v
96 12 7 unless $$obj =~ s/^\s*,//s
99 0 13 unless ($$obj =~ s/^\s*\}//s or $warn)
100 0 0 if (length $$obj) { }
103 0 0 if length $part > 30
114 0 9 if $w and not $warn
115 0 9 unless defined $v
117 5 4 unless $$obj =~ s/^\s*,//s
120 0 5 unless $$obj =~ s/^\s*\]//s or $warn
124 0 91 if ($sfmt) { }
125 0 0 if ($$obj =~ s/^"//) { }
0 0 elsif ($$obj =~ s/^(true|false)\b//) { }
0 0 elsif ($$obj =~ s/^([+-]?(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?)//) { }
129 0 0 unless $val =~ /([\\]+)$/ and length $1 & 1
132 0 0 if ($val =~ s/^base64://) { }
136 0 0 unless $jsonEsc{$1}
143 0 0 unless $warn
148 22 69 $delim ? :
151 0 91 unless $$obj =~ s/^(.*?)($delim)//s
153 64 27 unless $2
154 27 0 unless $2 eq "|"
155 0 0 if $$obj =~ s/^(.)//s
169 0 0 unless ($quote)
170 0 0 unless defined $str
172 0 0 if $str =~ /^(true|false)$/i
176 0 0 if $str =~ /^-?(\d|[1-9]\d{1,14})(\.\d{1,16})?(e[-+]?\d{1,3})?$/i
178 0 0 unless defined $str
180 0 0 if &Image::ExifTool::IsUTF8(\$str) < 0
197 8 0 if ($tag =~ /^(\w+)[-_]([a-z]{2,3}|[xi])([-_][a-z\d]{2,8}([-_][a-z\d]{1,8})*)?$/i) { }
200 2 0 length $3 == 3 ? :
2 6 if $3
202 0 8 if lc $langCode eq "x-default"
217 0 0 unless $indent
218 0 0 if (ref $obj eq 'HASH') { }
0 0 elsif (ref $obj eq 'ARRAY') { }
252 0 0 wantarray ? :
0 51 unless ref $struct eq "HASH"
256 0 51 if $struct->{'_ordered_keys_'}
262 3 82 if $tag =~ s/#$//
263 85 0 unless $Image::ExifTool::XMP::specialStruct{$tag}
265 44 41 unless ($fieldInfo)
268 29 15 if $fix and not $Image::ExifTool::XMP::specialStruct{$fix}
272 10 5 unless ($strTable->{'NAMESPACE'})
274 5 5 $tag =~ /^(.+):(.+)/ ? :
275 0 10 if $grp eq "XMP"
279 3 7 unless (@matches)
281 3 0 if defined $langCode
287 24 10 unless $grps[0] eq "XMP"
288 0 10 if $grp and $grp ne lc $grps[1]
290 0 10 if defined $langCode and not $ti->{'Writable'} && $ti->{'Writable'} eq 'lang-alt'
292 0 10 if $ti->{'Avoid'}
293 0 10 if defined $priority and $priority >= $pri
298 0 10 unless $tagInfo
301 5 5 if $grp
302 3 7 if $langCode
308 10 0 unless $fieldInfo
318 5 0 if (defined $langCode)
319 5 0 unless $Image::ExifTool::XMP::specialStruct{$tg}
320 1 4 unless ($fieldInfo)
322 1 0 if $fix and not $Image::ExifTool::XMP::specialStruct{$fix}
324 5 0 if (ref $fieldInfo eq "HASH" and $fieldInfo->{'Writable'} and $fieldInfo->{'Writable'} eq "lang-alt")
328 5 0 if $langCode
331 5 0 unless $fieldInfo
342 10 75 if (ref $struct->{$key} eq 'HASH') { }
13 62 elsif (ref $struct->{$key} eq 'ARRAY') { }
0 62 elsif ($fieldInfo->{'Struct'}) { }
343 0 10 unless $fieldInfo->{'Struct'}
346 0 10 if $err
349 0 13 unless $fieldInfo->{'List'}
354 13 8 if (not ref $item) { }
8 0 elsif (ref $item eq 'HASH') { }
355 0 13 unless defined $item
356 2 11 if ($fieldInfo->{'Struct'}) { }
358 0 2 unless $item =~ /^\s*$/
363 0 11 unless defined $copy[$i]
364 0 11 if $err
366 0 11 if $err
369 0 8 unless $fieldInfo->{'Struct'}
371 0 8 if $err
385 0 62 if $err
386 0 62 unless defined $val
388 0 62 if $err
390 2 60 $fieldInfo->{'List'} ? :
392 0 85 if $copy{'_ordered_keys_'}
394 51 0 if (%copy or not $warn) { }
397 0 51 if $warn
401 51 0 wantarray ? :
420 4 213 if @structPaths
422 4 213 if ($nvHash->{'DelValue'}) { }
2 211 elsif (@structPaths) { }
423 4 0 if (@{$nvHash->{'DelValue'};})
428 4 0 unless ref $val eq "HASH"
430 0 0 unless &AddNewStruct(undef, undef, \%cap, $$pathPt, $val, $strTable)
432 0 0 if ($p =~ / /) { }
439 0 0 unless $p2 =~ /^($pp)/
442 0 0 if ($attr->{'xml:lang'})
444 0 0 unless $a2->{'xml:lang'} and $a2->{'xml:lang'} eq $attr->{'xml:lang'}
446 0 0 if ($capture->{$p2} and $capture->{$p2}[0] eq $cap{$p}[0])
455 0 0 unless $match{$p} == $num
458 0 0 if $p2 =~ /^$p/
461 0 0 if not $delPath or $delPath gt $p
470 2 215 if (@delPaths) { }
160 55 elsif ($nvHash->{'TagInfo'}{'List'}) { }
472 0 2 if $verbose > 1
474 0 6 if ($verbose > 1)
476 0 0 unless $Image::ExifTool::XMP::stdXlatNS{$1}
483 0 2 unless $delPath
487 1 159 if (@structPaths) { }
488 0 1 unless $structPaths[-1] =~ /^($pp)/
491 0 1 if ($capture->{$path})
494 0 0 if ref $cap ne "ARRAY" or $cap->[0]
498 0 1 unless $path =~ /.* (\d+)/g
523 2 69 if ($tagInfo->{'Resource'})
527 20 51 if ($tagInfo->{'Writable'} and $tagInfo->{'Writable'} eq "lang-alt")
533 8 12 if ($i)
541 0 71 if ($et and $et->Options("Verbose") > 1)
543 0 0 unless $Image::ExifTool::XMP::stdXlatNS{$1}
558 50 0 $et ? :
566 3 47 unless %$struct
570 3 82 unless ($fieldInfo)
571 0 3 unless $tag eq "~dummy~"
576 37 48 unless ($propPath)
578 7 30 if ($fieldInfo->{'List'})
581 7 30 if ($fieldInfo->{'Writable'} and $fieldInfo->{'Writable'} eq "lang-alt")
588 10 75 if (ref $val eq 'HASH') { }
15 60 elsif (ref $val eq 'ARRAY') { }
589 0 10 unless my $subStruct = $fieldInfo->{'Struct'}
592 0 15 unless $fieldInfo->{'List'}
598 8 15 if ($i) { }
607 10 13 if (ref $item eq 'HASH') { }
11 2 elsif (length $item or defined $item and $level == 1) { }
608 0 10 unless my $subStruct = $fieldInfo->{'Struct'}
609 0 10 unless &AddNewStruct($et, $tagInfo, $capture, $p, $item, $subStruct)
626 1 0 if ($addedTag and $fieldInfo->{'StructType'} and $fieldInfo->{'Table'})
631 3 47 if ($strTable->{'TYPE'} and $changed)
633 3 0 unless ($capture->{$path})
635 0 3 if ($verbose > 1)
637 0 0 unless $Image::ExifTool::XMP::stdXlatNS{$1}
654 108 96 if (ref $value eq 'HASH') { }
66 30 elsif (ref $value eq 'ARRAY') { }
657 70 38 unless $parentID
658 2 106 if $value->{'_ordered_keys_'}
662 16 196 unless ($flatInfo)
664 13 3 if ($key =~ /^XMP-(.*?:)(.*)/)
668 13 3 unless $flatInfo
671 48 164 if (ref $v) { }
676 212 0 if (defined $v)
679 4 208 if $struct{'_ordered_keys_'}
684 0 66 if (defined $et->{'OPTIONS'}{'ListItem'}) { }
686 0 0 unless defined $value->[$li]
695 98 0 if defined $v
717 1997 329 unless my $structProps = $tagExtra->{$key}{'Struct'}
724 151 178 @$structProps ? :
725 326 3 if ($strInfo) { }
726 0 326 unless ref $strInfo eq "HASH"
727 0 326 if (@$structProps and not $strInfo->{'Struct'})
731 0 0 unless $et->{'NO_STRUCT_WARN'}
739 3 0 if ($tag =~ /(.+):(.+)/)
743 0 3 if $Image::ExifTool::XMP::stdXlatNS{$ns}
752 3 0 if (@$structProps) { }
0 0 elsif ($tagInfo->{'LangCode'}) { }
754 3 0 if @$structProps
773 216 363 if ($index and not @$structProps)
775 90 126 if ($writable eq "lang-alt")
777 67 23 if @$prop < 2
780 24 192 if ($tagInfo->{'LangCode'} and not ref $tag)
785 276 303 if (defined $index) { }
788 160 116 if ($nextStruct) { }
789 0 160 unless ref $nextStruct eq "ARRAY"
797 0 0 if ($nextStruct) { }
798 0 0 unless ref $nextStruct eq "ARRAY"
807 61 215 if (ref $nextStruct eq 'HASH') { }
66 149 elsif (@$structProps) { }
818 93 210 if ($nextStruct) { }
30 180 elsif (@$structProps) { }
819 0 93 unless ref $nextStruct eq "HASH"
828 0 250 unless $prop = shift @$structProps
830 17 233 if ($tag =~ /(.+):(.+)/) { }
835 3 14 if $Image::ExifTool::XMP::stdXlatNS{$ns}
841 0 329 if ($err) { }
178 151 elsif ($tagInfo eq $strInfo) { }
844 0 0 unless ($et->{'NO_STRUCT_WARN'})
848 0 0 unless $oldStruct
851 75 103 if ($oldStruct)
856 75 0 if ($k)
857 51 24 if ($k lt $key)
859 3 48 if $fileOrder->{$k} > $fileOrder->{$key}
863 8 16 if $fileOrder->{$key} > $fileOrder->{$k}
872 104 47 if ($var{$strInfo}) { }
874 28 76 if ($var{$strInfo}[1] > $fileOrder->{$key})
881 81 70 if ($keepFlat) { }
884 6 75 if ($extra->{'NoList'}) { }
8 67 elsif ($extra->{'NoListDel'}) { }
910 0 47 if ($valueHash->{$key})
913 0 0 unless $valueHash->{$key} eq $structs{$si}
918 47 0 unless ($found)