Branch Coverage

blib/lib/Config/FileManager.pm
Criterion Covered Total %
branch 44 70 62.8


line true false branch
261 0 1 unless exists $settings{$required}
269 0 3 unless $self->can($attrib)
276 2 3 unless defined $settings{$attrib}
298 1 8 if (@_)
319 1 2 if (@_)
341 1 2 if (@_)
362 1 1 if (@_)
382 3 15 if (@_)
402 2 9 unless (@{$$self{'allVersions'};})
406 7 2 if (ref $cur_ver eq 'HASH')
434 2 11 if (@_)
462 0 12 unless exists $params{$required}
465 0 4 if defined $$self{'patches'}{'patch from v' . $params{'from'}}
484 10 1 if defined $$self{'full_path'}
494 1 0 if (-e $path)
496 0 1 if (-e "$full_path")
506 0 1 if ($path =~ /^__APPDIR__$/)
511 1 0 if (-e $path)
519 0 1 unless open CFG_FILE, '>' . $full_path
544 0 1 unless open CFG_FILE, '<' . $self->getPath
550 1 6 if (/^#.*configuration file (\d+.\d+.\d+.*)$/)
556 1 0 if ($current_user_config_version ne $self->version)
566 1 0 if ($diffs) { }
577 1 0 unless (eval { do { my $old_default_config = $self->getDefaultContent($current_user_config_version); $old_default_config =~ s/$current_user_config_version/__VERSION__/; $current_user_config =~ s/$current_user_config_version/__VERSION__/; $diffs = diff(\$old_default_config, \$current_user_config, {'STYLE', 'OldStyle'}); if ($diffs) { $current_user_config = patch($self->defaultContent, $diffs, {'STYLE', 'OldStyle'}); } else { $current_user_config = $self->getDefaultContent; } ; my $v = $self->version; $current_user_config =~ s/__VERSION__/$v/; $_ = 1 } })
586 0 1 if ($self->interactive) { }
587 0 0 $diffs ? :
592 1 0 if ($answer eq "Y\n" or $answer eq "y\n" or not $diffs and $answer eq "\n") { }
594 0 1 unless open CFG_FILE, '>' . $self->getPath
598 0 0 if ($self->interactive) { }
604 0 0 unless $answer eq "Y\n" or $answer eq "y\n"
631 0 9 unless (grep /^$wanted_version$/, $self->versions)
641 8 9 if ($k =~ /^patch from v$computed_version$/)
648 8 0 if ($kk =~ /^to v(.*)$/)
657 8 0 if (defined $str and defined $previous_version)
672 0 9 unless (eval { do { unless (grep /^$wanted_version$/, $self->versions) { $error = "version '${wanted_version}' is not valid."; } ; while (not defined $error and $computed_version ne $wanted_version) { $error = "Unable to find a patch from version '${computed_version}'"; foreach my $k (keys %{$$self{'patches'};}) { if ($k =~ /^patch from v$computed_version$/) { my($previous_version, $str); $error = "Unable to find a patch to version '${wanted_version}'"; foreach my $kk (keys %{$$self{'patches'}{$k};}) { if ($kk =~ /^to v(.*)$/) { $previous_version = $1; $str = $$self{'patches'}{$k}{$kk}; $str =~ s/^\s+//; $str =~ s/\s+$/\n/; last; } ; } ; if (defined $str and defined $previous_version) { $error = "Unable to apply the patch from version v$computed_version to v$previous_version\n"; $computed_config = patch($computed_config, $str, {'STYLE', 'Unified'}); $computed_version = $previous_version; $error = undef; last; } ; } ; } ; } ; $computed_config =~ s/__VERSION__/$computed_version/; not defined $error } })