lib/Ftree/FamilyTreeDataFactory.pm

filter: Statementstmt 58.5% 24 / 41 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 62.0% 31 / 50 CC 2 SCAR 4.9
CC
2
Cov
58%
getFamilyTree
3.2
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« blib/lib/Ftree/Exporters/Serializer.pm ↑ Summary lib/Ftree/TextGeneratorFactory.pm »
1 package Ftree::FamilyTreeDataFactory;
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use version; our $VERSION = qv('2.3.41');
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use v5.10.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use experimental 'smartmatch';
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 2 ▶sub getFamilyTree {
Subroutine getFamilyTree: called CC=2 SCAR=11.6
Pod undocumented
9 2 my ($config) = @_;
10 2 my $type = $config->{type};
11 2 ▶ $type = 'csv' if ( $type eq 'txt' );
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "txt" 0 2 2
12
13 2 given ($type) {
14 2 when (/\bcsv\b/) {
15 0 require Ftree::DataParsers::ExtendedSimonWardFormat;
16 return
17 Ftree::DataParsers::ExtendedSimonWardFormat::createFamilyTreeDataFromFile(
18 0 $config->{config} );
19 }
20 2 when (/\bexcel\b/) {
21 2 require Ftree::DataParsers::ExcelFormat;
22 return
23 Ftree::DataParsers::ExcelFormat::createFamilyTreeDataFromFile(
24 2 $config->{config} );
25 }
26 0 when (/\bexcelx\b/) {
27 0 require Ftree::DataParsers::ExcelxFormat;
28 return
29 Ftree::DataParsers::ExcelxFormat::createFamilyTreeDataFromFile(
30 0 $config->{config} );
31 }
32 0 when (/\bser\b/) {
33 0 require Ftree::DataParsers::SerializerFormat;
34 return
35 Ftree::DataParsers::SerializerFormat::createFamilyTreeDataFromFile(
36 0 $config->{config} );
37 }
38 0 when (/\bgedcom\b/) {
39 0 require Ftree::DataParsers::GedcomFormat;
40 return
41 Ftree::DataParsers::GedcomFormat::createFamilyTreeDataFromFile(
42 0 $config->{config} );
43 }
44 0 when (/\bdbi\b/) {
45 0 require Ftree::DataParsers::DBIFormat;
46 return Ftree::DataParsers::DBIFormat::getFamilyTreeData(
47 0 $config->{config} );
48 }
49 0 default { die "Unknown type: $type" }
50 }
51
52 0 return;
53 }
54
55 4 1;
« blib/lib/Ftree/Exporters/Serializer.pm ↑ Summary lib/Ftree/TextGeneratorFactory.pm »