blib/lib/YAML/Ordered/Conditional.pm

filter: Statementstmt 87.8% 29 / 33 Branchbran 40.0% 4 / 10 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 9 / 12 Podpod 66.6% 4 / 6 totaltotal 71.2% 47 / 66 CC 7 SCAR 11.6
CC
7
Cov
74%
compile
6.4
decode
4.1
encode
2.0
CRAP 3.2
↑ Summary
1 package YAML::Ordered::Conditional;
2  
3 14 ▶use 5.006; use strict; use warnings; our $VERSION = '0.05';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
4 14 ▶use YAML::As::Parsed qw/Dump DumpFile Load LoadFile/; use base 'Struct::Conditional';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
5 14 ▶use Tie::IxHash;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 0 ▶sub encode {
Subroutine encode: not called CC=1 SCAR=6.9
Pod documented
8 0 Dump($_[1]);
9 }
10  
11 0 ▶sub encode_file {
Subroutine encode_file: not called CC=1 SCAR=6.9
Pod undocumented
12 0 DumpFile($_[1], $_[2]);
13 }
14  
15 15 ▶sub decode {
Subroutine decode: called CC=3 SCAR=14.2
Pod documented
16 15 ▶ if ($_[1] !~ m/\n/ && -f $_[1]) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $_[1] =~ /\n/ and -f $_[1]) 0 15 15
Condition33%1/3
not $_[1] =~ /\n/ and -f $_[1]
!ll&&!rl&&r
1500
MC/DC0%0/2
not $_[1] =~ /\n/ and -f $_[1]
not $_[1] =~ /\n/ -f $_[1]
Truth table33%1/3
not(A) and B
A= not $_[1] =~ /\n/B= -f $_[1]
ABresult
0X0
100
111
17 0 return $_[0]->decode_file($_[1]);
18 }
19 15 Load($_[1]);
20 }
21  
22 0 ▶sub decode_file {
Subroutine decode_file: not called CC=1 SCAR=6.9
Pod documented
23 0 LoadFile($_[1], $_[2]);
24 }
25  
26 15 ▶sub compile {
Subroutine compile: called CC=5 SCAR=18.6
Pod documented
27 15 my ($self, $yaml, $params, $return_struct, $out_file) = @_;
28 15 ▶ $yaml = $self->decode($yaml) unless ref $yaml;
Branch: 1 branch
BranchTrueFalseTotal
unless ref $yaml 15 0 15
29 15 ▶ $params = $self->decode($params) unless ref $params;
Branch: 1 branch
BranchTrueFalseTotal
unless ref $params 0 15 15
30 15 $yaml = $self->SUPER::compile($yaml, $params);
31 15 ▶ return $return_struct
Branch: 2 branches
BranchTrueFalseTotal
$return_struct ? : 15 0 15
$out_file ? : 0 0 0
32 ? $yaml
33 : $out_file
34 ? $self->encode_file($out_file, $yaml)
35 : $self->encode($yaml);
36 }
37  
38 2 ▶sub instantiate_hash {
Subroutine instantiate_hash: called CC=1 SCAR=0.0
Pod undocumented
39 2 my %hash;
40 2 tie %hash, 'Tie::IxHash';
41 2 return %hash;
42 }
43  
44 14 1;
45  
46  
47 __END__
↑ Summary