Wikidata/Item/Periodical.pm

filter: Statementstmt 91.4% 32 / 35 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod 0.0% 0 / 1 totaltotal 88.0% 44 / 50 CC 3 SCAR 4.6
CC
3
Cov
90%
_description
3.0
wikidata
2.0
BEGIN
1.0
CRAP 1.6
« Wikidata/Transform.pm ↑ Summary
1 package MARC::Convert::Wikidata::Item::Periodical;
2  
3 8 ▶use base qw(MARC::Convert::Wikidata::Item);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 8 ▶use Unicode::UTF8 qw(decode_utf8);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 8 ▶use Wikibase::Datatype::Item;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 8 ▶use Wikibase::Datatype::Snak;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 8 ▶use Wikibase::Datatype::Statement;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 8 ▶use Wikibase::Datatype::Value::Item;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 8 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: book series
23 Wikibase::Datatype::Statement->new(
24 'snak' => Wikibase::Datatype::Snak->new(
25 'datatype' => 'wikibase-item',
26 'datavalue' => Wikibase::Datatype::Value::Item->new(
27 'value' => 'Q1002697',
28 ),
29 'property' => 'P31',
30 ),
31 ),
32  
33 # TODO
34 $self->wikidata_authors,
35 $self->wikidata_authors_of_introduction,
36 $self->wikidata_compilers,
37 $self->wikidata_dml,
38 $self->wikidata_edition_number,
39 $self->wikidata_editors,
40 $self->wikidata_end_time,
41 $self->wikidata_external_ids,
42 $self->wikidata_illustrators,
43 $self->wikidata_issn,
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_start_time,
52 $self->wikidata_subtitles,
53 $self->wikidata_title,
54 $self->wikidata_translators,
55 ],
56 );
57  
58 0 return $wikidata;
59 }
60  
61 2 ▶sub _description {
Subroutine _description: called CC=3 SCAR=11.0
62 2 my ($self, $lang) = @_;
63  
64 2 my $ret;
65 2 ▶ if ($lang eq 'cs') {
Branch: 2 branches
BranchTrueFalseTotal
if ($lang eq 'cs') { } 1 1 2
elsif ($lang eq 'en') { } 1 0 1
66 1 $ret = decode_utf8('české periodikum');
67  
68 } elsif ($lang eq 'en') {
69 1 $ret = 'Czech periodical';
70 }
71  
72 2 return $ret;
73 }
74  
75 8 1;
76  
77 __END__
« Wikidata/Transform.pm ↑ Summary