Branch Coverage

blib/lib/CPAN/Testers/Common/Client/Config.pm
Criterion Covered Total %
branch 50 142 35.2


line true false branch
21 1 0 exists $args{'warn'} ? :
22 0 1 unless $self->_set_mywarn($warn)
25 1 0 exists $args{'print'} ? :
26 0 1 unless $self->_set_myprint($print)
30 1 0 if (exists $args{'prompt'})
31 0 1 unless $self->_set_myprompt($args{'prompt'})
40 0 1 unless my $config = $self->_read_config_file
59 2 19 if (defined $ENV{'PERL_CPAN_REPORTER_DIR'} and length $ENV{'PERL_CPAN_REPORTER_DIR'})
67 0 19 if ($^O eq 'MSWin32')
69 0 0 if -d $alt_dir and not -d $conf_dir
76 0 1 if (defined $ENV{'PERL_CPAN_REPORTER_CONFIG'} and length $ENV{'PERL_CPAN_REPORTER_CONFIG'}) { }
95 0 0 unless $self->_has_prompt
99 0 0 unless -d $config_dir
101 0 0 unless (-d $config_dir)
116 0 0 if (-f $config_file) { }
121 0 0 unless ($existing_options)
139 0 0 if (defined $option_data->{'default'}) { }
145 0 0 if (length $option_data->{'default'})
158 0 0 if (not $option_data->{'validate'} or $option_data->{'validate'}->($self, $k, $answer, $config))
171 0 0 if ($answer =~ /\S/)
181 0 0 if keys %$existing_options
189 0 0 if ($self->_write_config_file($config)) { }
332 1 0 if ($prompt and ref $prompt and ref $prompt eq 'CODE')
341 1 0 if ($warn and ref $warn and ref $warn eq 'CODE')
350 1 0 if ($print and ref $print and ref $print eq 'CODE')
365 0 1 unless -e $file
366 0 1 unless -f _
367 0 1 unless -r _
369 0 1 unless open my $fh, '<', $file
378 0 4 if $line =~ /^\s*(?:\#|\;|$)/
382 4 0 if ($line =~ /^\s*([^=]+?)\s*=\s*(.*?)\s*$/)
399 0 0 if ($config->{$item} =~ /(?:\012|\015)/s)
406 0 0 unless open my $fh, '>', $file
421 1 1 if $config
428 0 0 exists $self->{'_config'}{$type} ? :
446 4 12 if (exists $config->{$option}) { }
448 0 4 if ($spec{$option}{'validate'} and not $spec{$option}{'validate'}->($self, $option, $val))
459 1 11 if defined $spec{$option}{'default'}
473 1 2 if ($id_file =~ s/\A(['"])(.+)\1\z/$2/)
478 0 3 if ($^O eq 'MSWin32' and $id_file =~ m[^~/(.*)]) { }
1 2 elsif ($id_file =~ /~/) { }
484 1 2 unless ('File::Spec'->file_name_is_absolute($id_file))
496 0 0 unless $cmd
503 0 0 if ($email =~ /\A(.+)\s+<([^>]+)>\z/) { }
507 0 0 if length $name
565 0 0 unless exists $specs->{$name}{'validate'}
583 4 0 if ($grade_action =~ /.:./) { }
0 0 elsif (_is_valid_action($grade_action)) { }
0 0 elsif (_is_valid_grade($grade_action)) { }
0 0 elsif ($grade_action =~ m[./.]) { }
613 0 6 unless (_is_valid_grade($g))
622 0 4 unless (_is_valid_action($action))
633 2 0 scalar keys %ga_map ? :
638 1 0 unless $config
642 1 0 if ($option =~ /^(\w+(?:::\w+)*)\s*(\S.*)$/) { }
646 0 1 if ($@)
660 1 0 if ($transport eq 'Metabase')
661 0 1 unless ($transport_args =~ /\buri\s+\S+/)
668 0 1 unless ($transport_args =~ /\bid_file\s+(\S.+?)\s*$/)
678 0 1 if (not -e $id_file) { }
0 1 elsif (not -r $id_file) { }
679 0 0 unless $self->_has_prompt
684 0 0 if ($answer =~ /^y/i) { }
685 0 0 unless _generate_profile($id_file, $config->{'email_from'})
728 12 17 if ($2)
739 0 0 unless defined $option and length $option and $option =~ /^\d/ and $option >= 0
746 0 0 unless $option
747 0 0 'File::Spec'->file_name_is_absolute($option) ? :
749 0 0 -r $skipfile ? :
756 0 1 unless $option
758 1 0 if scalar @data == 2