Branch Coverage

blib/lib/MooseX/App/Meta/Role/Class/Base.pm
Criterion Covered Total %
branch 132 152 86.8


line true false branch
117 3 18 if $commands->{$command} =~ /^\Q$exclude\E(::|$)/
157 42 0 if defined $command
170 0 68 unless ($metaclass->does_role('MooseX::App::Role::Common'))
186 0 2 if defined $raw_error{$raw}
189 0 2 if (length $key == 1 and $raw =~ /^-(\w+)$/)
195 0 0 if ($name eq $1)
206 0 2 if (defined $message) { }
227 14 22 unless defined $element
235 33 34 if ($self->app_strict or $metaclass->command_strict)
249 346 27 unless $attribute->can('has_cmd_env') and $attribute->has_cmd_env
254 3 24 if (exists $ENV{$cmd_env} and not defined $$return{$attribute->name})
259 3 0 if ($attribute->has_type_constraint)
261 1 2 if ($attribute->should_coerce and $type_constraint->has_coercion)
270 1 2 if ($error)
293 0 94 unless $attribute->does('MooseX::App::Meta::Role::Attribute::Option') and $attribute->has_cmd_type
308 1 565 if (defined $option_to_attribute{$name} and $option_to_attribute{$name} != $attribute)
325 87 112 if (my $attribute = $option_to_attribute{$option->key})
332 137 4 if ($self->app_fuzzy)
339 4 103 if $option_length == 1
346 345 111 if $option_length >= length $name
351 16 95 if (lc $option->key eq $name_short)
353 16 0 unless (grep {$attribute == $_;} @{$match_attributes;})
394 236 93 unless exists $$match{$attribute->name}
420 0 115 unless ref $raw eq 'ARRAY'
427 1 114 if ($attribute->has_cmd_split)
436 1 114 if ($attribute->cmd_count)
441 109 6 if ($attribute->has_type_constraint) { }
444 5 104 if ($type_constraint->is_a_type_of('ArrayRef')) { }
4 100 elsif ($type_constraint->is_a_type_of('HashRef')) { }
26 74 elsif ($type_constraint->is_a_type_of('Bool')) { }
449 5 1 if ($element =~ /^([^=]+)=(.+?)$/) { }
472 107 2 if (defined $value) { }
480 1 106 if ($attribute->should_coerce and $type_constraint->has_coercion)
486 6 101 if (defined $error)
515 1 317 if ($command_name eq $lc_command) { }
32 285 elsif ($lc_command eq substr($command_name, 0, $candidate_length)) { }
533 1 63 if (defined $commands) { }
534 0 1 if (ref $commands eq 'ARRAY') { }
547 56 87 if $part =~ /^-/
553 0 64 unless scalar @command_parts
558 36 49 if ($all_commands->{$command})
568 0 42 if (ref $candidate eq '')
577 26 1 if ($self->app_fuzzy) { }
618 309 38 if ($type_constraint)
619 28 281 if $type_constraint->is_a_type_of('ArrayRef') or $type_constraint->is_a_type_of('HashRef')
623 144 165 if $type_constraint->is_a_type_of('Bool')
639 144 203 if ($bool) { }
6 197 elsif ($attribute->cmd_count) { }
641 11 133 if ($attribute->has_cmd_negate)
653 72 2 if ($self->app_fuzzy)
659 2732 2244 if length $name < $l
662 417 1827 if defined $hints{$short_name}
666 0 1827 if defined $tmp{$short_name}[0] and $tmp{$short_name}[0]{'name'} eq $names{$name}{'name'}
671 237 1338 if scalar @{$tmp{$short_name};} > 1
678 1096 824 if ($hints{$name}{'novalue'})
681 97 1823 if ($hints{$name}{'permute'})
684 1096 824 if (defined $hints{$name}{'fixedvalue'})
708 7 46 if ($attribute->is_required and not exists $$params{$attribute->name} and not $attribute->has_default)
711 1 6 $attribute->cmd_type eq 'parameter' ? :
729 0 629 unless ($metaclass->does_role('MooseX::App::Role::Common'))
736 1424 3194 unless $attribute->does('MooseX::App::Meta::Role::Attribute::Option') and $attribute->has_cmd_type
740 1192 2002 unless $types eq 'all' or $attribute->cmd_type ~~ $types
747 0 2821 unless $a->cmd_position <=> $b->cmd_position
767 0 35 unless scalar @options > 0
793 28 7 unless scalar @parameters > 0
807 23 6 if ($command_meta_class) { }
814 1 28 if ($command_meta_class->can('command_usage') and $command_meta_class->command_usage_predicate)
819 28 1 unless (defined $usage)
824 2 19 if ($attribute->is_required) { }
846 13 23 if ($command_meta_class->can('command_long_description') and $command_meta_class->command_long_description_predicate) { }
1 22 elsif ($command_meta_class->can('command_short_description') and $command_meta_class->command_short_description_predicate) { }
867 55 132 if ($command_class eq $commands->{$element})
886 143 2 if $command eq $command_name or not $command =~ /^\Q$command_name\E\s(.+)/
916 3 3 if $description
938 0 25 unless ($class->can('meta') and $class->DOES('MooseX::App::Role::Common'))
944 25 0 if $class->meta->can('command_short_description')