| 1 | package Ftree::FamilyTreeData; | ||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use version; our $VERSION = qv('2.3.41'); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Ftree::Person; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use Ftree::Name; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Ftree::DataParsers::FieldValidatorParser; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Params::Validate qw(validate | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | SCALAR | ||||||||||||||||||||||||||||
| 11 | ARRAYREF | ||||||||||||||||||||||||||||
| 12 | HASHREF | ||||||||||||||||||||||||||||
| 13 | CODEREF | ||||||||||||||||||||||||||||
| 14 | GLOB | ||||||||||||||||||||||||||||
| 15 | GLOBREF | ||||||||||||||||||||||||||||
| 16 | SCALARREF | ||||||||||||||||||||||||||||
| 17 | HANDLE | ||||||||||||||||||||||||||||
| 18 | BOOLEAN | ||||||||||||||||||||||||||||
| 19 | UNDEF | ||||||||||||||||||||||||||||
| 20 | OBJECT | ||||||||||||||||||||||||||||
| 21 | 2 | ); | |||||||||||||||||||||||||||
| 22 | # use CGI::Carp qw(fatalsToBrowser warningsToBrowser); | ||||||||||||||||||||||||||||
| 23 | 2 | ▶ | use Sub::Exporter -setup => { exports => [ qw(new add_person) ] }; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 2 | ▶ | sub new{ | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 26 | 2 | my ( $classname) = @_; | |||||||||||||||||||||||||||
| 27 | 2 | my $self = { | |||||||||||||||||||||||||||
| 28 | people => {}, #hash of Person | ||||||||||||||||||||||||||||
| 29 | }; | ||||||||||||||||||||||||||||
| 30 | 2 | return bless $self, $classname; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | 15 | ▶ | sub add_person{ | ||||||||||||||||||||||||||
|
Subroutine
add_person: called CC=32 SCAR=40.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 33 | 15 | my ($self) = shift; | |||||||||||||||||||||||||||
| 34 | 15 | my (%arg_ref) = validate(@_, { id => {type => SCALAR}, | |||||||||||||||||||||||||||
| 35 | first_name => {type => SCALAR|UNDEF, default => undef }, | ||||||||||||||||||||||||||||
| 36 | mid_name => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 37 | last_name => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 38 | title => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 39 | prefix => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 40 | suffix => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 41 | nickname => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 42 | father_id => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 43 | mother_id => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 44 | email => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 45 | homepage => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 46 | date_of_birth=> {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 47 | date_of_death=> {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 48 | gender => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 49 | is_living => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 50 | place_of_birth => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 51 | place_of_death => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 52 | cemetery => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 53 | schools => {type => ARRAYREF|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 54 | jobs => {type => ARRAYREF|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 55 | work_places => {type => ARRAYREF|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 56 | places_of_living => {type => SCALAR|UNDEF, default => undef}, | ||||||||||||||||||||||||||||
| 57 | general => {type => SCALAR|UNDEF, default => undef} }); | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 15 | ▶ | if(!Ftree::DataParsers::FieldValidatorParser::validIDEntry($arg_ref{id})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 60 | 0 | die "Not valid Id: " . $arg_ref{id} . " Ids should not contain " | |||||||||||||||||||||||||||
| 61 | . "only alphanumeric plus underscore character"; | ||||||||||||||||||||||||||||
| 62 | 0 | return; | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 15 | ▶ | if ( !defined $self->{people}{ $arg_ref{id} } ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 66 | 9 | $self->{people}{ $arg_ref{id} } = Ftree::Person->new( {id => $arg_ref{id}} ); | |||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||
| 68 | 15 | my $temp_person = $self->{people}{ $arg_ref{id} }; | |||||||||||||||||||||||||||
| 69 | 15 | $temp_person->set_is_living(1); | |||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | $temp_person->set_name(Ftree::Name->new( | ||||||||||||||||||||||||||||
| 72 | {first_name => $arg_ref{first_name}, | ||||||||||||||||||||||||||||
| 73 | mid_name => $arg_ref{mid_name}, | ||||||||||||||||||||||||||||
| 74 | 15 | last_name => $arg_ref{last_name}})); | |||||||||||||||||||||||||||
| 75 | $temp_person->get_name()->set_title($arg_ref{title}) | ||||||||||||||||||||||||||||
| 76 | 15 | ▶ | if(defined $arg_ref{title}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 77 | $temp_person->get_name()->set_prefix($arg_ref{prefix}) | ||||||||||||||||||||||||||||
| 78 | 15 | ▶ | if(defined $arg_ref{prefix}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 79 | $temp_person->get_name()->set_suffix($arg_ref{suffix}) | ||||||||||||||||||||||||||||
| 80 | 15 | ▶ | if(defined $arg_ref{suffix}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 81 | $temp_person->get_name()->set_nickname($arg_ref{nickname}) | ||||||||||||||||||||||||||||
| 82 | 15 | ▶ | if(defined $arg_ref{nickname}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | 15 | $self->set_parent($temp_person, $arg_ref{father_id}, 0); | |||||||||||||||||||||||||||
| 85 | 15 | $self->set_parent($temp_person, $arg_ref{mother_id}, 1); | |||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | 15 | ▶ | if(defined $arg_ref{email} && $arg_ref{email} ne "") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $arg_ref{"email"} and $arg_ref{"email"} ne ""
MC/DC50%1/2
defined $arg_ref{"email"} and $arg_ref{"email"} ne ""
defined $arg_ref{"email"}
$arg_ref{"email"} ne ""
Truth table66%2/3
A and B
A= defined $arg_ref{"email"}B= $arg_ref{"email"} ne ""
| |||||||||||||||||||||||||||||
| 88 | 2 | ▶ | if(Ftree::DataParsers::FieldValidatorParser::validEmail($arg_ref{email})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 89 | 2 | $temp_person->set_email($arg_ref{email}); | |||||||||||||||||||||||||||
| 90 | } else { | ||||||||||||||||||||||||||||
| 91 | 0 | die 'Not valid email: ' . $arg_ref{email}; | |||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | 15 | ▶ | if(defined $arg_ref{homepage} && $arg_ref{homepage} ne "") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $arg_ref{"homepage"} and $arg_ref{"homepage"} ne ""
MC/DC50%1/2
defined $arg_ref{"homepage"} and $arg_ref{"homepage"} ne ""
defined $arg_ref{"homepage"}
$arg_ref{"homepage"} ne ""
Truth table66%2/3
A and B
A= defined $arg_ref{"homepage"}B= $arg_ref{"homepage"} ne ""
| |||||||||||||||||||||||||||||
| 96 | 7 | ▶ | if(Ftree::DataParsers::FieldValidatorParser::validURL($arg_ref{homepage})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 97 | 7 | $temp_person->set_homepage($arg_ref{homepage}); | |||||||||||||||||||||||||||
| 98 | } else { | ||||||||||||||||||||||||||||
| 99 | 0 | die 'Not valid url: ' . $arg_ref{homepage}; | |||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | $temp_person->set_date_of_birth(Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{date_of_birth})) | ||||||||||||||||||||||||||||
| 104 | if ( defined $arg_ref{date_of_birth} | ||||||||||||||||||||||||||||
| 105 | 15 | ▶ | && Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{date_of_birth}) ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $arg_ref{"date_of_birth"} and Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{"date_of_birth"})
MC/DC50%1/2
defined $arg_ref{"date_of_birth"} and Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{"date_of_birth"})
defined $arg_ref{"date_of_birth"}
Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{"date_of_birth"})
Truth table66%2/3
A and B
A= defined $arg_ref{"date_of_birth"}B= Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{"date_of_birth"})
| |||||||||||||||||||||||||||||
| 106 | 15 | ▶ | if ( defined $arg_ref{date_of_death} | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $arg_ref{"date_of_death"} and Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{"date_of_death"})
MC/DC0%0/2
defined $arg_ref{"date_of_death"} and Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{"date_of_death"})
defined $arg_ref{"date_of_death"}
Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{"date_of_death"})
Truth table33%1/3
A and B
A= defined $arg_ref{"date_of_death"}B= Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{"date_of_death"})
| |||||||||||||||||||||||||||||
| 107 | && Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{date_of_death})) { | ||||||||||||||||||||||||||||
| 108 | 0 | $temp_person->set_date_of_death(Ftree::DataParsers::FieldValidatorParser::getDate($arg_ref{date_of_death})); | |||||||||||||||||||||||||||
| 109 | 0 | $temp_person->set_is_living(0); | |||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | 15 | ▶ | if(defined $arg_ref{gender} && $arg_ref{gender} ne "") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $arg_ref{"gender"} and $arg_ref{"gender"} ne ""
MC/DC50%1/2
defined $arg_ref{"gender"} and $arg_ref{"gender"} ne ""
defined $arg_ref{"gender"}
$arg_ref{"gender"} ne ""
Truth table66%2/3
A and B
A= defined $arg_ref{"gender"}B= $arg_ref{"gender"} ne ""
| |||||||||||||||||||||||||||||
| 114 | 14 | ▶ | if(Ftree::DataParsers::FieldValidatorParser::validBool($arg_ref{gender})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 115 | 14 | $temp_person->set_gender($arg_ref{gender}); | |||||||||||||||||||||||||||
| 116 | } else { | ||||||||||||||||||||||||||||
| 117 | 0 | die "Not valid bool: " . $arg_ref{gender}; | |||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | 15 | my $place = Ftree::DataParsers::FieldValidatorParser::getPlace($arg_ref{place_of_birth}); | |||||||||||||||||||||||||||
| 122 | $temp_person->set_place_of_birth($place) | ||||||||||||||||||||||||||||
| 123 | 15 | ▶ | if(defined $arg_ref{place_of_birth}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | 15 | $place = Ftree::DataParsers::FieldValidatorParser::getCemetery($arg_ref{cemetery}); | |||||||||||||||||||||||||||
| 126 | 15 | ▶ | if(defined $place) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 127 | 0 | $temp_person->set_cemetery($place); | |||||||||||||||||||||||||||
| 128 | 0 | $temp_person->set_is_living(0); | |||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||
| 131 | $temp_person->set_schools($arg_ref{schools}) | ||||||||||||||||||||||||||||
| 132 | 15 | ▶ | if(defined $arg_ref{schools}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 133 | $temp_person->set_jobs($arg_ref{jobs}) | ||||||||||||||||||||||||||||
| 134 | 15 | ▶ | if(defined $arg_ref{jobs}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 135 | $temp_person->set_work_places($arg_ref{work_places}) | ||||||||||||||||||||||||||||
| 136 | 15 | ▶ | if(defined $arg_ref{work_places}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 137 | $temp_person->set_places_of_living( | ||||||||||||||||||||||||||||
| 138 | Ftree::DataParsers::FieldValidatorParser::getPlacesArray($arg_ref{places_of_living})) | ||||||||||||||||||||||||||||
| 139 | 15 | ▶ | if(defined $arg_ref{places_of_living}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 140 | $temp_person->set_general($arg_ref{general}) | ||||||||||||||||||||||||||||
| 141 | 15 | ▶ | if(defined $arg_ref{general}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||
| 143 | 15 | ▶ | if(defined $arg_ref{is_living} && $arg_ref{is_living} ne "") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $arg_ref{"is_living"} and $arg_ref{"is_living"} ne ""
MC/DC0%0/2
defined $arg_ref{"is_living"} and $arg_ref{"is_living"} ne ""
defined $arg_ref{"is_living"}
$arg_ref{"is_living"} ne ""
Truth table33%1/3
A and B
A= defined $arg_ref{"is_living"}B= $arg_ref{"is_living"} ne ""
| |||||||||||||||||||||||||||||
| 144 | 15 | ▶ | if(Ftree::DataParsers::FieldValidatorParser::validBool($arg_ref{is_living})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 145 | 15 | ▶ | if(0 == $temp_person->get_is_living() && $arg_ref{is_living}){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
0 == $temp_person->get_is_living and $arg_ref{"is_living"}
MC/DC0%0/2
0 == $temp_person->get_is_living and $arg_ref{"is_living"}
0 == $temp_person->get_is_living
$arg_ref{"is_living"}
Truth table33%1/3
A and B
A= 0 == $temp_person->get_is_livingB= $arg_ref{"is_living"}
| |||||||||||||||||||||||||||||
| 146 | 0 | die "is_living field should be 0 for " . $arg_ref{id}; | |||||||||||||||||||||||||||
| 147 | } else { | ||||||||||||||||||||||||||||
| 148 | 15 | $temp_person->set_is_living($arg_ref{is_living}); | |||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||
| 150 | } else { | ||||||||||||||||||||||||||||
| 151 | 0 | die "Not valid bool: " . $arg_ref{is_living}; | |||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||
| 156 | 15 | return $temp_person; | |||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||
| 158 | 1 | ▶ | sub get_person { | ||||||||||||||||||||||||||
|
Subroutine
get_person: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 159 | 1 | my ($self, $id) = @_; | |||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | 1 | return $self->{people}{$id}; | |||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||
| 163 | 0 | ▶ | sub get_all_people { | ||||||||||||||||||||||||||
|
Subroutine
get_all_people: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 164 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 165 | 0 | return values %{$self->{people}}; | |||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||
| 168 | 30 | ▶ | sub set_parent { | ||||||||||||||||||||||||||
|
Subroutine
set_parent: called CC=8 SCAR=20.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 169 | 30 | my ($self, $temp_person, $id, $gender) = @_; | |||||||||||||||||||||||||||
| 170 | 30 | ▶ | return unless defined $id; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||
| 172 | 18 | ▶ | if(!Ftree::DataParsers::FieldValidatorParser::validIDEntry($id)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 173 | 0 | die "Not valid Id: $id. Ids should not contain " . | |||||||||||||||||||||||||||
| 174 | "only alphanumeric plus underscore character!"; | ||||||||||||||||||||||||||||
| 175 | 0 | return; | |||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||
| 177 | 18 | ▶ | if ( !defined $self->{people}{ $id } ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 178 | 6 | $self->{people}{ $id } = Ftree::Person->new( { id => $id } ); | |||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||
| 181 | 18 | my $parent = $self->{people}{ $id }; | |||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||
| 183 | 18 | ▶ | if($gender == 0) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 184 | 10 | $temp_person->set_father($parent); | |||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||
| 186 | else { | ||||||||||||||||||||||||||||
| 187 | 8 | $temp_person->set_mother($parent); | |||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||
| 190 | 18 | ▶ | if ( !defined $parent->get_gender() ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 191 | 6 | $parent->set_gender($gender); | |||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||
| 193 | else { | ||||||||||||||||||||||||||||
| 194 | 12 | ▶ | die( "Incorrent gender for " . $parent->get_id() ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 195 | if ( $parent->get_gender() != $gender ); | ||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||
| 198 | 18 | ▶ | if (defined $parent->get_children()) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 199 | 10 | push @{$parent->get_children()}, $temp_person; | |||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||
| 201 | else { | ||||||||||||||||||||||||||||
| 202 | 8 | $parent->set_children([$temp_person]); | |||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||
| 205 | 18 | return; | |||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||
| 209 | 2 | 1; | |||||||||||||||||||||||||||