Wikidata/Item/AudioBook.pm

filter: Statementstmt 66.6% 26 / 39 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 8 / 10 Podpod 0.0% 0 / 1 totaltotal 58.6% 34 / 58 CC 5 SCAR 24.4
CC
5
Cov
55%
_description
30.0
wikidata
2.0
BEGIN
1.0
CRAP 11.4
« Wikidata.pm ↑ Summary Wikidata/Utils.pm »
1 package MARC::Convert::Wikidata::Item::AudioBook;
2  
3 6 ▶use base qw(MARC::Convert::Wikidata::Item);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 6 ▶use Unicode::UTF8 qw(decode_utf8);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use Wikibase::Datatype::Item 0.39;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use Wikibase::Datatype::Snak;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 6 ▶use Wikibase::Datatype::Statement;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 6 ▶use Wikibase::Datatype::Value::Item;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 6 our $VERSION = 0.34;
14  
15 0 ▶sub wikidata {
Subroutine wikidata: not called CC=1 SCAR=6.9
Pod undocumented
16 0 my $self = shift;
17  
18 0 my $wikidata = Wikibase::Datatype::Item->new(
19 $self->wikidata_labels,
20 $self->wikidata_descriptions,
21 'statements' => [
22 # instance of: version, edition, or translation
23 Wikibase::Datatype::Statement->new(
24 'snak' => Wikibase::Datatype::Snak->new(
25 'datatype' => 'wikibase-item',
26 'datavalue' => Wikibase::Datatype::Value::Item->new(
27 'value' => 'Q122731938',
28 ),
29 'property' => 'P31',
30 ),
31 ),
32  
33 $self->wikidata_authors,
34 $self->wikidata_authors_of_introduction,
35 $self->wikidata_compilers,
36 $self->wikidata_directors,
37 $self->wikidata_dml,
38 $self->wikidata_edition_number,
39 $self->wikidata_editors,
40 $self->wikidata_external_ids,
41 $self->wikidata_narrators,
42 $self->wikidata_isbn_10,
43 $self->wikidata_isbn_13,
44 $self->wikidata_krameriuses,
45 $self->wikidata_language,
46 $self->wikidata_number_of_pages,
47 $self->wikidata_place_of_publication,
48 $self->wikidata_publication_date,
49 $self->wikidata_publishers,
50 $self->wikidata_series,
51 $self->wikidata_subtitles,
52 $self->wikidata_title,
53 $self->wikidata_translators,
54 ],
55 );
56  
57 0 return $wikidata;
58 }
59  
60 0 ▶sub _description {
Subroutine _description: not called CC=5 SCAR=34.0
61 0 my ($self, $lang) = @_;
62  
63 0 my $ret;
64 0 ▶ if ($lang eq 'cs') {
Branch: 2 branches
BranchTrueFalseTotal
if ($lang eq 'cs') { } 0 0 0
elsif ($lang eq 'en') { } 0 0 0
65 0 $ret = decode_utf8('české vydání audioknihy');
66 0 ▶ if (defined $self->{'transform_object'}->publication_date) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{"transform_object"}->publication_date) 0 0 0
67 0 $ret .= ' z roku '.$self->{'transform_object'}->publication_date;
68 }
69  
70 } elsif ($lang eq 'en') {
71 0 ▶ if (defined $self->{'transform_object'}->publication_date) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{"transform_object"}->publication_date) 0 0 0
72 0 $ret = $self->{'transform_object'}->publication_date.' ';
73 }
74 0 $ret .= 'Czech audiobook edition';
75 }
76  
77 0 return $ret;
78 }
79  
80 6 1;
81  
82 __END__
« Wikidata.pm ↑ Summary Wikidata/Utils.pm »