Client/Request/Role/HasData.pm

filter: Statementstmt 100% 14 / 14 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 88.4% 23 / 26 CC 4 SCAR 11.1
CC
4
Cov
90%
_build_data
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« Utils/URI.pm ↑ Summary Client/Request/CreateRelationships.pm »
1 # ABSTRACT: request - role - has data
2 package PONAPI::Client::Request::Role::HasData;
3  
4 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 has _data => (
7 init_arg => 'data',
8 is => 'ro',
9 isa => 'HashRef',
10 required => 1,
11 );
12  
13 2 has data => (
14 init_arg => undef,
15 is => 'ro',
16 isa => 'HashRef',
17 lazy => 1,
18 builder => '_build_data',
19 );
20  
21 sub _build_data {
22 2 ▶ my $self = shift;
Subroutine _build_data: called CC=4 SCAR=14.0
23 2 my $data = $self->_data;
24  
25 2 ▶ $data->{type} = $self->type if !defined $data->{type};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $data->{"type"} 2 0 2
26 $data->{id} = $self->id if !defined $data->{id}
27 2 ▶ && $self->does('PONAPI::Client::Request::Role::HasId');
Branch: 1 branch
BranchTrueFalseTotal
if not defined $data->{"id"} and $self->does("PONAPI::Client::Request::Role::HasId") 1 1 2
Condition66%2/3
not defined $data->{"id"} and $self->does("PONAPI::Client::Request::Role::HasId")
!ll&&!rl&&r
011
MC/DC50%1/2
not defined $data->{"id"} and $self->does("PONAPI::Client::Request::Role::HasId")
not defined $data->{"id"} $self->does("PONAPI::Client::Request::Role::HasId")
Truth table66%2/3
not(A) and B
A= not defined $data->{"id"}B= $self->does("PONAPI::Client::Request::Role::HasId")
ABresult
0X0
100
111
28  
29 2 return $data;
30 }
31  
32 2 ▶no Moose::Role; 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 __END__
35  
36 =pod
37  
38 =encoding UTF-8
39  
40 =head1 NAME
41  
42 PONAPI::Client::Request::Role::HasData - request - role - has data
43  
44 =head1 VERSION
45  
46 version 0.002003
47  
48 =head1 AUTHORS
49  
50 =over 4
51  
52 =item *
53  
54 Mickey Nasriachi <mickey@cpan.org>
55  
56 =item *
57  
58 Stevan Little <stevan@cpan.org>
59  
60 =item *
61  
62 Brian Fraser <hugmeir@cpan.org>
63  
64 =back
65  
66 =head1 COPYRIGHT AND LICENSE
67  
68 This software is copyright (c) 2016 by Mickey Nasriachi, Stevan Little, Brian Fraser.
69  
70 This is free software; you can redistribute it and/or modify it under
71 the same terms as the Perl 5 programming language system itself.
72  
73 =cut
« Utils/URI.pm ↑ Summary Client/Request/CreateRelationships.pm »