RDF.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 4 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 93.0% 40 / 43 CC 4 SCAR 5.5
CC
4
Cov
97%
__ANON__
3.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.7
« Fix/aref_query.pm ↑ Summary
1 package Catmandu::RDF;
2  
3 18 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 18 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 18 ▶use Catmandu::Util qw(is_instance);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 18 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 18 ▶use RDF::NS;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 18 our $VERSION = '0.32';
10  
11 18 our %TYPE_ALIAS = (
12 Ttl => 'Turtle',
13 N3 => 'Notation3',
14 Xml => 'RDFXML',
15 XML => 'RDFXML',
16 Json => 'RDFJSON',
17 );
18  
19 has type => (
20 is => 'ro',
21 27 ▶ coerce => sub { my $t = ucfirst($_[0]); $TYPE_ALIAS{$t} // $t },
Subroutine __ANON__: called CC=2 SCAR=7.1
Condition66%2/3
$Catmandu::RDF::TYPE_ALIAS{$t} // $t
l!l&&r!l&&!r
13140
MC/DC0%0/2
$Catmandu::RDF::TYPE_ALIAS{$t} // $t
$Catmandu::RDF::TYPE_ALIAS{$t} $t
Truth table66%2/3
A // B
A= $Catmandu::RDF::TYPE_ALIAS{$t}B= $t
ABresult
1X1
011
000
22 18 );
23  
24 has ns => (
25 is => 'ro',
26 30 ▶ default => sub { RDF::NS->new },
Subroutine __ANON__: called CC=1 SCAR=0.0
27 65 ▶ coerce => sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
28 65 ▶ return $_[0] if is_instance($_[0],'RDF::NS');
Branch: 1 branch
BranchTrueFalseTotal
if is_instance($_[0], "RDF::NS") 30 35 65
29 35 ▶ return $_[0] if !$_[0];
Branch: 1 branch
BranchTrueFalseTotal
unless $_[0] 9 26 35
30 26 return RDF::NS->new($_[0]);
31 },
32 18 handles => ['uri'],
33 );
34  
35 18 1;
36 __END__
« Fix/aref_query.pm ↑ Summary