CohortExplorer/Command/Menu.pm

filter: Statementstmt 52.3% 11 / 21 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 53.5% 15 / 28 CC 4 SCAR 24.7
CC
4
Cov
48%
menu_txt
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 11.9
« CohortExplorer/Command/Describe.pm ↑ Summary CohortExplorer/Application/OpenClinica/Datasource.pm »
1 package CohortExplorer::Command::Menu;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = 0.14;
7  
8 1 ▶use base qw( CLI::Framework::Command::Menu );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 #-------
11 0 ▶sub menu_txt {
Subroutine menu_txt: not called CC=4 SCAR=30.0
Pod documented
12 0 my ($self) = @_;
13 0 my $app = $self->get_app;
14 0 my ( @cmd, $txt );
15  
16 # Get all valid commands
17 0 for my $c ( $app->get_interactive_commands ) {
18 0 ▶ if ( grep ( $_ ne $c, $app->noninteractive_commands ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep(($_ ne $c), $app->noninteractive_commands)) 0 0 0
19 0 push @cmd, $c;
20 }
21 }
22 0 my %aliases = reverse $app->command_alias;
23  
24 # Create menu txt which contains all valid commands with their aliases
25 0 for (@cmd) {
26 0 $txt .= sprintf( "%-5s%2s%10s\n", $aliases{$_}, '-', $_ );
27 }
28 0 return "\n\n" . $txt . "\n\n";
29 }
30  
31 #-------
32 1 1;
33 __END__
« CohortExplorer/Command/Describe.pm ↑ Summary CohortExplorer/Application/OpenClinica/Datasource.pm »