Branch Coverage

blib/lib/MooX/Options/Role.pm
Criterion Covered Total %
branch 95 156 60.2


line true false branch
30 1 88 if $cmdline_name =~ /[^\w]$/
33 0 88 if $data{'repeatable'} and not defined $data{'format'}
34 0 88 if $data{'negativable'}
35 0 88 if $data{'negatable'}
36 17 71 if defined $data{'format'}
52 0 18 unless $options_data->{$a}{'order'} <=> $options_data->{$b}{'order'}
58 35 54 unless defined $doc
60 2 87 if $data{'hidden'}
62 3 86 if $data{'spacer_before'}
64 3 85 if $data{'spacer_after'}
67 1 87 if ($data{'short'})
72 1 0 if exists $options_data->{$shrt}
75 0 0 if defined $all_options{$shrt}
80 3 84 if (defined $data{'autosplit'})
81 2 1 unless ($data_record_loaded)
109 0 305 unless $all_options{$name}[0] eq $name
111 83 222 if defined $all_options{$long_short}
125 0 34 if ($arg eq '--')
129 3 31 if (index($arg, '-') != 0)
135 0 31 if (index($arg_name_with_dash, '--') < 0 and not defined $arg_values)
137 0 0 length $arg_name_with_dash > 2 ? :
143 5 26 if defined $arg_values
150 25 6 if (defined $original_long_option)
153 0 25 unless @$original_long_option == 1
161 1 30 if (defined $negative and defined $original_long_option)
164 0 1 $option_data->{$original_long_option}{'negatable'} ? :
170 20 11 if (defined $original_long_option and defined(my $arg_value = shift @ARGV)) { }
178 0 22 if ($autorange) { }
188 2 18 if (my $rec = $has_to_split->{$original_long_option}) { }
211 0 0 if ($autorange_found)
212 0 0 unless length $left_figure
213 0 0 unless length $right_figure
214 0 0 if (length $left_figure and length $right_figure)
218 0 0 @expanded_arg_value ? :
245 0 43 if (ref(my $command_chain = $params{'command_chain'}) eq 'ARRAY')
250 0 0 unless &blessed($cmd) and $cmd->can('command_name')
251 0 0 if (defined(my $cmd_name = $cmd->command_name))
261 0 43 if (ref(my $command_commands = $params{'command_commands'}) eq 'HASH')
278 1 35 if ($cmdline_params{'h'})
281 2 33 if ($cmdline_params{'help'})
284 0 33 if ($cmdline_params{'man'})
287 0 33 if ($cmdline_params{'usage'})
294 32 1 if eval { do { $self = $class->new(%cmdline_params); 1 } }
295 0 1 if ($@ =~ /^Attribute\s\((.*?)\)\sis\srequired/x) { }
0 1 elsif ($@ =~ /^Missing\srequired\sarguments:\s(.*)\sat\s/x) { }
0 1 elsif ($@ =~ /^(.*?)\srequired/x) { }
1 0 elsif ($@ =~ /^isa\scheck.*?failed:\s/x) { }
332 57 3 if (defined $options_config{'skip_options'})
339 49 9 if $options_config{'protect_argv'}
343 55 3 if (defined $options_config{'flavour'})
351 57 1 unless defined $usage_str
370 5 53 if ($usage->{'should_die'})
377 81 0 if (not defined $cmdline_params{$name} or $options_config{'prefer_commandline'})
381 22 59 if (defined $val)
382 0 22 if ($data{'json'}) { }
384 0 0 unless defined $decode_json
389 0 0 unless defined $decode_json
394 0 0 if $@
395 0 0 unless (eval { do { $cmdline_params{$name} = &$decode_json($val); 1 } })
412 2 51 if ($opt->h or defined $params{'h'})
416 18 35 if ($opt->help or defined $params{'help'})
420 0 53 if ($opt->man or defined $params{'man'})
424 0 53 if ($opt->usage or defined $params{'usage'})
442 7 11 if (@messages and ref $messages[-1] eq 'MooX::Options::Descriptive::Usage')
447 11 7 unless defined $code
448 11 7 unless ($usage)
454 0 18 if @messages
456 6 12 if ($code > 0) { }
462 17 1 if $code >= 0
474 6 1 unless defined $code
476 5 2 unless (defined $usage and ref $usage)
482 0 7 if ($code > 0) { }
488 6 1 if $code >= 0
500 0 0 unless defined $code
502 0 0 unless (defined $usage and ref $usage)
508 0 0 if ($code > 0) { }
514 0 0 if $code >= 0
527 0 0 unless ($usage)