lib/Project/Easy/Config/File.pm

filter: Statementstmt 100% 42 / 42 Branchbran 100% 4 / 4 Conditioncond 66.6% 8 / 12 MC/DCmcdc 33.3% 2 / 6 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 6 totaltotal 82.2% 65 / 79 CC 7 SCAR 9.6
CC
7
Cov
93%
deserialize
4.0
deserialize
4.0
BEGIN
1.0
CRAP 2.6
« lib/Project/Easy/Helper/Console.pm ↑ Summary blib/lib/Project/Easy/Distribution.pm »
1 package Project::Easy::Config::File;
2  
3 8 ▶use Class::Easy;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 8 ▶use base qw(IO::Easy::File);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 10 ▶use Project::Easy::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 15 ▶sub deserialize {
Subroutine deserialize: called CC=4 SCAR=14.0
Pod undocumented
10 5 ▶ my $self = shift;
Subroutine deserialize: called CC=4 SCAR=14.0
Pod undocumented
11 5 my $expansion = shift;
12
13 5 my $contents = $self->contents;
14 5 ▶ if ($expansion and ref $expansion and ref $expansion eq 'HASH') {
Branch: 2 branches
BranchTrueFalseTotal
if ($expansion and ref $expansion and ref $expansion eq "HASH") 6 2 8
if ($expansion and ref $expansion and ref $expansion eq "HASH") 12 3 15
Condition66%8/12
$expansion and ref $expansion and ref $expansion eq "HASH"
!ll&&!rl&&r
206
$expansion and ref $expansion
!ll&&!rl&&r
206
$expansion and ref $expansion and ref $expansion eq "HASH"
!ll&&!rl&&r
3012
$expansion and ref $expansion
!ll&&!rl&&r
3012
MC/DC33%1/3
$expansion and ref $expansion and ref $expansion eq "HASH"
$expansion ref $expansion ref $expansion eq "HASH"
MC/DC33%1/3
$expansion and ref $expansion and ref $expansion eq "HASH"
$expansion ref $expansion ref $expansion eq "HASH"
Truth table50%2/4
A and B and C
A= $expansionB= ref $expansionC= ref $expansion eq "HASH"
ABCresult
0XX0
10X0
1100
1111
Truth table50%2/4
A and B and C
A= $expansionB= ref $expansionC= ref $expansion eq "HASH"
ABCresult
0XX0
10X0
1100
1111
15 5 $contents = Project::Easy::Config::string_from_template (
16 $contents,
17 $expansion
18 );
19 }
20
21 5 my $serializer = Project::Easy::Config->serializer ($self->extension);
22
23 5 return $serializer->parse_string ($contents);
24 }
25  
26 3 ▶sub patch {
Subroutine patch: called CC=1 SCAR=0.0
Pod undocumented
27 5 ▶ my $self = shift;
Subroutine patch: called CC=1 SCAR=0.0
Pod undocumented
28 5 my $patch = shift;
29
30 8 my $structure = $self->deserialize;
31 8 Project::Easy::Config::patch ($structure, $patch);
32
33 8 $self->serialize ($structure);
34 }
35  
36 3 ▶sub serialize {
Subroutine serialize: called CC=1 SCAR=0.0
Pod undocumented
37 8 ▶ my $self = shift;
Subroutine serialize: called CC=1 SCAR=0.0
Pod undocumented
38 6 my $struct = shift;
39
40 8 my $serializer = Project::Easy::Config->serializer ($self->extension);
41
42 8 $self->store ($serializer->dump_struct ($struct));
43 }
44  
45 6 1;
« lib/Project/Easy/Helper/Console.pm ↑ Summary blib/lib/Project/Easy/Distribution.pm »