App/SmokeBrew/IniFile.pm

filter: Statementstmt 88.2% 15 / 17 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 80.6% 25 / 31 CC 4 SCAR 10.9
CC
4
Cov
83%
set_value
4.5
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« App/SmokeBrew/Tools.pm ↑ Summary App/SmokeBrew/PerlVersion.pm »
1 package App::SmokeBrew::IniFile;
2 4 $App::SmokeBrew::IniFile::VERSION = '1.06';
3 #ABSTRACT: Parse the smokebrew configuration file
4  
5 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use base 'Config::INI::Reader';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 12 ▶sub set_value {
Subroutine set_value: called CC=4 SCAR=15.0
Pod documented
10 12 my ($self, $name, $value) = @_;
11  
12 12 ▶ if ( defined $self->{data}{ $self->current_section }{$name}
Branch: 2 branches
BranchTrueFalseTotal
if (defined $self->{'data'}{$self->current_section}{$name} and ref $self->{'data'}{$self->current_section}{$name} eq 'ARRAY') { } 0 12 12
elsif (defined $self->{'data'}{$self->current_section}{$name}) { } 2 10 12
Condition66%2/3
defined $self->{"data"}{$self->current_section}{$name} and ref $self->{"data"}{$self->current_section}{$name} eq "ARRAY"
!ll&&!rl&&r
1020
MC/DC0%0/2
defined $self->{"data"}{$self->current_section}{$name} and ref $self->{"data"}{$self->current_section}{$name} eq "ARRAY"
defined $self->{"data"}{$self->current_section}{$name} ref $self->{"data"}{$self->current_section}{$name} eq "ARRAY"
Truth table66%2/3
A and B
A= defined $self->{"data"}{$self->current_section}{$name}B= ref $self->{"data"}{$self->current_section}{$name} eq "ARRAY"
ABresult
0X0
100
111
13 and ref $self->{data}{ $self->current_section }{$name} eq 'ARRAY' ) {
14 0 push @{ $self->{data}{ $self->current_section }{$name} }, $value;
15 }
16 elsif ( defined $self->{data}{ $self->current_section }{$name} ) {
17 $self->{data}{ $self->current_section }{$name}
18 2 = [ $self->{data}{ $self->current_section }{$name}, $value ];
19 }
20 else {
21 10 $self->{data}{ $self->current_section }{$name} = $value;
22 }
23 }
24  
25 4 qq[Smokin'];
26  
27 __END__
« App/SmokeBrew/Tools.pm ↑ Summary App/SmokeBrew/PerlVersion.pm »