| 1 | # Copyright (c) 2024-2026 Philipp Schafft | ||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||
| 3 | # licensed under Artistic License 2.0 (see LICENSE file) | ||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||
| 5 | # ABSTRACT: Work with Tag databases | ||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||
| 7 | package Data::TagDB::Metadata; | ||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use v5.10; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||
| 13 | 4 | ▶ | use parent 'Data::TagDB::Link'; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||
| 15 | 4 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||
| 17 | 4 | our $VERSION = v0.16; | |||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||
| 21 | #@returns Data::TagDB::Tag | ||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub type { | ||||||||||||||||||||||||||||||||
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 23 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||
| 24 | 0 | return $self->{type}; | |||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||
| 27 | #@returns Data::TagDB::Tag | ||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub encoding { | ||||||||||||||||||||||||||||||||
|
Subroutine
encoding: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 29 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||
| 30 | 0 | return $self->{encoding}; | |||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | sub type_evaluated { | ||||||||||||||||||||||||||||||||
|
Subroutine
type_evaluated: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 34 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | return $self->{type_evaluated} //= ($self->type // $self->db->_default_type($self->relation)); | ||||||||||||||||||||||||||||||||
|
Condition0%0/6
$self->{"type_evaluated"} //= $self->type // $self->db->_default_type($self->relation)
$self->type // $self->db->_default_type($self->relation)
MC/DC0%0/3
$self->{"type_evaluated"} //= $self->type // $self->db->_default_type($self->relation)
$self->{"type_evaluated"}
$self->type
$self->db->_default_type($self->relation)
Truth table0%0/4
A //= B // C
A= $self->{"type_evaluated"}B= $self->typeC= $self->db->_default_type($self->relation)
| |||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | sub encoding_evaluated { | ||||||||||||||||||||||||||||||||
|
Subroutine
encoding_evaluated: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 39 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | return $self->{encoding_evaluated} //= ($self->encoding // $self->db->_default_encoding($self->type_evaluated)); | ||||||||||||||||||||||||||||||||
|
Condition0%0/6
$self->{"encoding_evaluated"} //= $self->encoding // $self->db->_default_encoding($self->type_evaluated)
$self->encoding // $self->db->_default_encoding($self->type_evaluated)
MC/DC0%0/3
$self->{"encoding_evaluated"} //= $self->encoding // $self->db->_default_encoding($self->type_evaluated)
$self->{"encoding_evaluated"}
$self->encoding
$self->db->_default_encoding($self->type_evaluated)
Truth table0%0/4
A //= B // C
A= $self->{"encoding_evaluated"}B= $self->encodingC= $self->db->_default_encoding($self->type_evaluated)
| |||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | sub data_raw { | ||||||||||||||||||||||||||||||||
|
Subroutine
data_raw: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 45 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||
| 46 | 0 | return $self->{data_raw}; | |||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | sub data { | ||||||||||||||||||||||||||||||||
|
Subroutine
data: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 51 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | if (exists $self->{data}) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 53 | 0 | return $self->{data}; | |||||||||||||||||||||||||||||||||
| 54 | } else { | ||||||||||||||||||||||||||||||||||
| 55 | 0 | eval { | |||||||||||||||||||||||||||||||||
| 56 | 0 | $self->{data} = $self->db->_get_decoder($self)->($self); | |||||||||||||||||||||||||||||||||
| 57 | }; | ||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | croak 'Cannot decode' unless exists $self->{data}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 59 | 0 | return $self->{data}; | |||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||
| 63 | 4 | 1; | |||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||
| 65 | __END__ | ||||||||||||||||||||||||||||||||||