Deezer/Obj.pm

filter: Statementstmt 60.8% 14 / 23 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 43.9% 18 / 41 CC 6 SCAR 32.4
CC
6
Cov
44%
reinit_attr_values
42.0
BEGIN
1.0
BEGIN
1.0
CRAP 25.6
↑ Summary Deezer.pm »
1 package WWW::Deezer::Obj;
2  
3 5 our $VERSION = '0.03';
4  
5 5 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # base class for representing Deezer objects
9  
10 5 subtype 'JSONBoolean' => (as 'Int');
11  
12 coerce 'JSONBoolean' => (
13 from 'Ref',
14 1 ▶ via { JSON::is_bool($_) }
Subroutine __ANON__: called CC=1 SCAR=0.0
15 5 );
16  
17 subtype 'Url' => as 'Str',
18 12 ▶ where { /^http/ };
Subroutine __ANON__: called CC=1 SCAR=0.0
19  
20 5 has 'deezer_obj', is => 'rw', isa => 'Ref';
21  
22 0 ▶sub reinit_attr_values {
Subroutine reinit_attr_values: not called CC=6 SCAR=37.4
Pod undocumented
23 0 my ($self, $new) = @_;
24 0 ▶ my $package = caller || __PACKAGE__;
Condition0%0/2
caller || __PACKAGE__
l!l
00
MC/DC0%0/1
caller || __PACKAGE__
caller
Truth table0%0/2
A
A= caller
Aresult
11
00
25  
26 0 my @attrs = $package->meta->get_all_attributes();
27  
28 0 foreach my $attr (@attrs) {
29 0 my $name = $attr->name;
30 0 eval {
31 0 ▶ $self->$name($new->$name) if ($attr->get_write_method && $name ne 'deezer_obj');
Branch: 1 branch
BranchTrueFalseTotal
if $attr->get_write_method and $name ne "deezer_obj" 0 0 0
Condition0%0/3
$attr->get_write_method and $name ne "deezer_obj"
!ll&&!rl&&r
000
MC/DC0%0/2
$attr->get_write_method and $name ne "deezer_obj"
$attr->get_write_method $name ne "deezer_obj"
Truth table0%0/3
A and B
A= $attr->get_write_methodB= $name ne "deezer_obj"
ABresult
0X0
100
111
32 };
33  
34 0 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 0 0
35 0 warn ($@);
36 }
37 }
38 }
39  
40 5 1;
↑ Summary Deezer.pm »