Branch Coverage

lib/CLI/Framework/Application.pm
Criterion Covered Total %
branch 51 132 38.6


line true false branch
73 0 4 if (&catch(my $e)) { }
80 0 4 if (&catch(my $e))
81 0 0 if ($e->isa('CLI::Framework::Exception'))
87 0 4 if (&catch(my $e)) { }
94 0 4 if (&catch(my $e))
95 0 0 if ($e->isa('CLI::Framework::Exception'))
117 0 65 if (scalar @map % 2)
123 519 456 if ($i % 2 == 0)
127 0 519 if (exists $h{$k})
157 49 49 if grep {$_ eq $c;} @command_names
179 2 5 unless $cmd_pkg
182 0 5 if $app->get_interactivity_mode
190 0 4 unless $cmd_name
194 0 4 if $app->get_interactivity_mode
209 3 27 if $app->command_map_hashref->{$_} eq $cmd_pkg_name
217 0 10 unless $cmd_name
223 3 5 unless $cmd_pkg and exists $app->{'_registered_command_objects'} and exists $app->{'_registered_command_objects'}{$cmd_pkg}
230 0 7 unless $cmd
232 0 7 if (ref $cmd and $app->is_valid_command_pkg(ref $cmd)) { }
5 2 elsif ($app->is_valid_command_pkg($app->command_map_hashref->{$cmd})) { }
2 0 elsif ($cmd eq 'help') { }
0 0 elsif ($app->get_interactivity_mode and $cmd eq 'menu') { }
234 0 0 unless $cmd->isa('CLI::Framework::Command')
259 3 4 if $cmd->isa('CLI::Framework::Command::Meta')
286 0 2 if ($command_name and $app->is_valid_command_name($command_name)) { }
307 2 4 unless $input
311 1 3 unless %aliases
333 0 4 if (&catch(my $e))
341 0 4 if (@ARGV)
342 0 0 @ARGV > 1 ? :
348 0 4 if (&catch(my $e))
349 0 0 if ($e->isa('CLI::Framework::Exception'))
354 0 4 if (&catch(my $e))
355 0 0 if ($e->isa('CLI::Framework::Exception'))
388 3 1 if ($app->is_valid_command_name($ARGV[$i]))
396 2 3 unless (defined $command_name)
403 0 2 if (@invalid_args)
404 0 0 @invalid_args > 1 ? :
415 4 1 if $initialize_app
427 1 4 unless (ref $app)
434 5 0 unless defined $initialize
438 0 5 if (&catch(my $e))
450 5 0 unless $currently_interactive
459 0 5 if (&catch(my $e))
460 0 0 if ($e->isa('CLI::Framework::Exception'))
465 0 0 if (&catch(my $e))
479 0 5 if (&catch(my $e))
482 5 0 if defined $output
502 0 0 unless $app->is_valid_command_name($command_name)
505 0 0 unless grep {$command_name eq $_;} @noninteractive_commands
516 0 0 unless $app->get_interactivity_mode
521 0 0 if $app->is_interactive_command($c)
530 0 0 unless (ref $app)
538 0 0 if (grep {$orig_default_command eq $_;} $app->noninteractive_commands)
544 0 0 if $param{'initialize'}
545 0 0 if (&catch(my $e))
550 0 0 unless $menu_cmd->isa('CLI::Framework::Command::Menu')
576 0 0 if ($invalid_request_count >= $invalid_request_threshold) { }
0 0 elsif ($cmd_succeeded) { }
589 0 0 if (@ARGV) { }
591 0 0 if ($app->is_quit_signal($ARGV[0]))
597 0 0 if ($app->is_interactive_command($ARGV[0])) { }
598 0 0 if ($app->run) { }
620 0 0 unless ($term)
634 0 0 if (not defined $command_request) { }
643 0 0 if $command_request =~ /\S/ and not $term->Features->{'autohistory'}