App/Meta/Role/Class/Simple.pm

filter: Statementstmt 85.1% 23 / 27 Branchbran 33.3% 2 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 72.0% 31 / 43 CC 6 SCAR 17.5
CC
6
Cov
72%
__ANON__
9.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.8
« App/Plugin/MutexGroup/Meta/Class.pm ↑ Summary App/Simple.pm »
1 # ============================================================================
2 package MooseX::App::Meta::Role::Class::Simple;
3 # ============================================================================
4  
5 6 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 6 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 6 ▶around 'command_usage_header' => sub {
Subroutine __ANON__: called CC=6 SCAR=21.9
12 6 my ($orig,$self) = @_;
13  
14 6 my $caller = $self->app_base;
15  
16 6 my $usage;
17 # Get usage from command if available
18 6 ▶ if ($self->can('command_usage')
Branch: 1 branch
BranchTrueFalseTotal
if ($self->can("command_usage") and $self->command_usage_predicate) 0 6 6
Condition33%1/3
$self->can("command_usage") and $self->command_usage_predicate
!ll&&!rl&&r
060
MC/DC0%0/2
$self->can("command_usage") and $self->command_usage_predicate
$self->can("command_usage") $self->command_usage_predicate
Truth table33%1/3
A and B
A= $self->can("command_usage")B= $self->command_usage_predicate
ABresult
0X0
100
111
19 && $self->command_usage_predicate) {
20 0 $usage = MooseX::App::Utils::format_text($self->command_usage);
21 }
22  
23 # Autobuild usage
24 6 ▶ unless ($usage) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($usage) 6 0 6
25 6 my $command = $caller;
26 6 my @parameter= $self->command_usage_attributes($self,'parameter');
27 6 foreach my $attribute (@parameter) {
28 0 ▶ if ($attribute->is_required) {
Branch: 1 branch
BranchTrueFalseTotal
if ($attribute->is_required) { } 0 0 0
29 0 $command .= " <".$attribute->cmd_usage_name.'>';
30 } else {
31 0 $command .= ' ['.$attribute->cmd_usage_name.']';
32 }
33 }
34 6 $usage = MooseX::App::Utils::format_text("$command [long options...]
35 $caller --help")
36 }
37  
38 6 return $self->command_message(
39 header => 'usage:',
40 body => $usage
41 ); # LOCALIZE
42 6 };
43  
44 6 1;
« App/Plugin/MutexGroup/Meta/Class.pm ↑ Summary App/Simple.pm »