Branch Coverage

blib/lib/Parse/PlainConfig/Legacy.pm
Criterion Covered Total %
branch 188 246 76.4


line true false branch
90 0 12 unless $self->property($k, $v)
93 0 19 unless $rv
111 40 18 defined $val ? :
116 1 57 unless defined $arg and exists $self->{$arg}
120 39 18 scalar @args == 2 ? :
125 39 18 if (scalar @args == 2)
127 2 37 if ($arg eq 'ORDER') { }
7 30 elsif ($arg eq 'CONF' or $arg eq 'COERCE' or $arg eq 'DEFAULTS') { }
1 29 elsif (ref $val ne '') { }
130 1 1 unless (ref $val eq "ARRAY")
140 1 6 unless (ref $val eq "HASH")
147 6 1 if ($rv)
149 3 3 if ($arg eq 'COERCE') { }
3 0 elsif ($arg eq 'DEFAULTS') { }
153 6 0 defined $val->{$_} ? :
154 1 3 unless ($ival eq "string" or $ival eq "list" or $ival eq "hash")
170 0 0 unless exists $self->{'CONF'}{$k}
189 53 4 if ($rv)
190 35 18 if (scalar @args == 2) { }
193 1 34 if (ref $val eq 'ARRAY') { }
5 29 elsif (ref $val eq 'HASH') { }
211 2 16 if (defined $self->{$arg} and ref $self->{$arg} ne '') { }
214 1 0 ref $self->{$arg} eq 'HASH' ? :
1 1 ref $self->{$arg} eq 'ARRAY' ? :
216 2 0 if (defined $rv) { }
217 0 2 unless (&deepCopy(\$self->{$arg}, \$rv))
275 0 26 unless defined $file
291 26 0 if (&detaint(\$file, 'filename')) { }
292 25 1 if (&slurp($file, \@lines, 1)) { }
295 5 20 if $self->{'AUTOPURGE'}
331 0 3 unless defined $file
336 2 1 if (-e $file and -r _) { }
343 1 1 $mtime > $omtime ? :
385 0 5 unless defined $file
389 5 0 unless defined $padding
390 3 2 unless $smart
395 5 0 $padding == 2 ? :
0 5 $padding == 1 ? :
0 5 $padding == 0 ? :
405 8 43 unless grep /^\Q$tmp\E$/ms, @forder
415 51 0 exists $conf->{$param} ? :
417 51 0 exists $conf->{$param} ? :
419 11 18 ref $value eq 'ARRAY' ? :
3 29 ref $value eq 'HASH' ? :
19 32 exists $coerce->{$param} ? :
427 0 51 unless $out =~ /\n$/ms
434 29 22 if ($type eq 'string') { }
17 5 elsif ($type eq 'list') { }
438 19 10 unless ($smart and exists $coerce->{$param})
440 4 15 if $tvalue =~ /$delimRegex/ms
450 20 34 if ($smart and exists $coerce->{$param}) { }
451 4 16 if /\Q$listDelim\E/ms
453 12 22 if /$delimRegex/ms
465 0 20 if /$delimRegex/ms
466 0 20 if ($tmp ne $_)
472 5 15 if $tvalue->{$tmp} =~ /$delimRegex/ms
480 20 31 $smart ? :
481 0 51 unless $out =~ /\n$/ms
485 5 0 if (&detaint(\$file, 'filename')) { }
486 5 0 if (open $fh, '>', $file) { }
490 5 0 if (print $fh $out) { }
499 5 0 if $rv
544 37 40 defined $value ? :
551 51 26 exists $self->{'COERCE'}{$param} ? :
561 0 77 unless defined $param
566 37 40 if (scalar @args == 2) { }
574 8 29 unless exists $conf->{$param}
577 32 5 if ($coerceType ne 'undef') { }
581 3 29 if ($coerceType eq 'string' and ref $value ne '') { }
3 26 elsif ($coerceType eq 'list' and ref $value ne 'ARRAY') { }
3 23 elsif ($coerceType eq 'hash' and ref $value ne 'HASH') { }
584 2 1 if (ref $value eq 'ARRAY') { }
1 0 elsif (ref $value eq 'HASH') { }
589 0 7 if /\Q$listDelim\E/ms
600 0 2 if /(?:\Q$hashDelim\E|\Q$listDelim\E)/ms
602 0 2 unless defined $value->{$_}
604 0 2 if $value->{$_} =~ /(?:\Q$hashDelim\E|\Q$listDelim\E)/ms
608 2 0 defined $value->{$_} ? :
621 2 1 if (ref $value eq 'HASH') { }
1 0 elsif (ref $value eq '') { }
648 1 2 if (ref $value eq 'ARRAY') { }
2 0 elsif (ref $value eq '') { }
652 1 0 unless int scalar @$value / 2 == scalar @$value / 2
690 1 0 exists $defaults->{$param} ? :
39 1 exists $conf->{$param} ? :
696 11 60 ref $rv eq 'ARRAY' ? :
6 71 ref $rv eq 'HASH' ? :
708 21 0 defined $type ? :
712 0 12 unless $itype eq "string" or $itype eq "list" or $itype eq "hash"
716 0 21 unless @params
722 45 0 if (defined $_) { }
727 22 23 if exists $self->{'CONF'}{$_}
763 0 0 unless (exists $conf->{$_})
765 0 0 if (exists $coerce->{$_}) { }
768 0 0 $coerce->{$_} eq 'hash' ? :
0 0 $coerce->{$_} eq 'list' ? :
795 1 1 if scalar @new
824 0 28 unless $self->{'LIST_DELIM'} ne $self->{'HASH_DELIM'}
835 174 511 if ($lines[$i] =~ /\\\s*$/ms)
845 174 0 if ($i < $#lines)
865 27 217 if (exists $self->{'COERCE'}{$field}) { }
873 79 112 scalar quotewords(qr/\s*\Q$listDelim\E\s*/ms, 0, $value) > 1 ? :
26 191 scalar quotewords(qr/\s*\Q$hashDelim\E\s*/ms, 0, $value) > 1 ? :
884 132 112 unless $type eq "scalar"
892 112 132 if ($type eq 'scalar') { }
30 102 elsif ($type eq 'hash') { }
88 14 elsif ($type eq 'list') { }
897 20 0 unless $smart and exists $self->{'COERCE'}{$field} and $self->{'COERCE'}{$field} eq "scalar"
912 171 73 unless grep /^\Q$field\E$/ms, @$order
920 208 303 if ($line =~ /^\s*(?:#.*)?$/ms) { }
926 16 192 if length $entry
929 110 98 length $comment > 0 ? :
939 0 303 unless (length $entry or $line =~ /\Q$tagDelim\E/ms)
948 121 182 if ($smart) { }
952 96 25 if (length $entry) { }
956 59 37 if (length $indentation > $i) { }
987 9 19 if length $entry
1024 576 38 if (length $segment <= $textWidth - length($lines[-1])) { }
23 15 elsif (length $segment <= $textWidth - length($subIndent)) { }
1039 0 15 $#lines == 0 ? :
1043 15 0 if (length $segment > $textWidth - length($lines[-1])) { }
1045 0 15 $#lines == 0 ? :
1074 0 3 unless defined $param