Branch Coverage

blib/lib/App/Easer/V1.pm
Criterion Covered Total %
branch 164 228 71.9


line true false branch
44 0 734 'ARRAY' eq ref $source_spec ? :
51 183 551 if defined $residual_args
73 10 15 if (substr($getopt, -1, 1) eq '!') { }
0 15 elsif (substr($getopt, -1, 1) eq '+') { }
15 0 elsif ($getopt =~ s/( [:=]) # 1 mode ([siof]) # 2 type ([\@%])? # 3 desttype (?: \{ (\d*)? # 4 min ,? (\d*)? # 5 max \} )? \z//msux) { }
0 0 elsif ($getopt =~ s/: (\d+) ([\@%])? \z//msux) { }
0 0 elsif ($getopt =~ s/:+ ([\@%])? \z//msux) { }
98 15 0 $1 eq '=' ? :
103 0 15 if (defined $min)
104 0 0 $min ? :
113 0 15 if defined $min and $min > 1
114 0 15 if defined $max and length $max
116 0 15 if defined $desttype and $desttype eq "\@"
125 0 0 if defined $desttype and $desttype eq "\@"
134 0 0 if defined $desttype and $desttype eq "\@"
139 10 15 if ($type eq 'bool') { }
0 15 elsif ($mode eq 'optional') { }
141 8 10 if (length $_ == 1) { }
147 0 0 if (length $_ == 1) { }
153 15 15 if (length $_ == 1) { }
170 0 0 @stuff % 2 ? :
175 114 69 if has_children($self, $spec)
177 0 183 if $spec->{'allow-residual-options'}
184 0 93 unless my $executable = fetch_spec_for($self, $command)->{'execute'}
193 0 0 exists $acfg->{'default-child'} ? :
37 0 exists $spec->{'default-child'} ? :
195 14 23 if defined $child and length $child
200 93 85 unless my($subc, $alias) = fetch_subcommand_wh($self, $spec, $args)
203 3 82 if ($r eq "HASH")
205 2 1 if scalar keys %$subc == 1 and defined $subc->{'index'}
207 2 1 if $r eq "HASH"
210 0 83 if $r
218 364 2 unless exists $cfg->{'dispatch'}
220 0 2 unless defined(my $child = &$sub($self, $spec, $args))
225 70 112 unless has_children($self, $spec)
228 35 77 unless @$args
231 65 12 if (my $child = get_child($self, $spec, $args->[0]))
237 2 16 if (exists $cfg->{'fallback'})
238 0 2 unless defined(my $fb = $cfg->{'fallback'})
240 0 2 unless defined(my $child = &$sub($self, $spec, $args))
243 2 14 if (exists $spec->{'fallback-to'})
244 0 2 unless defined(my $fbto = $spec->{'fallback-to'})
248 2 12 if $cfg->{'fallback-to-default'}
260 0 104 if defined $c->{'create'}
269 81 76 unless grep {$_ eq $name;} @{$command->{'supports'} //= [$child]}
288 10 80 if (opendir my $dh, 'File::Spec'->catpath($v, $dirs, '')) { }
295 18 28 if -e $path and not -d $path and substr($_, 0, length $bprefix) eq $bprefix
306 116 10 unless ref $child_spec eq "ARRAY"
312 71 411 if $spec->{'leaf'}
313 23 388 if exists $spec->{'children'} and not $spec->{'children'}
318 10 378 unless exists $self->{'application'}{'configuration'}{'auto-leaves'}
321 55 333 if $self->{'application'}{'configuration'}{'auto-leaves'} and @children == 0
325 107 226 if $expand
330 0 333 exists $self->{'application'}{'configuration'}{'auto-children'} ? :
332 0 333 if (exists $spec->{'no-auto'})
333 0 0 if (ref $spec->{'no-auto'}) { }
0 0 elsif ($spec->{'no-auto'} eq '*') { }
353 0 11 defined $path ? :
354 0 11 unless my $command = fetch_spec_for($self, $target)
356 0 11 unless defined($target = get_child($self, $command, $desc))
361 27 0 if fetch_spec_for($self, $target)
365 226 139 get_children($self, $spec, 0) ? :
373 354 284 if ($dst_key =~ m[\A //= (.*) \z]msux)
375 354 0 unless exists $retval{$dst_key}
379 622 16 if $is_overridable{$dst_key} or not exists $retval{$dst_key}
380 284 354 unless $this_overridable
394 0 49 unless @aliases
396 2 47 if @aliases
404 104 5 if "HASH" eq ref $application
407 2 3 if ('SCALAR' eq ref $application) { }
414 1 2 'GLOB' eq ref $application ? :
415 0 2 unless open my $fh, "<:encoding(UTF-8)", $application
444 0 182 if defined $o->{'name'}
445 182 0 if defined $o->{'getopt'} and $o->{'getopt'} =~ /\A(\w+)/msux
447 0 0 if defined $o->{'environment'} and $o->{'environment'} ne 1
461 0 8 $self->{'application'}{'configuration'}{'help-on-stderr'} ? :
464 7 1 if (my(@children) = get_children($self, $command)) { }
476 0 21 $self->{'application'}{'configuration'}{'help-on-stderr'} ? :
482 20 1 if (defined(my $description = $command->{'description'}))
490 13 8 if $command->{'supports'}
493 15 6 if (@$options) { }
497 10 15 if $n++
502 25 0 if (exists $option->{'getopt'})
508 16 9 if (defined(my $env_name = &$enamr($option)))
514 8 17 if exists $option->{'default'}
522 12 9 if (my(@children) = get_children($self, $command)) { }
532 13 390 if ref $cmd eq "HASH"
537 0 151 if ref $cmd eq "HASH"
563 4 184 unless my $spec = fetch_spec_for($self, $command)
570 93 85 unless my($subc, $alias) = fetch_subcommand($self, $spec, $args)
578 0 2 unless open my $fh, $mode, $file
587 181 2 if "ARRAY" ne ref $s
603 0 238 ref $go eq 'ARRAY' ? :
606 0 183 unless Getopt::Long::GetOptionsFromArray(\@args, \%option_for, @specs)
611 0 183 if ($strict and @args and $args[0] =~ /\A -/msux)
622 2 1 unless exists $spec->{'config'}{$key}
650 34 204 defined $en && exists $ENV{$en} ? :
658 18 245 exists $cspec->{$aek} ? :
660 18 69 $autoenv ? :
176 87 exists $ospec->{'environment'} ? :
661 227 36 unless ($env // "") eq 1
670 0 7 if @$args
681 0 9 'ARRAY' eq ref $opts->{'prefixes'} ? :
81 9 !defined($opts->{'prefixes'}) ? :
686 37 74 if $p ne substr($executable, 0, length $p)
693 1 89 if $executable =~ s/\A \s* = \s* //msux
696 10 79 unless defined $sname and length $sname
699 83 6 if (my $s = $package->can($sname))
704 4 0 if (my $s = $package->can($sname))
711 1 2165 if "HASH" eq ref $executable
713 929 1237 if "CODE" ne ref $executable
716 2163 1 unless $args
739 0 184 if (defined $from_spec and 'HASH' ne ref $from_spec) { }
0 184 elsif (defined $from_self and 'HASH' ne ref $from_self) { }