lib/Convert/Pheno/Source/Structured.pm

filter: Statementstmt 100% 29 / 29 Branchbran 75.0% 3 / 4 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 3 totaltotal 77.7% 42 / 54 CC 5 SCAR 8.6
CC
5
Cov
87%
prepare
4.6
load
2.0
BEGIN
1.0
CRAP 2.4
« lib/Convert/Pheno/Context.pm ↑ Summary lib/Convert/Pheno/Utils/Schema.pm »
1 package Convert::Pheno::Source::Structured;
2  
3 136 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 136 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 136 ▶use Convert::Pheno::IO::FileIO qw(io_yaml_or_json);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 136 ▶use Convert::Pheno::Mapping::Shared qw(get_info);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 136 ▶use Convert::Pheno::Source::Result;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 61 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
11 61 my ( $class, $converter ) = @_;
12 61 return bless { converter => $converter }, $class;
13 }
14  
15 61 ▶sub load {
Subroutine load: called CC=2 SCAR=6.9
Pod undocumented
16 61 my ($self) = @_;
17 61 my $converter = $self->{converter};
18  
19 return Convert::Pheno::Source::Result->new(
20 {
21 data => $converter->{data},
22 owned => 0,
23 }
24 )
25 61 ▶ if exists $converter->{data};
Branch: 1 branch
BranchTrueFalseTotal
if exists $converter->{"data"} 16 45 61
26  
27 return Convert::Pheno::Source::Result->new(
28 {
29 data => io_yaml_or_json(
30 {
31 filepath => $converter->{in_file},
32 45 mode => 'read',
33 }
34 ),
35 owned => 1,
36 }
37 );
38 }
39  
40 42 ▶sub prepare {
Subroutine prepare: called CC=4 SCAR=15.2
Pod undocumented
41 42 my ( $self, $format ) = @_;
42 42 my $converter = $self->{converter};
43 42 my $source = $self->load;
44 42 $source->apply_to($converter);
45 42 delete $converter->{mapping_file_derived_entity_overrides};
46 42 ▶ $converter->{convertPheno} ||= get_info($converter)
Branch: 1 branch
BranchTrueFalseTotal
if defined $format and $format eq "pxf" 42 0 42
Condition33%2/6
defined $format and $format eq "pxf"
!ll&&!rl&&r
0042
$converter->{"convertPheno"} ||= get_info($converter)
l!l&&r!l&&!r
0420
MC/DC0%0/2
defined $format and $format eq "pxf"
defined $format $format eq "pxf"
MC/DC0%0/2
$converter->{"convertPheno"} ||= get_info($converter)
$converter->{"convertPheno"} get_info($converter)
Truth table33%1/3
A and B
A= defined $formatB= $format eq "pxf"
ABresult
0X0
100
111
Truth table33%1/3
A ||= B
A= $converter->{"convertPheno"}B= get_info($converter)
ABresult
1X1
011
000
47 if defined $format && $format eq 'pxf';
48 42 return 1;
49 }
50  
51 136 1;
« lib/Convert/Pheno/Context.pm ↑ Summary lib/Convert/Pheno/Utils/Schema.pm »