Branch Coverage

lib/File/Information/Base.pm
Criterion Covered Total %
branch 46 306 15.0


line true false branch
210 0 4 unless defined $self->{'instance'}
228 0 64 unless (defined $info)
229 0 0 if exists $opts{'default'}
239 34 30 if (!defined($pv->{$key}) || ref $pv->{$key} eq 'HASH' && !scalar(%{$pv->{$key};}) and defined(my $loader = $info->{'loader'}))
240 0 34 unless ref $loader
246 4 60 if ($opts{'list'}) { }
0 60 elsif (ref $v eq 'ARRAY') { }
251 0 4 if (ref $v eq 'ARRAY') { }
259 0 0 if (defined $val) { }
267 0 0 if ($error) { }
268 0 0 if defined $default
277 0 4 if (defined $val) { }
280 4 0 if defined $default
296 0 48 if (not defined $res and defined $rawtype and defined(my $raw = $v->{'raw'}))
297 0 0 if ($rawtype eq $as) { }
0 0 elsif ($rawtype eq 'unixts' and $as eq 'DateTime') { }
0 0 elsif ($rawtype eq 'unixts' and $as eq 'Data::Identifier') { }
0 0 elsif ($rawtype eq 'ise' and defined(my $re = $_ise_re{$as})) { }
0 0 elsif ($_data_identifier_keys{$rawtype} and $as eq 'Data::Identifier') { }
0 0 elsif ($_ise_keys{$rawtype} and $as eq 'Data::URIID::Result') { }
0 0 elsif ($rawtype eq 'filename' and $as eq 'File::Information::Link') { }
0 0 elsif ($rawtype eq 'filename' and $as eq 'IO::Handle' || $as eq 'IO::File') { }
0 0 elsif (exists $_ise_re{$rawtype} and $as eq 'Data::TagDB::Tag' and $self->instance->db) { }
306 0 0 if $raw =~ /$re/u
320 0 0 if defined $res and not $as =~ /^IO::/u
323 0 60 if (not defined $res and builtin::blessed($v->{'raw'}))
328 0 48 if (not defined $res and $as eq "sid" and defined(my $identifier = $v->{'Data::Identifier'}))
329 0 0 if defined($res = eval {
333 16 32 if (not defined $res || defined $v->{'ise'} and defined $rawtype and $rawtype eq "ise")
336 48 0 unless (defined $res or defined $v->{'ise'})
338 0 144 if defined($v->{'ise'} = $v->{$key})
339 0 78 if defined $rawtype and $rawtype eq $key and defined($v->{'ise'} = $v->{'raw'})
342 0 60 if (not defined $res || defined $v->{'ise'} and ($rawtype // "") eq "mediatype")
345 48 0 unless (defined $res or defined $v->{'ise'})
347 0 192 if (defined(my $obj = $v->{$source_type}))
348 0 0 if defined($v->{'ise'} = eval {
350 0 104 if (defined $rawtype and $rawtype eq $source_type and defined(my $obj = $v->{'raw'}))
351 0 0 if defined($v->{'ise'} = eval {
356 60 0 unless defined $v->{'ise'}
359 0 60 if (not defined $res and defined(my $ise = $v->{'ise'}))
360 0 0 if ($as eq 'Data::Identifier') { }
0 0 elsif ($as eq 'Data::URIID::Result') { }
0 0 elsif ($as eq 'Data::TagDB::Tag' and $self->instance->db) { }
0 0 elsif (defined(my $re = $_ise_re{$as})) { }
0 0 elsif ($as eq 'sid') { }
0 0 elsif ($as eq 'mediatype') { }
366 0 0 if ($ise =~ /$_ise_re{$type}/u)
367 0 0 if $res = eval {
371 0 0 if $ise =~ /$re/u
379 0 0 if defined $res and not $as =~ /^IO::/u
382 12 48 if defined $res
384 48 0 if exists $opts{'default'}
394 0 0 unless ($self->{'property_info'})
404 0 0 unless scalar @algos
406 0 0 if not wantarray and scalar @algos != 1
409 0 0 unless $self->{'property_info'}{$_}
413 0 0 if (wantarray) { }
431 0 0 unless ($key =~ /^[a-z]+-[0-9]+-[1-9][0-9]*$/u)
441 0 0 if (not defined $value and $lifecycle eq "current" and $self->isa("File::Information::Inode") and not $opts{'no_defaults'})
445 0 0 if (defined $size and $limit == -1 || $size <= $limit)
449 0 0 if ($key eq 'md-5-128') { }
0 0 elsif ($key eq 'sha-1-160') { }
0 0 elsif ($key eq 'ripemd-1-160') { }
0 0 elsif ($key =~ /^sha-2-(224|256|384|512)$/u) { }
0 0 elsif ($key =~ /^sha-3-(224|256|384|512)$/u) { }
467 0 0 if (defined $digest)
471 0 0 if (defined $fh)
480 0 0 unless (defined $value)
481 0 0 if exists $opts{'default'}
485 0 0 if ($as eq 'hex') { }
0 0 elsif ($as eq 'binary') { }
0 0 elsif ($as eq 'base64' or $as eq 'b64') { }
0 0 elsif ($as eq 'base64_padded') { }
0 0 elsif ($as eq 'utag') { }
0 0 elsif ($as eq 'Digest') { }
496 0 0 if (defined(my $size = $self->get("size", "lifecycle", $lifecycle, "default", undef)))
497 0 0 if ($size > 0) { }
528 0 0 ref $opts{'subobjects'} eq 'ARRAY' ? :
529 0 0 $self->isa('File::Information::Inode') ? :
538 0 0 if (ref $opts{'lifecycle'} eq 'ARRAY') { }
0 0 elsif (defined $opts{'lifecycle'}) { }
547 0 0 $self->isa('File::Information::' . ucfirst($subobject)) ? :
550 0 0 if ($subobject eq 'inode') { }
0 0 elsif ($subobject eq 'filesystem') { }
0 0 elsif ($subobject eq 'tagpool') { }
553 0 0 if (defined(my $contentise = $base->get("contentise", "default", undef, "as", "Data::Identifier", "lifecycle", $lifecycle)))
559 0 0 if (defined(my $mediatype = $base->get("mediatype", "default", undef, "as", "Data::Identifier", "lifecycle", $lifecycle)))
564 0 0 if (defined(my $size = $base->get("size", "default", undef, "lifecycle", $lifecycle)))
573 0 0 if (defined(my $size = $base->get("fetchurl", "default", undef, "lifecycle", $lifecycle)))
579 0 0 if (defined(my $tagpoolise = $base->get("tagpool_file_uuid", "as", "Data::Identifier", "default", undef, "lifecycle", $lifecycle)))
590 0 0 $l eq 'final' ? :
593 0 0 if $states{$contentise->ise}
600 0 0 if (defined(my $value = $base->get($key, "default", undef, "lifecycle", $lifecycle)))
605 0 0 if (defined(my $description_url = $base->get("tagpool_file_original_description_url", "default", undef, "lifecycle", $lifecycle)))
606 0 0 if (defined(my $result = eval {
613 0 0 if (ref $tag) { }
627 0 0 if (defined(my $ise = $base->get("ise", "default", undef, "as", "Data::Identifier", "lifecycle", $lifecycle)))
631 0 0 if (defined(my $label = $base->get("dev_disk_by_label", "default", undef, "lifecycle", $lifecycle)))
636 0 0 $base ? :
637 0 0 if (defined(my $ise = $tagpool->get("ise", "default", undef, "as", "Data::Identifier", "lifecycle", $lifecycle)))
643 0 0 if (defined(my $ise = $base->get("ise", "default", undef, "as", "Data::Identifier", "lifecycle", $lifecycle)))
675 0 0 unless ($as // "") eq "File::FStore"
676 0 0 if scalar keys %opts
725 0 0 if $end != $size - 1
726 0 0 if length($hash) * 4 != $bits
727 0 0 if $type eq "v0" and length $mark
730 0 0 unless $given_size == $size
753 0 8 unless defined $info and defined $info->{'sources'}
756 0 40 if ($source eq ':self') { }
16 24 elsif ($source =~ /^::/u) { }
0 24 elsif (not defined $current) { }
0 24 elsif ($source =~ /^([a-z]+)\((.+)\)$/u) { }
761 12 4 if ($self->isa('File::Information' . $source)) { }
4 0 elsif ($source eq '::Inode') { }
0 0 elsif ($source eq '::Filesystem') { }
0 0 elsif ($source eq '::Deep') { }
777 0 0 if (defined $value and eval {
778 0 0 if (defined(my $c = $value->can($func)))
783 0 0 if (defined $value and not ref $value and $value =~ /$re/u)
784 0 0 if (defined $pv->{$key} and defined $info->{'towards'})
785 0 0 if $value xor $info->{'towards'}
794 24 0 unless defined $current->get($source, %opts, "default", undef, "as", "raw")
798 0 0 if (defined $value_ref and defined $pv->{$key} and defined $info->{'towards'})
799 0 0 if $value_ref->{'raw'} xor $info->{'towards'}
805 0 0 if not defined $info->{'towards'} and defined $pv->{$key} and scalar keys %{$$pv{$key};}
813 2 2 $self->isa('File::Information::Inode') ? :
816 0 4 unless defined $info
818 4 0 if (defined $inode)
827 4 0 unless ($v)
843 0 0 unless defined $size
852 0 0 if $self->{'_loaded_data_tagdb'}
855 0 0 if (defined(my $db = eval {
875 0 0 if (defined(my $displayname = $tag->displayname("default", undef, "no_defaults", 1)))
898 0 0 if (defined(my $relation = $wk->final_file_hash))
905 0 0 if defined $given_size
909 0 0 if (scalar @size_values)
912 0 0 if ($given_size != $size)
917 0 0 defined $given_size ? :
922 0 0 if (ref $pv_final->{$key} eq "ARRAY" and scalar @{$pv_final->{$key};} == 1)
933 4 4 if $self->{'_loaded_fstore_base'}
945 0 0 if defined $properties->{'size'}
946 0 0 if defined $properties->{'inode'}
947 0 0 if defined $properties->{'mediasubtype'}
948 0 0 if defined $properties->{'contentise'}
949 0 0 if defined $properties->{'inodeise'}
959 0 32 if (defined(my $v = $pv_final->{$key}))
960 0 0 if (scalar @{$v;} > 1)
965 0 0 if (scalar @{$v;} == 1)
972 0 0 if (defined $pv_final->{'store_final'} and $pv_final->{'store_final'}{'raw'})
989 0 0 if scalar keys %opts
991 0 0 if ($class eq "properties_name")
995 0 0 if (ref $pkg) { }
1008 0 0 if ($as eq 'Data::Identifier' and not scalar keys %opts) { }