Branch Coverage

blib/lib/Perl/Critic/Command.pm
Criterion Covered Total %
branch 27 112 24.1


line true false branch
66 0 0 if $had_error_in_file
67 0 0 unless defined $violations
68 0 0 if $violations
93 5 39 if (exists $opts{'-top'})
99 1 43 if (exists $opts{'-noprofile'})
112 0 52 unless &GetOptions(\%opts, @opt_specs)
126 1 51 if ($opts{'-help'})
127 1 50 if ($opts{'-options'})
128 1 49 if ($opts{'-man'})
129 0 49 if ($opts{'-version'})
130 0 49 if ($opts{'-list'})
131 0 49 if ($opts{'-list-enabled'})
132 0 49 if ($opts{'-list-themes'})
133 0 49 if ($opts{'-profile-proto'})
134 0 49 if ($opts{'-doc'})
145 1 1 if ($opts{'-noprofile'} and $opts{'-profile'})
149 1 48 if ($opts{'-verbose'} and not $opts{'-verbose'} =~ /(?: \d+ | %[mfFlcCedrpPs] )/msx)
154 1 48 if (exists $opts{'-top'} and $opts{'-top'} < 0)
159 2 9 if (exists $opts{'-severity'} and $opts{'-severity'} < $Perl::Critic::Command::SEVERITY_LOWEST || $opts{'-severity'} > $Perl::Critic::Command::SEVERITY_HIGHEST)
172 5 44 if ($msg)
186 0 0 if (not @args or @args == 1 and $args[0] eq '-') { }
195 0 0 unless $code_string =~ / \S+ /msx
202 0 0 if (my $nonexistent = &first(sub {
211 0 0 -d $_ ? :
220 0 0 unless @files_to_critique
230 0 0 unless $critic->policies
243 0 0 unless ($opts_ref->{'-statistics-only'})
248 0 0 unless (eval {
249 0 0 if (my $exception = 'Perl::Critic::Exception::Parse'->caught) { }
0 0 elsif ($Perl::Critic::Command::EVAL_ERROR) { }
266 0 0 if ($opts_ref->{'-statistics'} or $opts_ref->{'-statistics-only'})
281 0 0 if ($opts_ref->{'-files-with-violations'} or $opts_ref->{'-files-without-violations'})
284 0 0 $number_of_violations ? :
0 0 if not ref $file and $$opts_ref{$number_of_violations ? "-files-with-violations" : "-files-without-violations"}
291 0 0 if ($opts_ref->{'-count'})
292 0 0 unless ref $file
298 0 0 unless (@violations or $opts_ref->{'-quiet'})
299 0 0 unless ref $file
307 0 0 $verbosity eq $Perl::Critic::Command::DEFAULT_VERBOSITY && @files > 1 ? :
312 0 0 unless (-f $file)
316 0 0 $color ? :
325 0 0 unless $pager_command
326 0 0 unless _at_tty()
328 0 0 unless open my $pager, "|-", $pager_command
341 0 0 if (not $opts_ref->{'-statistics-only'} and $statistics->total_violations || !$opts_ref->{'-quiet'} && $statistics->modules)
379 0 0 if (defined $average_sub_mccabe)
391 0 0 if (defined $violations_per_file)
398 0 0 if (defined $violations_per_statement)
405 0 0 if (defined $violations_per_line)
412 0 0 if ($statistics->total_violations)
518 0 0 if _this_is_windows() and not eval "require Win32::Console::ANSI; 1"
519 0 0 unless eval {
542 0 0 unless defined $color
543 0 0 if $color eq $Perl::Critic::Command::EMPTY
549 0 0 chomp $string ? :
556 0 0 if $Perl::Critic::Command::OSNAME =~ /MSWin32/msx