Config/MakeMaker.pm

filter: Statementstmt 81.0% 30 / 37 Branchbran 83.3% 5 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 72.7% 8 / 11 Podpod 100% 8 / 8 totaltotal 76.1% 51 / 67 CC 7 SCAR 9.7
CC
7
Cov
76%
serialize
6.0
values_set
4.0
get
2.0
CRAP 2.6
↑ Summary Config.pm »
1 package ExtUtils::Config::MakeMaker;
2 2 $ExtUtils::Config::MakeMaker::VERSION = '0.010';
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use ExtUtils::MakeMaker::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
9 1 my ($class, $maker) = @_;
10 1 return bless { maker => $maker }, $class;
11 }
12  
13 1256 ▶sub get {
Subroutine get: called CC=2 SCAR=6.9
Pod documented
14 1256 my ($self, $key) = @_;
15 1256 ▶ return exists $self->{maker}{uc $key} ? $self->{maker}{uc $key} : $Config{$key};
Branch: 1 branch
BranchTrueFalseTotal
exists $self->{'maker'}{uc $key} ? : 1 1255 1256
16 }
17  
18 0 ▶sub exists {
Subroutine exists: not called CC=1 SCAR=6.9
Pod documented
19 0 my ($self, $key) = @_;
20 0 return exists $Config{$key};
21 }
22  
23 1 ▶sub all_config {
Subroutine all_config: called CC=2 SCAR=6.9
Pod documented
24 1 my $self = shift;
25 1 my %result;
26 1 for my $key (keys %Config) {
27 1256 $result{$key} = $self->get($key);
28 }
29 1 return \%result;
30 }
31  
32 2 ▶sub values_set {
Subroutine values_set: called CC=4 SCAR=13.9
Pod documented
33 2 my $self = shift;
34 2 my %result;
35 2 for my $key (keys %Config) {
36 2512 ▶ next if not exists $self->{maker}{uc $key};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"maker"}{uc $key} 2510 2 2512
37 2 ▶ next if $self->{maker}{uc $key} eq $Config{$key};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"maker"}{uc $key} eq $ExtUtils::Config::MakeMaker::Config{$key} 0 2 2
38 2 $result{$key} = $self->{maker}{uc $key};
39 }
40 2 return \%result;
41 }
42  
43 0 ▶sub serialize {
Subroutine serialize: not called CC=2 SCAR=17.9
Pod documented
44 0 my $self = shift;
45 0 require Data::Dumper;
46 0 ▶ return $self->{serialized} ||= Data::Dumper->new($self->values_set)->Terse(1)->Sortkeys(1)->Dump;
Condition0%0/3
$self->{"serialized"} ||= "Data::Dumper"->new($self->values_set)->Terse(1)->Sortkeys(1)->Dump
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"serialized"} ||= "Data::Dumper"->new($self->values_set)->Terse(1)->Sortkeys(1)->Dump
$self->{"serialized"} "Data::Dumper"->new($self->values_set)->Terse(1)->Sortkeys(1)->Dump
Truth table0%0/3
A ||= B
A= $self->{"serialized"}B= "Data::Dumper"->new($self->values_set)->Terse(1)->Sortkeys(1)->Dump
ABresult
1X1
011
000
47 }
48  
49 1 ▶sub materialize {
Subroutine materialize: called CC=1 SCAR=0.0
Pod documented
50 1 my $self = shift;
51 1 require ExtUtils::Config;
52 1 return ExtUtils::Config->new($self->values_set);
53 }
54  
55 0 ▶sub but {
Subroutine but: not called CC=1 SCAR=6.9
Pod documented
56 0 my ($self, %args) = @_;
57 0 return $self->materialize->but(%args);
58 }
59  
60 2 1;
61  
62 #ABSTRACT: A ExtUtils::Config compatible wrapper for ExtUtils::MakeMaker's configuration.
63  
64 __END__
↑ Summary Config.pm »