Branch Coverage

blib/lib/Image/ExifTool/XMPStruct.pl
Criterion Covered Total %
branch 230 378 60.8


line true false branch
34 0 0 if (ref $obj eq 'HASH') { }
0 0 elsif (ref $obj eq 'ARRAY') { }
0 0 elsif (defined $obj) { }
36 0 0 $obj->{'_ordered_keys_'} ? :
47 0 0 if ref $obj eq "SCALAR"
49 0 0 $ket ? :
71 13 91 if ($$obj =~ s/^\s*\{//) { }
5 86 elsif ($$obj =~ s/^\s*\[//) { }
76 0 19 if $w and not $warn
77 0 19 unless defined $v
80 12 7 unless $$obj =~ s/^\s*,//s
83 0 13 unless ($$obj =~ s/^\s*\}//s or $warn)
84 0 0 if (length $$obj) { }
87 0 0 if length $part > 30
98 0 9 if $w and not $warn
99 0 9 unless defined $v
101 5 4 unless $$obj =~ s/^\s*,//s
104 0 5 unless $$obj =~ s/^\s*\]//s or $warn
110 22 64 $delim ? :
112 0 86 unless $$obj =~ s/^(.*?)($delim)//s
114 60 26 unless $2
115 26 0 unless $2 eq "|"
116 0 0 if $$obj =~ s/^(.)//s
130 8 0 if ($tag =~ /^(\w+)[-_]([a-z]{2,3}|[xi])([-_][a-z\d]{2,8}([-_][a-z\d]{1,8})*)?$/i) { }
133 2 0 length $3 == 3 ? :
2 6 if $3
135 0 8 if lc $langCode eq "x-default"
150 0 0 unless $indent
151 0 0 if (ref $obj eq 'HASH') { }
0 0 elsif (ref $obj eq 'ARRAY') { }
185 0 0 wantarray ? :
0 51 unless ref $struct eq "HASH"
193 3 82 if $tag =~ s/#$//
194 85 0 unless $Image::ExifTool::XMP::specialStruct{$tag}
196 44 41 unless ($fieldInfo)
199 29 15 if $fix and not $Image::ExifTool::XMP::specialStruct{$fix}
203 10 5 unless ($strTable->{'NAMESPACE'})
205 5 5 $tag =~ /^(.+):(.+)/ ? :
206 0 10 if $grp eq "XMP"
210 3 7 unless (@matches)
212 3 0 if defined $langCode
218 18 10 unless $grps[0] eq "XMP"
219 0 10 if $grp and $grp ne lc $grps[1]
221 0 10 if defined $langCode and not $ti->{'Writable'} && $ti->{'Writable'} eq 'lang-alt'
223 0 10 if $ti->{'Avoid'}
224 0 10 if defined $priority and $priority >= $pri
229 0 10 unless $tagInfo
232 5 5 if $grp
233 3 7 if $langCode
239 10 0 unless $fieldInfo
249 5 0 if (defined $langCode)
250 5 0 unless $Image::ExifTool::XMP::specialStruct{$tg}
251 1 4 unless ($fieldInfo)
253 1 0 if $fix and not $Image::ExifTool::XMP::specialStruct{$fix}
255 5 0 if (ref $fieldInfo eq "HASH" and $fieldInfo->{'Writable'} and $fieldInfo->{'Writable'} eq "lang-alt")
259 5 0 if $langCode
262 5 0 unless $fieldInfo
273 10 75 if (ref $struct->{$key} eq 'HASH') { }
13 62 elsif (ref $struct->{$key} eq 'ARRAY') { }
0 62 elsif ($fieldInfo->{'Struct'}) { }
274 0 10 unless $fieldInfo->{'Struct'}
277 0 10 if $err
280 0 13 unless $fieldInfo->{'List'}
285 13 8 if (not ref $item) { }
8 0 elsif (ref $item eq 'HASH') { }
286 0 13 unless defined $item
287 2 11 if ($fieldInfo->{'Struct'}) { }
289 0 2 unless $item =~ /^\s*$/
294 0 11 unless defined $copy[$i]
295 0 11 if $err
297 0 11 if $err
300 0 8 unless $fieldInfo->{'Struct'}
302 0 8 if $err
315 0 62 if $err
316 0 62 unless defined $val
318 0 62 if $err
320 2 60 $fieldInfo->{'List'} ? :
323 51 0 if (%copy or not $warn) { }
326 0 51 if $warn
330 51 0 wantarray ? :
349 4 192 if @structPaths
351 4 192 if ($nvHash->{'DelValue'}) { }
2 190 elsif (@structPaths) { }
352 4 0 if (@{$nvHash->{'DelValue'};})
357 4 0 unless ref $val eq "HASH"
359 0 0 unless &AddNewStruct(undef, undef, \%cap, $$pathPt, $val, $strTable)
361 0 0 if ($p =~ / /) { }
368 0 0 unless $p2 =~ /^($pp)/
371 0 0 if ($attr->{'xml:lang'})
373 0 0 unless $a2->{'xml:lang'} and $a2->{'xml:lang'} eq $attr->{'xml:lang'}
375 0 0 if ($capture->{$p2} and $capture->{$p2}[0] eq $cap{$p}[0])
384 0 0 unless $match{$p} == $num
387 0 0 if $p2 =~ /^$p/
390 0 0 if not $delPath or $delPath gt $p
399 2 194 if (@delPaths) { }
145 49 elsif ($nvHash->{'TagInfo'}{'List'}) { }
401 0 2 if $verbose > 1
403 0 6 if ($verbose > 1)
405 0 0 unless $Image::ExifTool::XMP::stdXlatNS{$1}
412 0 2 unless $delPath
416 1 144 if (@structPaths) { }
417 0 1 unless $structPaths[-1] =~ /^($pp)/
420 0 1 if ($capture->{$path})
423 0 0 if ref $cap ne "ARRAY" or $cap->[0]
427 0 1 unless $path =~ /.* (\d+)/g
452 2 69 if ($tagInfo->{'Resource'})
456 20 51 if ($tagInfo->{'Writable'} and $tagInfo->{'Writable'} eq "lang-alt")
462 8 12 if ($i)
470 0 71 if ($et and $et->Options("Verbose") > 1)
472 0 0 unless $Image::ExifTool::XMP::stdXlatNS{$1}
487 50 0 $et ? :
495 3 47 unless %$struct
499 3 82 unless ($fieldInfo)
500 0 3 unless $tag eq "~dummy~"
505 37 48 unless ($propPath)
507 7 30 if ($fieldInfo->{'List'})
510 7 30 if ($fieldInfo->{'Writable'} and $fieldInfo->{'Writable'} eq "lang-alt")
517 10 75 if (ref $val eq 'HASH') { }
15 60 elsif (ref $val eq 'ARRAY') { }
518 0 10 unless my $subStruct = $fieldInfo->{'Struct'}
521 0 15 unless $fieldInfo->{'List'}
527 8 15 if ($i) { }
536 10 13 if (ref $item eq 'HASH') { }
11 2 elsif (length $item or defined $item and $level == 1) { }
537 0 10 unless my $subStruct = $fieldInfo->{'Struct'}
538 0 10 unless &AddNewStruct($et, $tagInfo, $capture, $p, $item, $subStruct)
555 1 0 if ($addedTag and $fieldInfo->{'StructType'} and $fieldInfo->{'Table'})
560 3 47 if ($strTable->{'TYPE'} and $changed)
562 3 0 unless ($capture->{$path})
564 0 3 if ($verbose > 1)
566 0 0 unless $Image::ExifTool::XMP::stdXlatNS{$1}
583 108 96 if (ref $value eq 'HASH') { }
66 30 elsif (ref $value eq 'ARRAY') { }
586 70 38 unless $parentID
590 16 196 unless ($flatInfo)
592 13 3 if ($key =~ /^XMP-(.*?:)(.*)/)
596 13 3 unless $flatInfo
599 48 164 if (ref $v) { }
604 212 0 if defined $v
608 0 66 if (defined $et->{'OPTIONS'}{'ListItem'}) { }
610 0 0 unless defined $value->[$li]
619 98 0 if defined $v
641 989 1337 unless $tagExtra->{$key}
642 1008 329 unless my $structProps = $tagExtra->{$key}{'Struct'}
649 151 178 @$structProps ? :
650 326 3 if ($strInfo) { }
651 0 326 unless ref $strInfo eq "HASH"
652 0 326 if (@$structProps and not $strInfo->{'Struct'})
656 0 0 unless $et->{'NO_STRUCT_WARN'}
664 3 0 if ($tag =~ /(.+):(.+)/)
668 0 3 if $Image::ExifTool::XMP::stdXlatNS{$ns}
677 3 0 if (@$structProps) { }
0 0 elsif ($tagInfo->{'LangCode'}) { }
679 3 0 if @$structProps
698 216 363 if ($index and not @$structProps)
700 90 126 if ($writable eq "lang-alt")
702 67 23 if @$prop < 2
705 24 192 if ($tagInfo->{'LangCode'} and not ref $tag)
710 276 303 if (defined $index) { }
713 160 116 if ($nextStruct) { }
714 0 160 unless ref $nextStruct eq "ARRAY"
722 0 0 if ($nextStruct) { }
723 0 0 unless ref $nextStruct eq "ARRAY"
732 61 215 if (ref $nextStruct eq 'HASH') { }
66 149 elsif (@$structProps) { }
743 93 210 if ($nextStruct) { }
30 180 elsif (@$structProps) { }
744 0 93 unless ref $nextStruct eq "HASH"
753 0 250 unless $prop = shift @$structProps
755 17 233 if ($tag =~ /(.+):(.+)/) { }
760 3 14 if $Image::ExifTool::XMP::stdXlatNS{$ns}
766 0 329 if ($err) { }
178 151 elsif ($tagInfo eq $strInfo) { }
769 0 0 unless ($et->{'NO_STRUCT_WARN'})
773 0 0 unless $oldStruct
776 75 103 if ($oldStruct)
781 75 0 if ($k)
782 44 31 if ($k lt $key)
784 3 41 if $fileOrder->{$k} > $fileOrder->{$key}
788 6 25 if $fileOrder->{$key} > $fileOrder->{$k}
797 104 47 if ($var{$strInfo}) { }
799 34 70 if ($var{$strInfo}[1] > $fileOrder->{$key})
806 81 70 if ($keepFlat) { }
807 0 81 unless my $extra = $tagExtra->{$key}
809 6 75 if ($extra->{'NoList'}) { }
8 67 elsif ($extra->{'NoListDel'}) { }
835 0 47 if ($valueHash->{$key})
838 0 0 unless $valueHash->{$key} eq $structs{$si}
843 47 0 unless ($found)