| 1 | package Dist::Inkt::Role::ProcessDOAPDeps; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | our $AUTHORITY = 'cpan:TOBYINK'; | |||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | our $VERSION = '0.110'; | |||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | with 'Dist::Inkt::Role::RDFModel'; | |||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use RDF::Trine::Namespace qw[RDF RDFS OWL XSD]; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | my $CPAN = RDF::Trine::Namespace->new('http://purl.org/NET/cpan-uri/terms#'); | |||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | my $DC = RDF::Trine::Namespace->new('http://purl.org/dc/terms/'); | |||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | my $DOAP = RDF::Trine::Namespace->new('http://usefulinc.com/ns/doap#'); | |||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | my $DEPS = RDF::Trine::Namespace->new('http://ontologi.es/doap-deps#'); | |||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | my $FOAF = RDF::Trine::Namespace->new('http://xmlns.com/foaf/0.1/'); | |||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | my $NFO = RDF::Trine::Namespace->new('http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#'); | |||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | my $SKOS = RDF::Trine::Namespace->new('http://www.w3.org/2004/02/skos/core#'); | |||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | after PopulateMetadata => sub | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | $self->log('Processing the DOAP Deps vocabulary'); | |||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | $self->cpanterms_deps; | |||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | $self->doap_deps; | |||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | $self->doap_deps_features; | |||||||||||||||||||||||||||||||||||||||||
| 29 | 1 | }; | |||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | sub cpanterms_deps | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cpanterms_deps: not called CC=9 SCAR=42.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | my $meta = $self->metadata; | |||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | my $model = $self->model; | |||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | my $uri = 'RDF::Trine::Node::Resource'->new($self->project_uri); | |||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | my @terms = qw(requires build_requires configure_requires test_requires recommends); | |||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | my %term_map = ( | |||||||||||||||||||||||||||||||||||||||||
| 42 | requires => [ 'runtime', 'requires' ], | ||||||||||||||||||||||||||||||||||||||||||
| 43 | build_requires => [ 'build', 'requires' ], | ||||||||||||||||||||||||||||||||||||||||||
| 44 | configure_requires => [ 'configure', 'requires' ], | ||||||||||||||||||||||||||||||||||||||||||
| 45 | test_requires => [ 'test', 'requires' ], | ||||||||||||||||||||||||||||||||||||||||||
| 46 | recommends => [ 'runtime', 'recommends' ], | ||||||||||||||||||||||||||||||||||||||||||
| 47 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | foreach my $term (@terms) | |||||||||||||||||||||||||||||||||||||||||
| 49 | { | ||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | my ($phase, $level) = @{$term_map{$term}}; | |||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | my $Reqs; | |||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | foreach my $dep ($model->objects($uri, $CPAN->$term)) | |||||||||||||||||||||||||||||||||||||||||
| 54 | { | ||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | $Reqs ||= 'CPAN::Meta::Requirements'->from_string_hash($meta->{prereqs}{$phase}{$level} || {}); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/5
$Reqs ||= "CPAN::Meta::Requirements"->from_string_hash($meta->{"prereqs"}{$phase}{$level} || {})
$meta->{'prereqs'}{$phase}{$level} || {}
MC/DC0%0/2
$Reqs ||= "CPAN::Meta::Requirements"->from_string_hash($meta->{"prereqs"}{$phase}{$level} || {})
$Reqs
"CPAN::Meta::Requirements"->from_string_hash($meta->{"prereqs"}{$phase}{$level} || {})
MC/DC0%0/1
$meta->{'prereqs'}{$phase}{$level} || {}
$meta->{'prereqs'}{$phase}{$level}
Truth table0%0/3
A ||= B
A= $ReqsB= "CPAN::Meta::Requirements"->from_string_hash($meta->{"prereqs"}{$phase}{$level} || {})
Truth table0%0/2
A
A= $meta->{'prereqs'}{$phase}{$level}
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | $self->log("WARNING: $term is deprecated in favour of http://ontologi.es/doap-deps#"); | |||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | if ($dep->is_literal) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 59 | { | ||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | my ($mod, $ver) = split /\s+/, $dep->literal_value, 2; | |||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | ▶ | $ver ||= 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$ver ||= 0
MC/DC0%0/1
$ver ||= 0
$ver
Truth table0%0/2
A
A= $ver
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | 1 | ▶ | no warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 63 | $meta->{prereqs}{$phase}{$level}->add_string_requirement($mod, $ver) | ||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | ▶ | unless $meta->{prereqs}{$phase}{$level}{$mod} > $ver; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||
| 66 | else | ||||||||||||||||||||||||||||||||||||||||||
| 67 | { | ||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | $self->log("WARNING: Dunno what to do with ${dep}... we'll figure something out eventually."); | |||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | $meta->{prereqs}{$phase}{$level} = $Reqs->as_string_hash if $Reqs; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||
| 76 | sub doap_deps | ||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
doap_deps: not called CC=15 SCAR=53.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | my $meta = $self->metadata; | |||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | my $model = $self->model; | |||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | my $uri = 'RDF::Trine::Node::Resource'->new($self->project_uri); | |||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | foreach my $phase (qw/ configure build test runtime develop /) | |||||||||||||||||||||||||||||||||||||||||
| 85 | { | ||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | foreach my $level (qw/ requirement recommendation suggestion conflict /) | |||||||||||||||||||||||||||||||||||||||||
| 87 | { | ||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | my $Reqs; | |||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | my $term = "${phase}-${level}"; | |||||||||||||||||||||||||||||||||||||||||
| 91 | my $level2 = { | ||||||||||||||||||||||||||||||||||||||||||
| 92 | requirement => 'requires', | ||||||||||||||||||||||||||||||||||||||||||
| 93 | recommendation => 'recommends', | ||||||||||||||||||||||||||||||||||||||||||
| 94 | suggestion => 'suggests', | ||||||||||||||||||||||||||||||||||||||||||
| 95 | conflict => 'conflicts', | ||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | }->{$level}; | |||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | foreach my $dep ( $model->objects($uri, $DEPS->uri($term)) ) | |||||||||||||||||||||||||||||||||||||||||
| 99 | { | ||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | $Reqs ||= 'CPAN::Meta::Requirements'->from_string_hash($meta->{prereqs}{$phase}{$level2} || {}); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/5
$Reqs ||= "CPAN::Meta::Requirements"->from_string_hash($meta->{"prereqs"}{$phase}{$level2} || {})
$meta->{'prereqs'}{$phase}{$level2} || {}
MC/DC0%0/2
$Reqs ||= "CPAN::Meta::Requirements"->from_string_hash($meta->{"prereqs"}{$phase}{$level2} || {})
$Reqs
"CPAN::Meta::Requirements"->from_string_hash($meta->{"prereqs"}{$phase}{$level2} || {})
MC/DC0%0/1
$meta->{'prereqs'}{$phase}{$level2} || {}
$meta->{'prereqs'}{$phase}{$level2}
Truth table0%0/3
A ||= B
A= $ReqsB= "CPAN::Meta::Requirements"->from_string_hash($meta->{"prereqs"}{$phase}{$level2} || {})
Truth table0%0/2
A
A= $meta->{'prereqs'}{$phase}{$level2}
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | if ($dep->is_literal) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | { | ||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | $self->log("WARNING: ". $DEPS->$term . " expects a resource, not literal $dep!"); | |||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | foreach my $ident ( $model->objects($dep, $DEPS->on) ) | |||||||||||||||||||||||||||||||||||||||||
| 109 | { | ||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | ▶ | unless ($ident->is_literal | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$ident->is_literal and $ident->has_datatype and $ident->literal_datatype eq $DEPS->CpanId->uri
$ident->is_literal and $ident->has_datatype
MC/DC0%0/3
$ident->is_literal and $ident->has_datatype and $ident->literal_datatype eq $DEPS->CpanId->uri
$ident->is_literal
$ident->has_datatype
$ident->literal_datatype eq $DEPS->CpanId->uri
Truth table0%0/4
A and B and C
A= $ident->is_literalB= $ident->has_datatypeC= $ident->literal_datatype eq $DEPS->CpanId->uri
| |||||||||||||||||||||||||||||||||||||||||||
| 111 | and $ident->has_datatype | ||||||||||||||||||||||||||||||||||||||||||
| 112 | and $ident->literal_datatype eq $DEPS->CpanId->uri) | ||||||||||||||||||||||||||||||||||||||||||
| 113 | { | ||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | $self->log("WARNING: Dunno what to do with ${ident}... we'll figure something out eventually."); | |||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | my ($mod, $ver) = split /\s+/, $ident->literal_value, 2; | |||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | ▶ | $ver ||= 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$ver ||= 0
MC/DC0%0/1
$ver ||= 0
$ver
Truth table0%0/2
A
A= $ver
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 1 | ▶ | no warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | $Reqs->add_string_requirement($mod => $ver); | |||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | if ($phase eq 'runtime' and $level eq 'conflict') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$phase eq "runtime" and $level eq "conflict"
MC/DC0%0/2
$phase eq "runtime" and $level eq "conflict"
$phase eq "runtime"
$level eq "conflict"
Truth table0%0/3
A and B
A= $phase eq "runtime"B= $level eq "conflict"
| |||||||||||||||||||||||||||||||||||||||||||
| 124 | { | ||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | $meta->{x_breaks}{$mod} = $ver; | |||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | $meta->{prereqs}{$phase}{$level2} = $Reqs->as_string_hash if $Reqs; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||
| 135 | sub doap_deps_features | ||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
doap_deps_features: not called CC=17 SCAR=55.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | my $meta = $self->metadata; | |||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | my $model = $self->model; | |||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | my $uri = 'RDF::Trine::Node::Resource'->new($self->project_uri); | |||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | my %F; | |||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | foreach my $feature ($model->objects($uri, $DEPS->feature)) | |||||||||||||||||||||||||||||||||||||||||
| 146 | { | ||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | my %f; | |||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | my ($label) = | |||||||||||||||||||||||||||||||||||||||||
| 150 | map $_->literal_value, | ||||||||||||||||||||||||||||||||||||||||||
| 151 | grep $_->is_literal, | ||||||||||||||||||||||||||||||||||||||||||
| 152 | $model->objects($feature, $DOAP->name); | ||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | my ($desc) = | |||||||||||||||||||||||||||||||||||||||||
| 154 | map $_->literal_value, | ||||||||||||||||||||||||||||||||||||||||||
| 155 | grep $_->is_literal, | ||||||||||||||||||||||||||||||||||||||||||
| 156 | $model->objects($feature, $DOAP->shortdesc); | ||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | my ($default) = | |||||||||||||||||||||||||||||||||||||||||
| 158 | map $_->literal_value, | ||||||||||||||||||||||||||||||||||||||||||
| 159 | grep $_->is_literal, | ||||||||||||||||||||||||||||||||||||||||||
| 160 | $model->objects($feature, $DEPS->x_default); | ||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | die "Feature defined with no name: $feature" unless defined $label; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | ▶ | $f{description} = $desc if defined $desc; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | ▶ | $f{x_default} = 0+!!( lc($default||'') eq 'true' ); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$default || ''
MC/DC0%0/1
$default || ''
$default
Truth table0%0/2
A
A= $default
| |||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | foreach my $phase (qw/ configure build test runtime develop /) | |||||||||||||||||||||||||||||||||||||||||
| 167 | { | ||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | foreach my $level (qw/ requirement recommendation suggestion conflict /) | |||||||||||||||||||||||||||||||||||||||||
| 169 | { | ||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | my $Reqs; | |||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | my $term = "${phase}-${level}"; | |||||||||||||||||||||||||||||||||||||||||
| 173 | my $level2 = { | ||||||||||||||||||||||||||||||||||||||||||
| 174 | requirement => 'requires', | ||||||||||||||||||||||||||||||||||||||||||
| 175 | recommendation => 'recommends', | ||||||||||||||||||||||||||||||||||||||||||
| 176 | suggestion => 'suggests', | ||||||||||||||||||||||||||||||||||||||||||
| 177 | conflict => 'conflicts', | ||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | }->{$level}; | |||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | foreach my $dep ( $model->objects($feature, $DEPS->uri($term)) ) | |||||||||||||||||||||||||||||||||||||||||
| 181 | { | ||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | $Reqs ||= 'CPAN::Meta::Requirements'->from_string_hash($meta->{optional_features}{$label}{$phase}{$level2} || {}); | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/5
$Reqs ||= "CPAN::Meta::Requirements"->from_string_hash($meta->{"optional_features"}{$label}{$phase}{$level2} || {})
$meta->{'optional_features'}{$label}{$phase}{$level2} || {}
MC/DC0%0/2
$Reqs ||= "CPAN::Meta::Requirements"->from_string_hash($meta->{"optional_features"}{$label}{$phase}{$level2} || {})
$Reqs
"CPAN::Meta::Requirements"->from_string_hash($meta->{"optional_features"}{$label}{$phase}{$level2} || {})
MC/DC0%0/1
$meta->{'optional_features'}{$label}{$phase}{$level2} || {}
$meta->{'optional_features'}{$label}{$phase}{$level2}
Truth table0%0/3
A ||= B
A= $ReqsB= "CPAN::Meta::Requirements"->from_string_hash($meta->{"optional_features"}{$label}{$phase}{$level2} || {})
Truth table0%0/2
A
A= $meta->{'optional_features'}{$label}{$phase}{$level2}
| |||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | ▶ | if ($dep->is_literal) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | { | ||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | $self->log("WARNING: ". $DEPS->$term . " expects a resource, not literal $dep!"); | |||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | foreach my $ident ( $model->objects($dep, $DEPS->on) ) | |||||||||||||||||||||||||||||||||||||||||
| 191 | { | ||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | ▶ | unless ($ident->is_literal | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$ident->is_literal and $ident->has_datatype and $ident->literal_datatype eq $DEPS->CpanId->uri
$ident->is_literal and $ident->has_datatype
MC/DC0%0/3
$ident->is_literal and $ident->has_datatype and $ident->literal_datatype eq $DEPS->CpanId->uri
$ident->is_literal
$ident->has_datatype
$ident->literal_datatype eq $DEPS->CpanId->uri
Truth table0%0/4
A and B and C
A= $ident->is_literalB= $ident->has_datatypeC= $ident->literal_datatype eq $DEPS->CpanId->uri
| |||||||||||||||||||||||||||||||||||||||||||
| 193 | and $ident->has_datatype | ||||||||||||||||||||||||||||||||||||||||||
| 194 | and $ident->literal_datatype eq $DEPS->CpanId->uri) | ||||||||||||||||||||||||||||||||||||||||||
| 195 | { | ||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | $self->log("WARNING: Dunno what to do with ${ident}... we'll figure something out eventually."); | |||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | my ($mod, $ver) = split /\s+/, $ident->literal_value, 2; | |||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | $ver ||= 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$ver ||= 0
MC/DC0%0/1
$ver ||= 0
$ver
Truth table0%0/2
A
A= $ver
| |||||||||||||||||||||||||||||||||||||||||||
| 202 | 1 | ▶ | no warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | $Reqs->add_string_requirement($mod => $ver); | |||||||||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | ▶ | $f{prereqs}{$phase}{$level2} = $Reqs->as_string_hash if $Reqs; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | $F{$label} = \%f; | |||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | $meta->{optional_features} = \%F; | |||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||
| 217 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||