Branch Coverage

blib/lib/Config/IniFiles.pm
Criterion Covered Total %
branch 292 388 75.2


line true false branch
26 95 4745 if (@_)
28 10 85 shift @_ ? :
60 9 76 if (ref $parms{'-import'} and $parms{'-import'}->isa('Config::IniFiles')) { }
0 76 elsif (defined $parms{'-import'}) { }
82 68 17 if (defined($v = delete $parms{'-file'}))
88 10 75 if (defined($v = delete $parms{'-nocase'}))
92 7 78 if (defined($v = delete $parms{'-default'}))
94 7 0 $self->_nocase ? :
96 1 84 if (defined($v = delete $parms{'-fallback'}))
98 0 1 $self->_nocase ? :
100 0 85 if (defined($v = delete $parms{'-reloadwarn'}))
102 0 0 $v ? :
104 1 84 if (defined($v = delete $parms{'-nomultiline'}))
106 1 0 $v ? :
108 1 84 if (defined($v = delete $parms{'-allowcontinue'}))
110 1 0 $v ? :
112 11 74 if (defined($v = delete $parms{'-allowempty'}))
114 11 0 $v ? :
116 0 85 if (defined($v = delete $parms{'-negativedeltas'}))
118 0 0 $v ? :
120 2 83 if (defined($v = delete $parms{'-commentchar'}))
122 0 2 if (not defined $v or length $v != 1) { }
0 2 elsif ($v =~ /[\[\]=\w]/) { }
138 2 83 if (defined($v = delete $parms{'-allowedcommentchars'}))
141 0 2 if (not defined $v or $v =~ /[\[\]=\w]/) { }
152 4 81 if (defined($v = delete $parms{'-handle_trailing_comment'}))
154 3 1 $v ? :
156 1 84 if (defined($v = delete $parms{'-php_compat'}))
158 1 0 $v ? :
161 83 2 unless exists $self->{'comment_char'}
163 83 2 unless exists $self->{'allowed_comment_char'}
177 0 85 if $errs
179 81 4 if ($self->ReadConfig) { }
194 1348 3389 if ($self->_nocase)
202 27 4710 if ($self->{'php_compat'})
210 2 2 if (length ${$ref;} >= 2)
213 2 0 if ($quote eq '"' || $quote eq q['] and substr(${$ref;}, -1, 1) eq $quote)
217 1 1 if $quote eq '"'
231 0 107 unless (defined $sect and defined $parm)
241 95 12 defined $self->{'v'}{$sect}{$parm} ? :
246 7 100 unless (defined $val)
252 34 73 if (wantarray) { }
5 68 elsif (ref $val eq 'ARRAY') { }
254 12 22 if (ref $val eq 'ARRAY') { }
20 2 elsif (defined $val) { }
269 5 0 defined $/ ? :
292 0 92 unless defined $sect
293 0 92 unless defined $parm
297 0 92 unless defined $self->{'v'}{$sect}{$parm}
299 0 92 unless @vals
304 56 36 unless defined $self->{'EOT'}{$sect}{$parm}
307 56 36 unless ref $self->{'v'}{$sect}{$parm} eq 'ARRAY'
321 0 1 unless defined $sect
322 0 1 unless defined $parm
326 0 1 if (defined $self->{'v'}{$sect}{$parm}) { }
329 0 0 if (@val > 1) { }
354 0 638 unless defined $sect
355 0 638 unless defined $parm
361 611 27 if (&none(sub { $_ eq $parm; } , @{$$self{'parms'}{$sect};}))
367 112 526 if (@val > 1) { }
370 105 7 unless (defined $self->{'EOT'}{$sect}{$parm})
389 0 6 unless defined $sect
390 0 6 unless defined $parm
409 206 205 unless (ref $ref)
414 64 141 if (UNIVERSAL::isa($ref, 'ARRAY'))
419 141 0 if (UNIVERSAL::isa($ref, 'HASH'))
437 82 1975 if (not exists $self->{'line_ends'}) { }
447 12 1096 unless defined $nextchar
451 4 66 if ($nextchar eq "\r")
455 3 1 if ($nextchar eq "\n") { }
488 70 12 if (not ref $self->{'cf'}) { }
512 2059 2111 if (@_)
527 80 1977 unless (defined $line)
554 416 5161 if (@_)
567 771 2995 if (@_)
588 804 1280 if (@_)
600 1104 1219 if (@_)
612 1251 689 if (@_)
627 2 118 if ($self->{'negativedeltas'} and my($to_delete) = $line =~ /\A$self->{'comment_char'} (.*) is deleted\z/) { }
631 1 1 if (my($sect) = $to_delete =~ /\A\[(.*)\]\z/) { }
666 1 690 if (not defined $self->_curr_sect and defined $self->{'fallback'})
680 92 597 if (exists $self->{'v'}{$self->_curr_sect}{$self->_curr_parm} and exists $self->{'myparms'}{$self->_curr_sect} and $self->_is_parm_in_sect($self->_curr_loc)) { }
702 2 689 unless (defined $self->_curr_sect)
726 129 368 if ($line eq $eotmark) { }
739 0 129 unless ($foundeot)
763 4 556 if ($end_commenthandle and my($value_to_assign, $end_comment_to_assign) = $self->_curr_val =~ /(.*?)\s*[$allCmt]\s*(.*)$/) { }
788 129 560 if (defined $eotmark)
809 2 689 unless (defined $self->_test_for_fallback_or_no_sect($fh))
820 129 560 if (($eotmark) = $self->_curr_val =~ /\A<<(.*)$/) { }
822 0 129 unless (defined $self->_ReadConfig_handle_here_doc_param($fh, $eotmark, \@val))
851 331 1147 if ($line =~ /\A\s*\z/)
857 120 1027 if ($line =~ /\A\s*[$allCmt]/)
863 333 694 if (my($sect) = $line =~ /\A\s*\[\s*(\S|\S.*\S)\s*\]\s*\z/)
869 691 3 if (my($parm, $value_to_assign) = $line =~ /^\s*([^=]*?[^=\s])\s*=\s*(.*)$/)
898 2 1476 unless (defined scalar $self->_ReadConfig_handle_line($fh, $line))
931 13 86 if (defined $self->{'imported'})
939 17 82 if ($self->_no_filename)
945 0 82 if ($self->{'reloadwarn'})
955 0 82 unless ($fh)
963 78 4 if (ref $fh ne 'IO::Scalar' and -e $fh)
966 78 0 if defined $stats[2]
976 2 80 unless (defined $self->_ReadConfig_lines_loop($fh))
983 1 4 unless (keys %{$$self{'v'};} or $self->{'allowempty'})
990 11 68 if (defined(my $defaultsect = $self->{'startup_settings'}{'-default'}))
998 1 78 @Config::IniFiles::errors ? :
1015 0 994 unless defined $sect
1019 639 355 exists $self->{'e'}{$sect} ? :
1035 353 1 unless (defined $self->{'v'}{$sect})
1050 0 988 unless defined $sect
1054 636 352 if ($self->SectionExists($sect))
1069 363 1528 unless (exists $self->{'mye'}{$sect})
1084 0 1458 unless exists $self->{'v'}{$sect}
1087 637 821 unless ($self->_is_parm_in_sect($sect, $parm))
1101 0 7 unless defined $sect
1130 0 1 unless $self->CopySection($old_sect, $new_sect, $include_groupmembers)
1144 0 2 if (not defined $old_sect && defined $new_sect && $self->SectionExists($old_sect) or $self->SectionExists($new_sect))
1158 3 11 unless exists $self->{$key}{$old_sect}
1163 0 2 if ($include_groupmembers)
1181 28 4 defined $aref && ref $aref eq 'ARRAY' ? :
1189 0 22 unless defined $sect
1201 2 0 if (ref $self->{'group'} eq 'HASH') { }
1216 0 361 unless defined $sect
1218 234 127 if (not my($group) = $sect =~ /\A(\S+)\s+\S/) { }
1232 69 58 unless (exists $self->{'group'}{$group})
1237 127 0 if (&none(sub { $_ eq $sect; } , @{$$self{'group'}{$group};}))
1258 0 0 unless (exists $self->{'group'}{$group})
1282 0 6 unless defined $group
1294 0 5 unless (defined $mode and $mode =~ /[0-7]{3}/)
1315 7 16 if (-e $filename)
1317 0 7 unless (-w $filename)
1343 0 23 if ($^O =~ /\AMSWin/)
1349 0 23 if ($@)
1357 0 23 unless (rename $new_file, $filename)
1362 19 4 if (exists $self->{'file_mode'})
1375 0 3 if ($fh == \*STDIN) { }
1404 0 3 unless ($fh)
1417 0 26 unless defined $file
1421 23 3 if (not ref $file) { }
1439 0 16 if ($self->_no_filename)
1460 12 0 if (length $new_filename > 0) { }
1499 1 201 $end_comment ? :
1506 10 202 if (not @$val) { }
137 65 elsif (@$val == 1 or $self->{'nomultiline'}) { }
1539 167 203 if (ref $comments_aref eq 'ARRAY')
1554 533 27 unless ($self->{'allowcontinue'})
1574 1 212 unless (defined $self->{'v'}{$sect}{$parm})
1576 1 0 if ($delta) { }
1582 0 0 if $^W
1592 0 212 unless defined $val
1594 153 59 defined $end_comment ? :
1604 1 131 unless (defined $self->{'v'}{$sect})
1606 1 0 if ($delta) { }
1612 0 0 if $^W
1616 0 131 unless defined $self->{'v'}{$sect}
1617 106 25 if $position > 0
1620 130 1 unless ($self->{'fallback_used'} and $sect eq $self->{'fallback'})
1624 0 131 if ref $self->{'v'}{$sect} ne 'HASH'
1626 7 124 $delta ? :
1647 0 749 unless print {$fh;} @_, $ors
1656 64 148 ref $val eq 'ARRAY' ? :
1664 3 24 $delta ? :
1680 265 70 unless (defined $sect and @comment)
1708 110 7 $_ =~ /$is_comment/ ? :
1716 9 0 defined $/ ? :
1718 6 3 wantarray ? :
1725 0 8 unless defined $sect
1729 3 5 unless (exists $self->{'sCMT'}{$sect})
1743 0 2 unless defined $sect
1758 659 31 unless (defined $sect and defined $parm and @comment)
1796 0 4 unless (defined $sect and defined $parm)
1803 0 4 unless (exists $self->{'pCMT'}{$sect} and exists $self->{'pCMT'}{$sect}{$parm})
1819 0 1 unless (defined $sect and defined $parm)
1827 1 0 if (exists $self->{'pCMT'}{$sect} and exists $self->{'pCMT'}{$sect}{$parm})
1842 0 0 unless (defined $sect and defined $parm)
1857 0 129 unless (defined $sect and defined $parm and defined $EOT)
1876 0 0 unless (defined $sect and defined $parm)
1894 129 561 unless (defined $sect and defined $parm and defined $cmt)
1902 0 561 unless exists $self->{'v'}{$sect}{$parm}
1915 0 5 unless (defined $sect and defined $parm)
1923 0 5 unless exists $self->{'v'}{$sect}{$parm}
1984 1 32 unless $self->{'v'}{$key}
1986 21 11 if exists $self->{'_section_cache'}{$key}
2006 0 4 unless ref $ref eq 'HASH'
2072 1 10 unless defined $key
2073 0 10 wantarray ? :
2128 3 82 if (ref $thing eq 'SCALAR')
2130 3 0 if (eval { do { require IO::Scalar; $IO::Scalar::VERSION >= 2.109 } }) { }
2136 0 0 if $^W
2143 13 69 if defined fileno $thing
2147 0 69 if defined fileno $fh
2151 0 69 unless open $fh, $thing
2230 18 4 @retval <= 1 ? :
2344 3 10 unless defined $key
2345 0 10 wantarray ? :