| 1 | package Convert::Pheno::Model::Bundle; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 138 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 138 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 138 | ▶ | use autodie; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 21102 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=14.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 21102 | my ( $class, $args ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 21102 | ▶ | $args ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args ||= {}
MC/DC0%0/1
$args ||= {}
$args
Truth table50%1/2
A
A= $args
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | my $self = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | context => $args->{context}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 21102 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 21102 | ▶ | if ( $args->{entities} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 21102 | for my $entity ( @{ $args->{entities} } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 23879 | $self->{$entity} = []; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 21102 | return bless $self, $class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | sub context { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
context: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | return $self->{context}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 26362 | ▶ | sub add_entity { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_entity: called CC=9 SCAR=22.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 26362 | my ( $self, $entity_type, $entity ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 26362 | ▶ | return unless defined $entity; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 25144 | my $context = $self->{context}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 25144 | ▶ | if ($context && ($context->target_format || '') eq 'beacon' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition81%9/11
$context and ($context->target_format || "") eq "beacon" and $entity_type eq "individuals" || $entity_type eq "biosamples"
$context and ($context->target_format || "") eq "beacon"
$context->target_format || ''
$entity_type eq "individuals" or $entity_type eq "biosamples"
MC/DC75%3/4
$context and ($context->target_format || "") eq "beacon" and $entity_type eq "individuals" || $entity_type eq "biosamples"
$context
$context->target_format
$entity_type eq "individuals"
$entity_type eq "biosamples"
Truth table80%4/5
A and B and C or D
A= $contextB= $context->target_formatC= $entity_type eq "individuals"D= $entity_type eq "biosamples"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | && ($entity_type eq 'individuals' || $entity_type eq 'biosamples')) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 25104 | my $id = $context->options->{datasetId}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | # Some Beacon backends require this non-standard top-level property. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | # Opt in explicitly; copy the record so caller-owned data stays intact. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 25104 | ▶ | $entity = { %{$entity}, datasetId => $id } if defined $id; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 25144 | ▶ | $self->{$entity_type} ||= []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{$entity_type} ||= []
MC/DC100%1/1
$self->{$entity_type} ||= []
$self->{$entity_type}
Truth table100%2/2
A
A= $self->{$entity_type}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 25144 | push @{ $self->{$entity_type} }, $entity; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 25144 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 23978 | ▶ | sub entities { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
entities: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 23978 | my ( $self, $entity_type ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 23978 | ▶ | $self->{$entity_type} ||= []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{$entity_type} ||= []
MC/DC100%1/1
$self->{$entity_type} ||= []
$self->{$entity_type}
Truth table100%2/2
A
A= $self->{$entity_type}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 23978 | return $self->{$entity_type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 15170 | ▶ | sub primary_entity { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
primary_entity: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 15170 | my ( $self, $entity_type ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 15170 | my $entities = $self->entities($entity_type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 15170 | ▶ | return unless @$entities; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 14650 | return $entities->[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 138 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||