Print/Property.pm

filter: Statementstmt 100% 37 / 37 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 100% 51 / 51 CC 3 SCAR 4.4
CC
3
Cov
100%
print
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« Print/Texts.pm ↑ Summary Print/Sense.pm »
1 package Wikibase::Datatype::Print::Property;
2  
3 6 ▶use base qw(Exporter);
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 Error::Pure qw(err);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use Wikibase::Datatype::Print::Statement;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 6 ▶use Wikibase::Datatype::Print::Utils qw(defaults print_aliases print_descriptions
Subroutine BEGIN: called CC=1 SCAR=0.0
11 6 print_labels print_statements);
12 6 ▶use Wikibase::Datatype::Print::Value::Monolingual;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 6 Readonly::Array our @EXPORT_OK => qw(print);
15  
16 6 our $VERSION = 0.21;
17  
18 4 ▶sub print {
Subroutine print: called CC=3 SCAR=11.0
Pod documented
19 4 my ($obj, $opts_hr) = @_;
20  
21 4 $opts_hr = defaults($obj, $opts_hr);
22  
23 4 ▶ if (! $obj->isa('Wikibase::Datatype::Property')) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($obj->isa("Wikibase::Datatype::Property")) 1 3 4
24 1 err "Object isn't 'Wikibase::Datatype::Property'.";
25 }
26  
27 my @ret = (
28 3 $opts_hr->{'texts'}->{'data_type'}.': '.$obj->datatype,
29 );
30  
31 # Label.
32 3 push @ret, print_labels($obj, $opts_hr,
33 \&Wikibase::Datatype::Print::Value::Monolingual::print);
34  
35 # Description.
36 3 push @ret, print_descriptions($obj, $opts_hr,
37 \&Wikibase::Datatype::Print::Value::Monolingual::print);
38  
39 # Aliases.
40 3 push @ret, print_aliases($obj, $opts_hr,
41 \&Wikibase::Datatype::Print::Value::Monolingual::print);
42  
43 # Statements.
44 3 push @ret, print_statements($obj, $opts_hr,
45 \&Wikibase::Datatype::Print::Statement::print);
46  
47 3 ▶ return wantarray ? @ret : (join "\n", @ret);
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 2 1 3
48 }
49  
50 6 1;
51  
52 __END__
« Print/Texts.pm ↑ Summary Print/Sense.pm »