Branch Coverage

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


line true false branch
91 0 12 unless $self->property($k, $v)
94 0 19 unless $rv
113 40 18 defined $val ? :
118 1 57 unless defined $arg and exists $self->{$arg}
123 39 18 scalar @args == 2 ? :
128 39 18 if (scalar @args == 2)
130 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 '') { }
133 1 1 unless (ref $val eq 'ARRAY')
143 1 6 unless (ref $val eq 'HASH')
150 6 1 if ($rv)
152 3 3 if ($arg eq 'COERCE') { }
3 0 elsif ($arg eq 'DEFAULTS') { }
156 6 0 defined $val->{$_} ? :
157 1 3 unless ($ival eq 'string' or $ival eq 'list' or $ival eq 'hash')
173 0 0 unless exists $self->{'CONF'}{$k}
192 53 4 if ($rv)
193 35 18 if (scalar @args == 2) { }
196 1 34 if (ref $val eq 'ARRAY') { }
5 29 elsif (ref $val eq 'HASH') { }
214 2 16 if (defined $self->{$arg} and ref $self->{$arg} ne '') { }
217 1 0 ref $self->{$arg} eq 'HASH' ? :
1 1 ref $self->{$arg} eq 'ARRAY' ? :
219 2 0 if (defined $rv) { }
220 0 2 unless (&deepCopy(\$self->{$arg}, \$rv))
281 0 26 unless defined $file
298 26 0 if (&detaint(\$file, 'filename')) { }
299 25 1 if (&slurp($file, \@lines, 1)) { }
302 5 20 if $self->{'AUTOPURGE'}
339 0 3 unless defined $file
345 2 1 if (-e $file and -r _) { }
352 1 1 $mtime > $omtime ? :
395 0 5 unless defined $file
399 5 0 unless defined $padding
400 3 2 unless $smart
406 5 0 $padding == 2 ? :
0 5 $padding == 1 ? :
0 5 $padding == 0 ? :
416 8 43 unless grep /^\Q$tmp\E$/ms, @forder
426 51 0 exists $conf->{$param} ? :
428 51 0 exists $conf->{$param} ? :
430 11 18 ref $value eq 'ARRAY' ? :
3 29 ref $value eq 'HASH' ? :
19 32 exists $coerce->{$param} ? :
438 0 51 unless $out =~ /\n$/ms
445 29 22 if ($type eq 'string') { }
17 5 elsif ($type eq 'list') { }
449 19 10 unless ($smart and exists $coerce->{$param})
451 4 15 if $tvalue =~ /$delimRegex/ms
461 20 34 if ($smart and exists $coerce->{$param}) { }
462 4 16 if /\Q$listDelim\E/ms
464 12 22 if /$delimRegex/ms
476 0 20 if /$delimRegex/ms
477 0 20 if ($tmp ne $_)
483 5 15 if $tvalue->{$tmp} =~ /$delimRegex/ms
491 20 31 $smart ? :
492 0 51 unless $out =~ /\n$/ms
496 5 0 if (&detaint(\$file, 'filename')) { }
497 5 0 if (open $fh, '>', $file) { }
501 5 0 if (print $fh $out) { }
510 5 0 if $rv
556 37 40 defined $value ? :
563 51 26 exists $self->{'COERCE'}{$param} ? :
573 0 77 unless defined $param
579 37 40 if (scalar @args == 2) { }
587 8 29 unless exists $conf->{$param}
590 32 5 if ($coerceType ne 'undef') { }
594 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') { }
597 2 1 if (ref $value eq 'ARRAY') { }
1 0 elsif (ref $value eq 'HASH') { }
602 0 7 if /\Q$listDelim\E/ms
613 0 2 if /(?:\Q$hashDelim\E|\Q$listDelim\E)/ms
615 0 2 unless defined $value->{$_}
617 0 2 if $value->{$_} =~ /(?:\Q$hashDelim\E|\Q$listDelim\E)/ms
621 2 0 defined $value->{$_} ? :
634 2 1 if (ref $value eq 'HASH') { }
1 0 elsif (ref $value eq '') { }
661 1 2 if (ref $value eq 'ARRAY') { }
2 0 elsif (ref $value eq '') { }
665 1 0 unless int scalar @$value / 2 == scalar @$value / 2
703 1 0 exists $defaults->{$param} ? :
39 1 exists $conf->{$param} ? :
710 11 60 ref $rv eq 'ARRAY' ? :
6 71 ref $rv eq 'HASH' ? :
722 21 0 defined $type ? :
726 0 12 unless $itype eq 'string' or $itype eq 'list' or $itype eq 'hash'
730 0 21 unless @params
737 45 0 if (defined $_) { }
742 22 23 if exists $self->{'CONF'}{$_}
780 0 0 unless (exists $conf->{$_})
782 0 0 if (exists $coerce->{$_}) { }
785 0 0 $coerce->{$_} eq 'hash' ? :
0 0 $coerce->{$_} eq 'list' ? :
813 1 1 if scalar @new
842 0 28 unless $self->{'LIST_DELIM'} ne $self->{'HASH_DELIM'}
854 174 511 if ($lines[$i] =~ /\\\s*$/ms)
864 174 0 if ($i < $#lines)
884 27 217 if (exists $self->{'COERCE'}{$field}) { }
892 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 ? :
903 132 112 unless $type eq 'scalar'
911 112 132 if ($type eq 'scalar') { }
30 102 elsif ($type eq 'hash') { }
88 14 elsif ($type eq 'list') { }
916 20 0 unless $smart and exists $self->{'COERCE'}{$field} and $self->{'COERCE'}{$field} eq 'scalar'
931 171 73 unless grep /^\Q$field\E$/ms, @$order
939 208 303 if ($line =~ /^\s*(?:#.*)?$/ms) { }
945 16 192 if length $entry
948 110 98 length $comment > 0 ? :
958 0 303 unless (length $entry or $line =~ /\Q$tagDelim\E/ms)
967 121 182 if ($smart) { }
971 96 25 if (length $entry) { }
975 59 37 if (length $indentation > $i) { }
1006 9 19 if length $entry
1045 576 38 if (length $segment <= $textWidth - length($lines[-1])) { }
23 15 elsif (length $segment <= $textWidth - length($subIndent)) { }
1060 0 15 $#lines == 0 ? :
1064 15 0 if (length $segment > $textWidth - length($lines[-1])) { }
1066 0 15 $#lines == 0 ? :
1096 0 3 unless defined $param