Spoon/MetadataObject.pm

filter: Statementstmt 32.3% 11 / 34 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 37.5% 3 / 8 Podpod 0.0% 0 / 5 totaltotal 27.4% 14 / 51 CC 6 SCAR 19.5
CC
6
Cov
29%
print_yaml_file
12.0
from_hash
12.0
to_hash
6.0
CRAP 7.0
« Spoon/Hooks.pm ↑ Summary Spoon/DataObject.pm »
1 package Spoon::MetadataObject;
2 1 ▶use Spoon::DataObject -Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶ 
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 const class_id => 'metadata';
5  
6 0 ▶sub parse_yaml_file {
Subroutine parse_yaml_file: not called CC=1 SCAR=6.9
Pod undocumented
7 0 $self->hub->config->parse_yaml_file(shift);
8 }
9  
10 0 ▶sub print_yaml_file {
Subroutine print_yaml_file: not called CC=3 SCAR=24.8
Pod undocumented
11 0 my $file = shift;
12 0 my $hash = shift;
13 0 my $yaml = '';
14 0 for my $key ($self->sort_order) {
15 0 my $value = $hash->{$key};
16 0 ▶ $value = '' unless defined $value;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 0 0 0
17 0 $yaml .= "$key: $value\n";
18 }
19 0 $yaml =~ s/\s+(?=\n)//g;
20 0 io($file)->utf8->print($yaml);
21 0 return $self;
22 }
23  
24 0 ▶sub from_hash {
Subroutine from_hash: not called CC=3 SCAR=24.8
Pod undocumented
25 0 my $hash = shift;
26 exists $hash->{$_} and $self->$_($hash->{$_})
27 0 ▶ for $self->sort_order;
Branch: 1 branch
BranchTrueFalseTotal
exists $hash->{$_} and $self->$_($hash->{$_}) 0 0 0
28 0 return $self;
29 }
30  
31 0 ▶sub to_hash {
Subroutine to_hash: not called CC=2 SCAR=17.9
Pod undocumented
32 0 my $hash = {};
33 $hash->{$_} = $self->$_
34 0 for $self->sort_order;
35 0 return $hash;
36 }
37  
38 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
Pod undocumented
39 0 return $self;
40 }
41  
42 1 __DATA__
« Spoon/Hooks.pm ↑ Summary Spoon/DataObject.pm »