Branch Coverage

blib/lib/App/Easer/V2.pm
Criterion Covered Total %
branch 174 284 61.2


line true false branch
20 0 0 ref $stuff[0] || @stuff % 2 ? :
0 0 @stuff == 0 ? :
29 0 0 ref $app eq 'ARRAY' ? :
80 0 ref $app eq 'HASH' ? :
42 6 8 if ($request eq '-command') { }
0 8 elsif ($request eq '-inherit') { }
0 8 elsif ($request eq '-register') { }
4 4 elsif ($request eq '-spec') { }
55 0 4 unless @args
57 0 4 unless ref $args[0] eq "HASH"
84 1356 4505 if @newval
92 0 2171 unless defined $aref
98 134 0 wantarray ? :
107 111 23 if (my(@aliases) = $self->_rwad(@r))
108 22 1 if (defined(my $name = $self->_rwn("name")))
140 951 18 if ref $spec eq "HASH"
141 18 0 unless ref $spec
142 0 18 unless ref $spec eq "ARRAY"
144 0 18 unless my $method = $self->can($method_name)
153 18 0 if ($_ eq '+parent') { }
165 0 0 if not $_->{'transmit_exact'} and $name =~ /$namerx/u
176 146 131 @args && ref $args[0] ? :
205 827 126 if $is_overridable{$dst_key} or not exists $retval{$dst_key}
206 953 0 unless $this_overridable
223 5 607 ref $source eq 'ARRAY' ? :
224 2 610 @opts && ref $opts[0] ? :
226 610 2 unless (ref $src)
228 310 300 if defined $priority
231 0 612 unless my $sub = $self->ref_to_sub($locator)
234 148 464 if defined $residuals
238 463 41 if $sequence[$i - 1][0] <= $sequence[$i][0]
252 148 0 unless (defined $value)
254 91 57 if $self->list_children
255 0 148 if $self->allow_residual_options
272 0 300 ref $go eq 'ARRAY' ? :
275 0 148 unless Getopt::Long::GetOptionsFromArray(\@args, \%option_for, @specs)
280 0 148 if ($strict and @args and $args[0] =~ /\A -/msux)
290 0 293 if defined $o->{'name'}
291 293 0 if defined $o->{'getopt'} and $o->{'getopt'} =~ /\A(\w+)/msux
293 0 0 if defined $o->{'environment'} and $o->{'environment'} ne 1
308 0 9 unless defined $conf->{$key}
310 0 9 unless ref $conf eq "HASH"
319 8 100 $self->auto_environment ? :
195 108 exists $ospec->{'environment'} ? :
321 211 92 unless ($env // "") eq 1
338 40 230 defined $en && exists $ENV{$en} ? :
346 7 9 unless defined(my $filename = $self->config($key))
352 0 9 unless open my $fh, $mode, $file
366 78 68 unless my $parent = $self->parent
377 0 150 if $blame
384 32 0 if @keys == 1
391 0 0 if @value
398 0 148 if @n
399 148 0 unless $commit
408 0 148 if @n
412 0 148 if ($validator) { }
0 148 elsif (my $params_validate = $self->params_validate) { }
413 0 0 unless ref $validator eq "CODE"
419 0 0 if (my $config_validator = $params_validate->{'config'} // undef)
423 0 0 if (my $args_validator = $params_validate->{'args'} // undef)
434 0 81 unless defined $command
437 77 55 if $child->supports($command)
443 0 26 unless defined(my $default = $self->default_child)
445 22 4 if $default eq "-self"
446 0 4 unless my $child = $self->find_matching_child($default)
462 57 91 unless my(@candidates) = $self->list_children
464 65 26 if (@residuals) { }
26 0 elsif (defined(my $default = $self->default_child)) { }
465 61 4 if (my $child = $self->find_matching_child($residuals[0]))
475 0 4 if (defined $fallback)
476 0 0 if $fallback eq "-self"
477 0 0 if $fallback eq "-default"
479 0 0 if (my $child = $self->find_matching_child($fallback))
506 0 3707 if (opendir my $dh, 'File::Spec'->catpath($v, $dirs, '')) { }
513 0 0 if -e $path and not -d $path and substr($_, 0, length $bprefix) eq $bprefix
529 280 122 if $self->force_auto_children // @children
536 4 840 if $inflate
556 0 0 unless eval { do { require $file } }
564 0 655 unless defined $spec
566 45 610 if ref $spec eq "CODE"
567 0 610 ref $spec eq 'ARRAY' ? :
571 609 1 unless length($class // "")
572 0 1 unless $class->can($function)
577 0 197 unless $class->can("new")
586 197 0 unless (&blessed($child))
587 43 112 ref $child eq 'HASH' ? :
42 155 ref $child eq 'ARRAY' ? :
600 4 0 unless defined $fto and $fto =~ /\A(?: 0 | [1-9]\d* )\z/u
602 0 0 if $fto <= $#children
608 0 43 unless my $spec = $self->_rw
609 0 43 unless my $sub = $self->ref_to_sub($spec)
619 65 79 if defined $child
634 0 48 if @rest
636 12 36 if defined $subc
637 0 48 unless defined $target
647 0 61 unless @aliases
649 2 59 if @aliases
652 8 17 unless @lines
662 0 24 if $refch eq "CODE"
665 0 24 if ($refch eq 'GLOB') { }
0 24 elsif ($refch eq 'SCALAR') { }
0 24 elsif ($refch) { }
669 0 0 unless open $fh, ">", $channel
676 24 0 if ($channel eq '-' or lc $channel eq '-stdout') { }
0 0 elsif (lc $channel eq '-stderr') { }
683 0 0 unless open $fh, ">", $channel
685 24 0 if length($binmode // "")
696 24 0 unless $pof
703 6 1 if (defined(my $commands = $self->list_commands_for($target))) { }
723 14 19 if (substr($getopt, -1, 1) eq '!') { }
1 18 elsif ($getopt =~ s/:\+ ([\@%])? \z//msux) { }
1 17 elsif (substr($getopt, -1, 1) eq '+') { }
15 2 elsif ($getopt =~ s/( [:=]) # 1 mode ([siof]) # 2 type ([\@%])? # 3 desttype (?: \{ (\d*)? # 4 min ,? (\d*)? # 5 max \} )? \z//msux) { }
1 1 elsif ($getopt =~ s/: (\d+) ([\@%])? \z//msux) { }
734 0 1 if defined $desttype and $desttype eq "\@"
757 14 1 $1 eq '=' ? :
762 0 15 if (defined $min)
763 0 0 $min ? :
772 0 15 if defined $min and $min > 1
773 0 15 if defined $max and length $max
775 1 14 if defined $desttype and $desttype eq "\@"
784 0 1 if defined $desttype and $desttype eq "\@"
793 14 19 if ($type eq 'bool-negatable') { }
2 17 elsif ($type eq 'bool' or $mode eq 'increment') { }
3 14 elsif ($mode eq 'optional') { }
795 12 14 if (length $_ == 1) { }
801 1 2 if (length $_ == 1) { }
807 0 3 if (length $_ == 1) { }
813 13 14 if (length $_ == 1) { }
832 18 0 if (defined(my $description = $target->description))
839 8 10 if $target->parent
843 16 2 if (my(@options) = $target->options) { }
847 17 16 if $n++
852 33 0 if (exists $opt->{'getopt'})
860 13 20 if (defined(my $env = $self->environment_variable_name($opt)))
866 7 26 if exists $opt->{'default'}
875 11 7 if (defined(my $commands = $self->list_commands_for($target))) { }
903 0 0 $self->config('include_auto') ? :
906 0 0 unless my($name) = $command->aliases
908 0 0 if $name =~ /\A(?: help | commands | tree)\z/msux and $exclude_auto
911 0 0 if (defined(my $subtree = $self->list_commands_for($command)))
915 0 0 unless @lines