| 1 | # Copyright (c) 2023-2026 Philipp Schafft | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # licensed under Artistic License 2.0 (see LICENSE file) | ||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # ABSTRACT: format independent identifier object | ||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | package Data::Identifier::Cloudlet; | ||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use v5.14; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 2 | ▶ | use parent qw(Data::Identifier::Interface::Userdata Data::Identifier::Interface::Subobjects); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 2 | ▶ | use Data::Identifier; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 2 | our $VERSION = v0.38; | |||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 2 | my @_old_subobjects = qw(db extractor fii store); | |||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 5 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=24 SCAR=47.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 5 | my ($pkg, %opts) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 27 | 5 | my $self = bless {}, $pkg; | |||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 5 | ▶ | if (defined(my $from = delete($opts{from}))) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | if (defined(delete($opts{root})) || defined(delete($opts{entry}))) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined delete $opts{"root"} or defined delete $opts{"entry"}
MC/DC0%0/2
defined delete $opts{"root"} or defined delete $opts{"entry"}
defined delete $opts{"root"}
defined delete $opts{"entry"}
Truth table0%0/3
A or B
A= defined delete $opts{"root"}B= defined delete $opts{"entry"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | croak 'root and entry given with from'; | |||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | if (eval {$from->isa(__PACKAGE__)}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | $self->so_attach($_ => $from->so_get($_, default => undef, no_defaults => 1) // next) foreach @_old_subobjects; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$from->so_get($_, "default", undef, "no_defaults", 1) // (next)
MC/DC0%0/1
$from->so_get($_, "default", undef, "no_defaults", 1) // (next)
$from->so_get($_, "default", undef, "no_defaults", 1)
Truth table0%0/2
A
A= $from->so_get($_, "default", undef, "no_defaults", 1)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | $self->so_attach(parent => $from); | |||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | $opts{root} = [$from->roots]; | |||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | $opts{entry} = [$from->entries]; | |||||||||||||||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | if (!ref($from) || ref($from) eq 'ARRAY' || eval {$from->can('ise')}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
not ref $from or ref $from eq "ARRAY" or eval {
do {
$from->can("ise")
}
}
not ref $from or ref $from eq "ARRAY"
MC/DC0%0/3
not ref $from or ref $from eq "ARRAY" or eval {
do {
$from->can("ise")
}
}
not ref $from
ref $from eq "ARRAY"
eval {
do {
$from->can("ise")
}
}
Truth table0%0/4
not(A) or B or C
A= not ref $fromB= ref $from eq "ARRAY"C= eval {
do {
$from->can("ise")
}
}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | $opts{root} = $from; | |||||||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | croak 'Unknown/Unsupported from' unless defined $opts{root}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 5 | foreach my $key (@_old_subobjects) { | |||||||||||||||||||||||||||||||||||||||||||||
| 50 | 20 | ▶ | my $v = delete($opts{$key}) // next; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
delete $opts{$key} // (next)
MC/DC0%0/1
delete $opts{$key} // (next)
delete $opts{$key}
Truth table50%1/2
A
A= delete $opts{$key}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | $self->so_attach($key => $v); | |||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 5 | ▶ | if (defined(my $so = delete $opts{so})) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | require Data::Identifier::Interface::Subobjects; # Is this required? | |||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | $self->so_attach($_ => $so->so_get($_, default => undef) // next) foreach Data::Identifier::Interface::Subobjects->KEYS; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$so->so_get($_, "default", undef) // (next)
MC/DC0%0/1
$so->so_get($_, "default", undef) // (next)
$so->so_get($_, "default", undef)
Truth table0%0/2
A
A= $so->so_get($_, "default", undef)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 5 | foreach my $key (qw(root entry)) { | |||||||||||||||||||||||||||||||||||||||||||||
| 61 | 10 | ▶ | my $v = delete($opts{$key}) // next; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
delete $opts{$key} // (next)
MC/DC100%1/1
delete $opts{$key} // (next)
delete $opts{$key}
Truth table100%2/2
A
A= delete $opts{$key}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 8 | ▶ | $v = [$v] unless ref($v) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 8 | foreach my $s (@{$v}) { | |||||||||||||||||||||||||||||||||||||||||||||
| 66 | 9 | ▶ | unless (eval {$s->can('ise')}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | $s = Data::Identifier->new(from => $s); | |||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 8 | $v = {map {$_->ise => $_} @{$v}}; | |||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 8 | $self->{$key} = $v; | |||||||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 5 | ▶ | croak 'Stray options passed' if scalar keys %opts; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 5 | ▶ | croak 'No root given' unless defined $self->{root}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 5 | ▶ | $self->{entry} = {%{$self->{entry}//{}}, %{$self->{root}}}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{"entry"} // {}
MC/DC100%1/1
$self->{"entry"} // {}
$self->{"entry"}
Truth table100%2/2
A
A= $self->{"entry"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 5 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | ▶ | sub as { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
as: not called CC=14 SCAR=53.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | my ($self, $as, %opts) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | my %extra = %opts{@_old_subobjects}; | |||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | $as = $opts{rawtype} if $as eq 'raw' && defined($opts{rawtype}); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$as eq "raw" and defined $opts{"rawtype"}
MC/DC0%0/2
$as eq "raw" and defined $opts{"rawtype"}
$as eq "raw"
defined $opts{"rawtype"}
Truth table0%0/3
A and B
A= $as eq "raw"B= defined $opts{"rawtype"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | return $self if ($as =~ /^[A-Z]/ || $as =~ /::/) && eval {$self->isa($as)}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$as =~ /^[A-Z]/u || $as =~ /::/u and eval {
do {
$self->isa($as)
}
}
$as =~ /^[A-Z]/u or $as =~ /::/u
MC/DC0%0/3
$as =~ /^[A-Z]/u || $as =~ /::/u and eval {
do {
$self->isa($as)
}
}
$as =~ /^[A-Z]/u
$as =~ /::/u
eval {
do {
$self->isa($as)
}
}
Truth table0%0/5
A or B and C
A= $as =~ /^[A-Z]/uB= $as =~ /::/uC= eval {
do {
$self->isa($as)
}
}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | ▶ | if (eval {$self->isa(__PACKAGE__)}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | $extra{so} //= $self; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$extra{"so"} //= $self
MC/DC0%0/2
$extra{"so"} //= $self
$extra{"so"}
$self
Truth table0%0/3
A //= B
A= $extra{"so"}B= $self
| |||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | if (!ref($self) || ref($self) eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not ref $self or ref $self eq "ARRAY"
MC/DC0%0/2
not ref $self or ref $self eq "ARRAY"
not ref $self
ref $self eq "ARRAY"
Truth table0%0/3
not(A) or B
A= not ref $selfB= ref $self eq "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | $self = __PACKAGE__->new(root => $self, %extra); | |||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | return $self if ($as =~ /^[A-Z]/ || $as =~ /::/) && eval {$self->isa($as)}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$as =~ /^[A-Z]/u || $as =~ /::/u and eval {
do {
$self->isa($as)
}
}
$as =~ /^[A-Z]/u or $as =~ /::/u
MC/DC0%0/3
$as =~ /^[A-Z]/u || $as =~ /::/u and eval {
do {
$self->isa($as)
}
}
$as =~ /^[A-Z]/u
$as =~ /::/u
eval {
do {
$self->isa($as)
}
}
Truth table0%0/5
A or B and C
A= $as =~ /^[A-Z]/uB= $as =~ /::/uC= eval {
do {
$self->isa($as)
}
}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | return $opts{default} if exists $opts{default}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | croak 'Unknown/Unsupported as: '.$as; | |||||||||||||||||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 4 | ▶ | sub roots { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
roots: called CC=4 SCAR=22.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 4 | my ($self, %opts) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 4 | ▶ | if (defined $opts{as}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | my %extra = map {$_ => ($opts{$_} // $self->so_get($_, default => undef, no_defaults => 1))} @_old_subobjects; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$opts{$_} // $self->so_get($_, "default", undef, "no_defaults", 1)
MC/DC0%0/2
$opts{$_} // $self->so_get($_, "default", undef, "no_defaults", 1)
$opts{$_}
$self->so_get($_, "default", undef, "no_defaults", 1)
Truth table0%0/3
A // B
A= $opts{$_}B= $self->so_get($_, "default", undef, "no_defaults", 1)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 113 | return map {$_->Data::Identifier::as( | ||||||||||||||||||||||||||||||||||||||||||||||
| 114 | $opts{as}, | ||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | so => $opts{so} // $self, | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$opts{"so"} // $self
MC/DC0%0/2
$opts{"so"} // $self
$opts{"so"}
$self
Truth table0%0/3
A // B
A= $opts{"so"}B= $self
| |||||||||||||||||||||||||||||||||||||||||||||||
| 116 | %extra, | ||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | )} values %{$self->{root}}; | |||||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 4 | return values %{$self->{root}}; | |||||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 4 | ▶ | sub entries { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
entries: called CC=4 SCAR=22.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 4 | my ($self, %opts) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 4 | ▶ | if (defined $opts{as}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | my %extra = map {$_ => ($opts{$_} // $self->so_get($_, default => undef, no_defaults => 1))} @_old_subobjects; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$opts{$_} // $self->so_get($_, "default", undef, "no_defaults", 1)
MC/DC0%0/2
$opts{$_} // $self->so_get($_, "default", undef, "no_defaults", 1)
$opts{$_}
$self->so_get($_, "default", undef, "no_defaults", 1)
Truth table0%0/3
A // B
A= $opts{$_}B= $self->so_get($_, "default", undef, "no_defaults", 1)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 129 | return map {$_->Data::Identifier::as( | ||||||||||||||||||||||||||||||||||||||||||||||
| 130 | $opts{as}, | ||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | ▶ | so => $opts{so} // $self, | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$opts{"so"} // $self
MC/DC0%0/2
$opts{"so"} // $self
$opts{"so"}
$self
Truth table0%0/3
A // B
A= $opts{"so"}B= $self
| |||||||||||||||||||||||||||||||||||||||||||||||
| 132 | %extra, | ||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | )} values %{$self->{root}}; | |||||||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 4 | return values %{$self->{entry}}; | |||||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 3 | ▶ | sub is_root { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_root: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 3 | my ($self, $tag) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 142 | 3 | ▶ | $tag = Data::Identifier->new(from => $tag) unless eval {$tag->can('ise')}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 3 | return exists $self->{root}{$tag->ise}; | |||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 3 | ▶ | sub is_entry { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_entry: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 3 | my ($self, $tag) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 149 | 3 | ▶ | $tag = Data::Identifier->new(from => $tag) unless eval {$tag->can('ise')}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 3 | return exists $self->{entry}{$tag->ise}; | |||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | sub add_entry { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_entry: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | my ($self, @entries) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | foreach my $entry (@entries) { | |||||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | unless (eval {$entry->can('ise')}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | $entry = Data::Identifier->new(from => $entry); | |||||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | next if exists $self->{entry}{$entry->ise}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | $self->{entry}{$entry->ise} = $entry; | |||||||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||
| 168 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||