Branch Coverage

lib/Data/URIID/Service.pm
Criterion Covered Total %
branch 22 198 11.1


line true false branch
289 7 4 if defined $res
643 108 108 if (defined $name)
652 108 108 if ($list != \@displaycolours)
685 1037 1642 if ($src != $dst)
719 0 0 unless $self->_is_online
721 0 0 unless $func
732 14 12 unless $func
747 0 0 if (scalar @_ == 2)
760 0 0 if (scalar @_ == 3)
775 0 0 if (defined(my $displayname = $id->displayname("default", undef, "no_defaults", 1)))
823 0 0 if ($self->setting("network_deny"))
827 0 0 if (eval {
830 0 0 if (defined(my $query = $opts{'query'}))
831 0 0 ref $url ? :
838 0 0 unless $msg->is_success
855 0 0 if ($self->setting("network_deny"))
859 0 0 if (defined(my $local_override = $opts{'local_override'}))
860 0 0 if (defined(my $local_override_dir = $self->setting("local_override_dir")))
863 0 0 if (&all(sub {
870 0 0 if defined $data
875 0 0 if (defined(my $query = $opts{'query'}))
876 0 0 ref $url ? :
883 0 0 unless $msg->is_success
892 0 0 unless open my $fh, "<", $filename
0 0 unless open my $fh, "<:gzip", $filename . '.gz'
894 0 0 unless $fh
914 0 0 if (defined(my $value = $raw{'og:' . $key}))
915 0 0 if (length $value)
916 0 0 if (defined $filter)
917 0 0 unless $value =~ /$filter/
968 8 76 if (defined $id)
969 0 8 if (defined(my $entry = $own_well_known->{$id_type}{$id}))
993 0 6 if scalar keys %ids
994 0 6 if scalar keys %attr
1015 0 20 unless defined $id
1017 0 20 if (defined(my $displayname = $id->displayname("default", undef, "no_defaults", 1)))
1024 60 20 if (defined(my $value = $id->$func("default", undef)))
1025 0 60 $type eq 'sid' ? :
1032 6 0 if scalar keys %ids
1033 0 6 if scalar keys %attr
1052 0 0 unless (defined $id)
1056 0 0 if (defined $id)
1069 0 0 if (defined $id)
1070 0 0 unless ($id =~ /['"]/)
1078 0 0 if (defined $id)
1086 0 0 if (defined $id)
1093 0 0 unless scalar @ids
1099 0 0 unless $item
1100 0 0 unless ($item->{'type'} // "") eq "uri"
1101 0 0 if (($item->{'value'} // "") =~ /^\Q$config->{'prefix'}\E([QP][1-9][0-9]*)$/)
1136 0 0 if (defined $attribute->{'from_service'}) { }
0 0 elsif (defined $attribute->{'list_value'}) { }
1159 0 0 if ($precision >= 9)
1165 0 0 if ($precision == 9) { }
0 0 elsif ($precision == 10) { }
1183 0 0 if defined $value->{$subkey}
1185 0 0 if defined $value->{'globe'}
1239 0 0 if ($extractor->is_ise($idtype))
1245 0 0 if defined $tag->{$class}{'displayname'}
1246 0 0 if defined $tag->{$class}{'icontext'}
1247 0 0 if defined $tag->{$class}{'displaycolour'}
1248 0 0 if defined $tag->{$class}{'final-file-size'}
1249 0 0 if defined $tag->{$class}{'icon'}
1251 0 0 if (defined $tag->{$class}{'final-file-encoding'})
1252 0 0 if (defined(my $wk = _own_well_known()->{'uuid'}{$tag->{$class}{'final-file-encoding'}}))
1253 0 0 if (defined(my $media_subtype = $wk->{'ids'}{'media-subtype-identifier'}))
1276 0 0 if defined $json->{'title'}
1277 0 0 if defined $json->{'thumbnail_url'}
1293 0 0 if defined $element->{'lat'}
1294 0 0 if defined $element->{'lon'}
1295 0 0 if defined $tags->{'ele'}
1296 0 0 if defined $tags->{'ele:wgs84'}
1299 0 0 if defined $tags->{'wikidata'}
1304 0 0 if defined $tags->{$key}
1306 0 0 if ($inkey =~ /^\Q$key\E:([a-z]{2,3})$/)
1311 0 0 if scalar keys %data
1343 0 0 if ($type eq "node" or $type eq "way" or $type eq "relation")
1344 0 0 if ($id_new =~ "Data::URIID::Result"->RE_UINT)
1360 0 0 if defined $json->{'num'} and $json->{'num'} =~ "Data::URIID::Result"->RE_UINT
1361 0 0 if defined $json->{'title'} and length $json->{'title'}
1372 0 0 if defined $json->{'title'} and length $json->{'title'}
1404 0 0 unless scalar @{$json->{'posts'};} == 1
1411 0 0 if defined $file->{'ext'}
1412 0 0 if defined $file->{'size'}
1413 0 0 if defined $preview->{'url'}
1414 0 0 if defined $file->{'md5'}
1416 0 0 if (defined(my $tagroot = $post->{'tags'}))
1433 0 0 if defined $json->{'hash'} and $json->{'hash'} =~ /^[0-9a-f]{32}$/
1434 0 0 if defined $json->{'filesize'} and int $json->{'filesize'}
1435 0 0 if defined $json->{'ext'} and $json->{'ext'} =~ /^\.?([0-9a-z]{1,5})$/
1437 0 0 if (defined(my $tags = $json->{'tags'}))
1442 0 0 unless length $tag
1447 0 0 if (defined(my $image = $json->{'image'}) and defined(my $directory = $json->{'directory'}))
1497 0 0 if (defined $raw{'twitter:player:stream'} and length $raw{'twitter:player:stream'})
1515 0 0 if (defined(my $url = $raw{'og:url'}))
1516 0 0 if (length $url)
1533 0 0 if (defined $attr{'thumbnail'} and defined(my $url = $attr{'thumbnail'}{'*'}))
1534 0 0 if ($url =~ m[^(https://ruthe\.de/cartoons/)(strip_2487\.jpg)$])
1550 0 0 if (defined $own_metadata{'services'}{$name} and defined(my $displayname = $own_metadata{'services'}{$name}{'displayname'}{'*'}))