FromConfig/Loader.pm

filter: Statementstmt 100% 26 / 26 Branchbran n/a Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 14 / 14 Podpod n/a totaltotal 91.3% 42 / 46 CC 3 SCAR 2.5
CC
3
Cov
93%
__ANON__
2.1
__ANON__
2.1
BEGIN
1.0
CRAP 1.3
↑ Summary FromConfig.pm »
1  
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  
5 package Path::IsDev::HeuristicSet::FromConfig::Loader;
6 4 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 $Path::IsDev::HeuristicSet::FromConfig::Loader::AUTHORITY = 'cpan:KENTNL';
8 }
9 {
10 4 $Path::IsDev::HeuristicSet::FromConfig::Loader::VERSION = '0.002000';
11 }
12  
13 # ABSTRACT: Configuration loader and decoder for C<::FromConfig>
14  
15 3 ▶sub _path {
Subroutine _path: called CC=1 SCAR=0.0
16 3 require Path::Tiny;
17 3 goto \&Path::Tiny::path;
18 }
19  
20  
21 4 ▶use Class::Tiny {
Subroutine BEGIN: called CC=1 SCAR=0.0
22 3 ▶ dist => sub { 'Path-IsDev-HeuristicSet-FromConfig' },
Subroutine __ANON__: called CC=1 SCAR=0.0
23 3 ▶ module => sub { 'Path::IsDev::HeuristicSet::FromConfig' },
Subroutine __ANON__: called CC=1 SCAR=0.0
24 3 ▶ config_file => sub { 'config.json' },
Subroutine __ANON__: called CC=1 SCAR=0.0
25 3 ▶ config_file_full => sub { _path( $_[0]->config->configdir )->child( $_[0]->config_file ) },
Subroutine __ANON__: called CC=1 SCAR=0.0
26 3 ▶ config => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
27 3 require File::UserConfig;
28 3 return File::UserConfig->new(
29 dist => $_[0]->dist,
30 module => $_[0]->module,
31 );
32 },
33 3 ▶ decoder => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
34 3 require JSON;
35 3 return JSON->new();
36 },
37 3 ▶ data => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
38 3 $_[0]->decoder->decode( $_[0]->config_file_full->slurp_utf8 );
39 },
40 2 ▶ heuristics => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
41 2 ▶ return $_[0]->data->{heuristics} || [];
Condition50%1/2
$_[0]->data->{'heuristics'} || []
l!l
20
MC/DC0%0/1
$_[0]->data->{'heuristics'} || []
$_[0]->data->{'heuristics'}
Truth table50%1/2
A
A= $_[0]->data->{'heuristics'}
Aresult
11
00
42 },
43 2 ▶ negative_heuristics => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
44 2 ▶ return $_[0]->data->{negative_heuristics} || [];
Condition50%1/2
$_[0]->data->{'negative_heuristics'} || []
l!l
20
MC/DC0%0/1
$_[0]->data->{'negative_heuristics'} || []
$_[0]->data->{'negative_heuristics'}
Truth table50%1/2
A
A= $_[0]->data->{'negative_heuristics'}
Aresult
11
00
45 },
46 4 };
47  
48  
49  
50  
51  
52  
53  
54  
55 4 1;
56  
57 __END__
↑ Summary FromConfig.pm »