Branch Coverage

blib/lib/SKOS/Simple.pm
Criterion Covered Total %
branch 119 212 56.1


line true false branch
313 0 15 unless uri_or_empty($$self{'base'})
314 0 15 unless uri_or_empty($$self{'scheme'})
315 11 4 if $$self{'scheme'} eq $$self{'base'}
319 14 1 if (not $$self{'identity'}) { }
0 1 elsif (not grep({$$self{'identity'} eq $_;} 'label', 'notation', 'identifier')) { }
320 0 14 if ($$self{'label'} eq 'unique') { }
2 12 elsif ($$self{'notation'} eq 'unique') { }
333 0 15 if ($$self{'label'}) { }
335 0 0 unless grep {$$self{'label'} eq $_;} keys %LABEL_TYPES
340 2 13 if ($$self{'notation'})
342 0 2 unless grep {$$self{'notation'} eq $_;} 'unique', 'mandatory'
347 13 2 unless $$self{'namespaces'}{'skos'}
350 0 15 if $arg{'void'} and not $$self{'namespaces'}{'void'}
353 2 13 if $$self{'title'} || $$self{'description'} and not $$self{'namespaces'}{'dc'}
358 2 13 if ($$self{'title'} and not ref $$self{'title'} && $lang)
364 0 15 if (my $pattern = delete $arg{'idpattern'})
374 0 15 if ($arg{'void'})
376 0 0 if $arg{'void'}
379 0 0 if ($$self{'idpattern'})
389 1 14 if ($arg{'properties'})
402 12 3 $$self{'title'} eq '' ? :
407 15 0 $page eq '' ? :
410 0 15 if $page ne '' and not $$self{'namespaces'}{'foaf'}
418 0 70 reftype $_ && reftype $_ eq 'ARRAY' ? :
419 4 66 if $_
452 5 2 unless ($$self{'concepts'}{$id})
462 1 6 unless defined $notation
465 0 7 if (defined $identifier)
470 6 1 if ($$self{'notation'})
471 6 0 if defined $notation and $notation ne ''
473 0 6 if $$concept{'notation'} eq ''
475 6 0 if ($$self{'notation'} eq 'unique')
482 6 1 unless $notation eq ''
487 27 1 unless defined $label
495 0 49 if (@values)
502 0 7 if @broader and $$self{'top'}{$id}
507 0 0 if $$concept{'related'}{$i}
508 0 0 unless $nocheck
513 0 2 if $$concept{'broader'}{$i}
514 0 2 if ($$self{'hierarchy'} eq 'tree')
516 0 0 if %{$$concept{'broader'};}
519 2 0 unless $nocheck
524 0 2 if $$concept{'narrower'}{$i}
525 0 2 unless $nocheck
547 13 0 unless (@_)
548 0 13 if %{$$self{'top'};}
553 0 0 if (@_ == 1 and not defined $_[0])
558 0 0 unless $$self{'concepts'}{$id}
559 0 0 if $$self{'top'}{$id}
561 0 0 if keys %{$$self{'concepts'}{'broader'};}
593 1 2 @_ == 1 ? :
594 3 0 if defined $id and $id ne ''
639 9 3 unless defined $arg{'label'}
642 3 9 if ($arg{'label'} ne '')
650 54 6 unless defined $arg{$type} and $arg{$type} ne ''
651 6 0 unless (ref $arg{$type})
652 0 6 if ($arg{$type} eq '') { }
660 9 3 unless defined $arg{'id'}
661 3 9 unless defined $arg{$idtype}
663 3 9 if ($arg{'id'} ne '') { }
665 3 0 if ($idtype eq 'notation' or $idtype eq 'identifier') { }
666 0 3 if ($arg{$idtype} ne '' and $arg{$idtype} ne $arg{'id'})
672 0 0 if $arg{'label'} eq ''
674 0 0 if defined $l and $l ne '' and $l ne $arg{'id'}
681 5 4 if ($idtype eq 'notation') { }
0 4 elsif ($idtype eq 'identifier') { }
686 3 1 if $arg{$labeltype}
692 0 12 if ($$self{'idregexp'})
693 0 0 unless $arg{'id'} =~ /$$self{'idregexp'}/
697 1 11 if $arg{'id'} eq ''
732 0 0 unless $subj =~ s/^$base//
746 0 0 if ($p =~ /^(narrower|broader)$/) { }
0 0 elsif ($p =~ /^(prefLabel)/) { }
0 0 elsif ($p eq 'definition') { }
747 0 0 unless $$object{'type'} eq 'uri'
750 0 0 unless $obj =~ s/^$base//
762 0 0 if (%concept)
810 0 8 if ($$self{'uses_dc'} and not $$self{'namespaces'}{'dc'})
832 8 0 if $$self{'base'} eq ''
848 10 4 unless exists $opt{'top'}
851 10 4 if ($opt{'top'}) { }
875 5 3 unless exists $opt{'top'}
876 1 7 if $opt{'lean'}
877 4 4 unless exists $opt{'scheme'}
884 8 0 if ($$c{'notation'} ne '')
890 32 0 unless $$c{$type}
898 22 2 unless %{$$c{$rel};}
903 4 4 if ($opt{'top'})
904 0 4 keys %{$$self{'top'};} ? :
3 1 if (keys %{$$self{'top'};} ? $$self{'top'}{$id} : !%{$$c{'broader'};})
911 5 3 if ($opt{'scheme'} - $is_top > 0)
917 0 8 if (defined $$c{'identifier'} and $$c{'identifier'} ne '')
923 56 0 unless $$c{$name}
964 0 7 if ref $_[0]
967 0 7 unless defined $value
970 0 7 if $value =~ m<[^a-z0-9\:/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]>i
973 0 7 if $value =~ /%[^0-9a-f]/i
974 0 7 if $value =~ /%[0-9a-f](:?[^0-9a-f]|$)/i
981 0 7 unless defined $scheme and length $scheme and defined $path
984 7 0 if (defined $authority and length $authority) { }
985 0 7 unless length $path == 0 or $path =~ m[^/]
989 0 0 if $path =~ m[^//]
993 0 7 unless lc($scheme) =~ /^[a-z][a-z0-9\+\-\.]*$/
997 7 0 if (defined $authority and length $authority)
1001 0 7 if (defined $query and length $query)
1004 0 7 if (defined $fragment and length $fragment)