Branch Coverage

blib/lib/CPAN/Reporter/Config.pm
Criterion Covered Total %
branch 63 90 70.0


line true false branch
57 0 2 unless -d $config_dir
58 0 2 unless (-d $config_dir)
72 1 1 if (-f $config_file) { }
78 0 1 unless ($config)
84 1 0 if $config
102 8 0 if (defined $option_data->{'default'}) { }
104 6 2 if (length $option_data->{'default'})
117 8 0 if (not $option_data->{'validate'} or $option_data->{'validate'}->($k, $answer, $config->{'_'}))
133 0 0 if ($answer =~ /\S/) { }
146 1 1 if keys %$existing_options
157 2 0 if ($config->write($config_file)) { }
319 0 0 unless $cmd
327 0 0 if ($email =~ /\A(.+)\s+<([^>]+)>\z/) { }
331 0 0 if length $name
353 3 1368 if (defined $ENV{'PERL_CPAN_REPORTER_DIR'} and length $ENV{'PERL_CPAN_REPORTER_DIR'})
361 0 1368 if ($^O eq "MSWin32")
363 0 0 if -d $alt_dir and not -d $conf_dir
374 2 496 if (defined $ENV{'PERL_CPAN_REPORTER_CONFIG'} and length $ENV{'PERL_CPAN_REPORTER_CONFIG'}) { }
394 1576 3914 if (exists $config->{'_'}{$option}) { }
396 5 1571 if ($spec{$option}{'validate'} and not $spec{$option}{'validate'}->($option, $val))
407 309 3605 if defined $spec{$option}{'default'}
466 0 422 if ($^O eq 'MSWin32' and $id_file =~ m[^~/(.*)]) { }
1 421 elsif ($id_file =~ /~/) { }
472 419 3 unless ("File::Spec"->file_name_is_absolute($id_file))
486 6 299 unless my $config = "Config::Tiny"->read($config_file)
500 0 8 unless exists $option_specs{$name}{'validate'}
519 632 816 if ($grade_action =~ /.:./) { }
813 3 elsif (_is_valid_action($grade_action)) { }
1 2 elsif (_is_valid_grade($grade_action)) { }
1 1 elsif ($grade_action =~ m[./.]) { }
549 1 761 unless (_is_valid_grade($g))
558 2 631 unless (_is_valid_action($action))
569 970 3 scalar keys %ga_map ? :
576 307 0 if ($option =~ /^(\w+(?:::\w+)*)\s?/) { }
580 4 303 if ($@)
594 303 4 if ($transport eq "Metabase")
595 2 301 unless ($option =~ /\buri\s+\S+/)
602 0 301 unless ($option =~ /\bid_file\s+(\S.+?)\s*$/)
612 0 301 if (not -e $id_file) { }
0 301 elsif (not -r $id_file || -r 'File::Spec'->catdir(_get_config_dir(), $id_file)) { }
616 0 0 if ($answer =~ /^y/i) { }
647 2 18 unless defined $option and length $option and $option =~ /^\d/ and $option >= 0
654 0 16 unless $option
655 11 5 'File::Spec'->file_name_is_absolute($option) ? :
657 13 3 -r $skipfile ? :