Branch Coverage

File:blib/lib/Config/Abstraction.pm
Coverage:58.2%

line%coveragebranch
317100TFif (scalar @_ == 1) { }
326100TFif (not defined $$params{"config_dirs"} and $$params{"file"})
330100TFunless (defined $$params{"config_dirs"})
331100TFif ($$params{'config_file'} and 'File::Spec'->file_name_is_absolute($$params{'config_file'})) { }
33550TFif ($^O ne 'MSWin32') { }
34050TFif ($ENV{'HOME'}) { }
0TFelsif ($ENV{'DOCUMENT_ROOT'}) { }
35150TFif (my $dir = $ENV{'CONFIG_DIR'}) { }
36150TF$$params{'defaults'} ? :
36650TFif (my $logger = $$self{"logger"})
3670TFunless (&Scalar::Util::blessed($logger))
3700TFif ($$params{"level"} and $$self{"logger"}->can("level"))
377100TFif (my $schema = $$params{"schema"})
381100TFif ($$self{"config"} and scalar keys %{$$self{"config"};})
38950TFunless (UNIVERSAL::isa((&CORE::GLOBAL::caller())[0], __PACKAGE__))
396100TFif ($$self{"data"})
40250TFif ($logger)
40750TFif ($$self{"config_file"} and scalar @dirs > 1)
4080TFif ('File::Spec'->file_name_is_absolute($$self{'config_file'})) { }
41750TFunless defined $dir
42150TFif ($logger)
424100TFunless -f $path
42650TFif ($logger)
432100TFif ($file =~ /\.ya?ml$/) { }
100TFelsif ($file =~ /\.json$/) { }
100TFelsif ($file =~ /\.xml$/) { }
50TFelsif ($file =~ /\.ini$/) { }
43550TFif $@
43850TFif $@
44150TFif ($self->_load_driver("XML::Simple", ["XMLin"]))
4430TFif ($@) { }
0TFelsif ($rc) { }
4440TFif ($logger) { }
45450TFif (not defined $rc and $self->_load_driver("XML::PP"))
45750TFif (my $tree = $xml_pp->parse(\$data))
45850TFif ($data = $xml_pp->collapse_structure($tree))
46050TFif ($$data{"config"})
46850TFif (my $ini = 'Config::IniFiles'->new('-file', $path)) { }
4740TFif ($logger) { }
48150TFif ($data)
48250TFif ($logger)
491100TFunless ($$self{"script_name"})
49250TFunless "File::Basename"->can("basename")
500100TFunless defined $config_file
503100TFif $config_file eq $script_name and length $dir == 0 || $dir eq 'File::Spec'->curdir
504100TFlength $dir ? :
50550TFif ($logger)
508100TFif (-f $path and -r $path)
51050TFif ($logger)
514100TFif ($data =~ /^\s*<\?xml/ or $data =~ m[</.+>]) { }
50TFelsif ($data =~ /\{.+:.\}/s) { }
51550TFif ($self->_load_driver('XML::Simple', ['XMLin'])) { }
50TFelsif ($self->_load_driver('XML::PP')) { }
5160TFif ($data = XMLin($path, "ForceArray", 0, "KeyAttr", scalar []))
52150TFif (my $tree = $xml_pp->parse(\$data))
52250TFif ($data = $xml_pp->collapse_structure($tree))
52450TFif ($$data{"config"})
5350TFif ($is_json) { }
5370TFif ($@)
5430TFif ($data)
549100TFunless ($data)
551100TFif (eval {         do {         $data = LoadFile($path) } } and ref $data eq "HASH")
55650TFif $v =~ /^".+"$/
557100TFif ($v =~ /,/)
56150TFif ($val =~ /(.+)=(.+)/) { }
56950TFif ($data)
573100TFif (not $data or ref $data ne "HASH")
57550TFif (my $ini = "Config::IniFiles"->new("-file", $path))
5800TFif ($data)
58450TFif (not $data or ref $data ne "HASH")
58650TFif ($self->_load_driver("XML::Simple", ["XMLin"]))
58950TFif (not $data or ref $data ne "HASH")
59050TFif ($self->_load_driver("Config::Abstract"))
5950TFif ($@) { }
0TFelsif ($data) { }
5990TFif (scalar keys %{$data;} == 0)
60750TFif (not $data or ref $data ne "HASH")
61050TFif ($data = $ca->parse)
61850TFif ($logger)
6190TFif ($@) { }
626100TFif (scalar keys %merged) { }
50TFelsif ($data and ref $data eq 'HASH') { }
0TFelsif (not $@ and $logger) { }
62750TFif ($data)
647100TFunless $key =~ /^$$self{"env_prefix"}(.*)$/i
649100TFif ($path =~ /__/) { }
66150TFunless $arg =~ /=/
66350TFunless $key =~ /^\-\-$$self{"env_prefix"}(.*)$/
672100TFif ($$self{'flatten'}) { }
679100TF$$self{'flatten'} ? :
693100TFif ($$self{"flatten"})
69850TFunless ref $ref eq "HASH"
701100TFif (defined $ref and not $$self{"no_fixate"})
70250TFif (ref $ref eq 'HASH') { }
100TFelsif (ref $ref eq 'ARRAY') { }
72450TF$$self{'config'} && scalar keys %{$$self{'config'};} ? :
77650TFif scalar @_ == 0
780100TFunless defined $defaults
78550TFif ($$config{"global"})
7860TFif ($$params{'deep'}) { }
79350TFif ($section and $$config{$section})
796100TFif ($$params{"merge"})
807100TFif $$self{"loaded"}{$driver}
808100TFif $$self{"failed"}{$driver}
811100TFif ($@)
81250TFif (my $logger = $$self{"logger"})
860100TFif $key eq "DESTROY"
868100TFif ($$self{"flatten"})
86950TFif exists $data->{$key}
877100TFif (ref $val eq 'HASH' and exists $val->{$part}) { }