Branch Coverage

blib/lib/CPAN/Testers/Common/Client/Config.pm
Criterion Covered Total %
branch 48 140 34.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'}
476 0 3 if ($^O eq 'MSWin32' and $id_file =~ m[^~/(.*)]) { }
1 2 elsif ($id_file =~ /~/) { }
482 1 2 unless ('File::Spec'->file_name_is_absolute($id_file))
494 0 0 unless $cmd
501 0 0 if ($email =~ /\A(.+)\s+<([^>]+)>\z/) { }
505 0 0 if length $name
563 0 0 unless exists $specs->{$name}{'validate'}
581 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[./.]) { }
611 0 6 unless (_is_valid_grade($g))
620 0 4 unless (_is_valid_action($action))
631 2 0 scalar keys %ga_map ? :
636 1 0 unless $config
640 1 0 if ($option =~ /^(\w+(?:::\w+)*)\s*(\S.*)$/) { }
644 1 0 if ($@)
658 1 0 if ($transport eq 'Metabase')
659 0 1 unless ($transport_args =~ /\buri\s+\S+/)
666 0 1 unless ($transport_args =~ /\bid_file\s+(\S.+?)\s*$/)
676 0 1 if (not -e $id_file) { }
0 1 elsif (not -r $id_file) { }
677 0 0 unless $self->_has_prompt
682 0 0 if ($answer =~ /^y/i) { }
683 0 0 unless _generate_profile($id_file, $config->{'email_from'})
722 12 17 if ($2)
733 0 0 unless defined $option and length $option and $option =~ /^\d/ and $option >= 0
740 0 0 unless $option
741 0 0 'File::Spec'->file_name_is_absolute($option) ? :
743 0 0 -r $skipfile ? :
750 0 1 unless $option
752 1 0 if scalar @data == 2