Branch Coverage

blib/lib/App/Easer/V2.pm
Criterion Covered Total %
branch 246 394 62.4


line true false branch
20 0 0 ref $stuff[0] || @stuff % 2 ? :
0 0 @stuff == 0 ? :
29 0 0 ref $app eq 'ARRAY' ? :
120 0 ref $app eq 'HASH' ? :
44 6 8 if ($request eq '-command') { }
0 8 elsif ($request eq '-inherit') { }
0 8 elsif ($request eq '-register') { }
4 4 elsif ($request eq '-spec') { }
0 4 elsif ($request eq '-parent') { }
57 0 4 unless @args
59 0 4 unless ref $args[0] eq "HASH"
66 0 0 unless @args
95 2604 9709 if @newval
103 0 4173 unless defined $aref
109 182 0 wantarray ? :
115 0 326 if (@n) { }
166 160 elsif (ref(my $ref_to_default = $slot->{$name})) { }
120 54 112 $parent ? :
131 111 71 if (my(@aliases) = $self->_rwad(@r))
132 71 0 if (defined(my $name = $self->_rwn("name")))
176 276 0 if (@newval)
185 0 0 unless (exists $slot->{'leaf'})
204 0 615 if (@new) { }
220 0 0 $r eq 'v2.008' ? :
0 0 $r eq 'default-hash' ? :
170 0 $r eq 'default-array' ? :
0 170 !defined($r) ? :
170 445 unless ref $r
227 0 615 unless defined $r
229 555 60 if ref $r eq "ARRAY"
230 60 0 if ref $r eq "HASH"
241 47 0 if @sources == 1 and ref $sources[0] eq "REF" and ref ${$sources[0];} eq "HASH"
245 187 106 $phase eq 'current' ? :
257 1729 104 if ref $spec eq "HASH"
258 104 0 unless ref $spec
259 0 104 unless ref $spec eq "ARRAY"
261 0 104 unless my $method = $self->can($method_name)
270 57 47 if ($_ eq '+parent') { }
274 0 47 ref $_ ? :
285 262 47 if $_->{'transmit'} // 0 and not $got{$name}++
297 228 168 @args && ref $args[0] ? :
330 2418 664 if $is_overridable{$dst_key} or not exists $retval{$dst_key}
331 3082 0 unless $this_overridable
343 5 906 ref $source eq 'ARRAY' ? :
344 2 909 @opts && ref $opts[0] ? :
346 909 2 unless (ref $src)
348 459 450 if defined $priority
351 0 911 unless my $sub = $self->ref_to_sub($locator)
355 217 694 if defined $residuals
365 908 3 if ($slice)
380 690 73 if $sequence[$i - 1][0] <= $sequence[$i][0]
417 217 0 if (my $sources = $self->_sources_for_phase("current"))
425 17 106 if (my $sources = $self->_sources_for_phase("final"))
433 217 0 unless (defined $value)
435 131 86 if $self->list_children
436 0 217 if $self->allow_residual_options
454 5 483 unless exists $option->{'getopt'}
456 0 483 if (ref $go eq 'ARRAY') { }
467 10 473 if $go_name ne $official_name
470 0 217 unless Getopt::Long::GetOptionsFromArray(\@args, \%option_for, @specs)
475 0 217 if $strict and @args and $args[0] =~ /\A - . /msux
489 6 4 unless exists $collected->{$go_name}
498 0 15 unless my $last = $self->_last_cmdline
503 30 1275 if defined $o->{'name'}
505 1275 0 if defined $o->{'getopt'} and $o->{'getopt'} =~ /\A(\w[-\w]*)/msux
507 0 0 if defined $o->{'environment'} and $o->{'environment'} ne 1
517 355 73 unless $include_inherited
527 0 9 unless defined $conf->{$key}
529 0 9 unless ref $conf eq "HASH"
538 9 226 $self->auto_environment ? :
228 235 exists $ospec->{'environment'} ? :
540 361 102 unless ($env // "") eq 1
561 55 359 defined $en && exists $ENV{$en} ? :
563 381 73 unless $include_inherited
572 23 10 unless defined(my $filename = $self->config($key))
578 0 10 unless open my $fh, $mode, $file
592 119 104 unless my $parent = $self->parent
597 2 1 unless my $parent = $self->parent
600 0 1 unless defined $latest
619 1 272 if $blame
626 59 0 if @keys == 1
633 0 0 if @value
639 0 0 unless ($full)
656 0 0 unless $latest
668 0 217 if @n
669 198 19 unless $commit
679 0 220 if @n
691 5 215 if (exists $slot->{'final_commit'})
696 0 5 unless $commit
701 0 5 unless $propagate_to_parent
706 123 97 unless $parent
717 0 217 if @n
721 0 217 if ($validator) { }
0 217 elsif (my $params_validate = $self->params_validate) { }
722 0 0 unless ref $validator eq "CODE"
728 0 0 if (my $config_validator = $params_validate->{'config'} // undef)
732 0 0 if (my $args_validator = $params_validate->{'args'} // undef)
743 0 127 unless defined $command
746 122 77 if $child->supports($command)
752 0 40 unless defined(my $default = $self->default_child)
754 36 4 if $default eq "-self"
755 0 4 unless my $child = $self->find_matching_child($default)
771 86 131 unless my(@candidates) = $self->list_children
773 91 40 if (@residuals) { }
40 0 elsif (defined(my $default = $self->default_child)) { }
774 86 5 if (my $child = $self->find_matching_child($residuals[0]))
784 1 4 if (defined $fallback)
785 1 0 if $fallback eq "-self"
786 0 0 if $fallback eq "-default"
788 0 0 if (my $child = $self->find_matching_child($fallback))
817 0 4303 if (opendir my $dh, 'File::Spec'->catpath($v, $dirs, '')) { }
824 0 0 if -e $path and not -d $path and substr($_, 0, length $bprefix) eq $bprefix
837 44 379 if substr($_, 0, length $prefix) eq $prefix
845 408 194 if $self->force_auto_children // @children
852 8 1224 if $inflate
873 0 0 unless eval { do { require $file } }
881 0 1006 unless defined $spec
883 97 909 if ref $spec eq "CODE"
884 0 909 ref $spec eq 'ARRAY' ? :
888 908 1 unless length($class // "")
889 0 1 unless $class->can($function)
894 0 276 unless $class->can("new")
903 275 1 unless (ref $child->_sources)
905 13 262 if (ref $first eq "REF")
908 0 13 if (my $next = $ssources->{'next'})
909 0 0 ref $next eq 'CODE' ? :
0 0 ref $next eq 'ARRAY' ? :
929 276 0 unless (builtin::blessed($child))
930 85 149 ref $child eq 'HASH' ? :
42 234 ref $child eq 'ARRAY' ? :
942 5 0 unless defined $fto and $fto =~ /\A(?: 0 | [1-9]\d* )\z/u
944 0 0 if $fto <= $#children
950 0 71 unless my $spec = $self->_rw
951 0 71 unless my $sub = $self->ref_to_sub($spec)
956 0 276 if (my $spec = $self->_rw)
957 0 0 unless my $sub = $self->ref_to_sub($spec)
967 0 123 if (my $spec = $self->_rw)
968 0 0 unless my $sub = $self->ref_to_sub($spec)
974 0 0 unless my $sub = $self->ref_to_sub($spec)
986 90 123 if defined $child
1006 0 80 if @rest
1008 32 48 if defined $subc
1009 0 80 unless defined $target
1019 0 69 unless @aliases
1021 21 48 if @aliases
1024 22 19 unless @lines
1032 0 40 if $refch eq "CODE"
1035 0 40 if ($refch eq 'GLOB') { }
0 40 elsif ($refch eq 'SCALAR') { }
0 40 elsif ($refch) { }
1039 0 0 unless open $fh, ">", $channel
1046 40 0 if ($channel eq '-' or lc $channel eq '-stdout') { }
0 0 elsif (lc $channel eq '-stderr') { }
1053 0 0 unless open $fh, ">", $channel
1055 40 0 if length($binmode // "")
1066 40 0 unless $pof
1073 6 1 if (defined(my $commands = $self->list_commands_for($target))) { }
1094 15 34 if (substr($getopt, -1, 1) eq '!') { }
1 33 elsif ($getopt =~ s/:\+ ([\@%])? \z//msux) { }
1 32 elsif (substr($getopt, -1, 1) eq '+') { }
18 14 elsif ($getopt =~ s/( [:=]) # 1 mode ([siof]) # 2 type ([\@%])? # 3 desttype (?: \{ (\d*)? # 4 min ,? (\d*)? # 5 max \} )? \z//msux) { }
1 13 elsif ($getopt =~ s/: (\d+) ([\@%])? \z//msux) { }
1105 0 1 if defined $desttype and $desttype eq "\@"
1128 17 1 $1 eq '=' ? :
1133 0 18 if (defined $min)
1134 0 0 $min ? :
1143 0 18 if defined $min and $min > 1
1144 0 18 if defined $max and length $max
1146 2 16 if defined $desttype and $desttype eq "\@"
1155 0 1 if defined $desttype and $desttype eq "\@"
1164 15 34 if ($type eq 'bool-negatable') { }
14 20 elsif ($type eq 'bool' or $mode eq 'increment') { }
3 17 elsif ($mode eq 'optional') { }
1166 13 16 if (length $_ == 1) { }
1172 1 14 if (length $_ == 1) { }
1178 0 3 if (length $_ == 1) { }
1184 13 17 if (length $_ == 1) { }
1201 49 9 if $opt and not $opt->{'inherited'}
1226 26 8 if ($mode eq "help" and defined(my $description = $target->description))
1230 0 34 if (defined(my $usage = $target->usage))
1235 18 16 if $target->parent
1241 28 6 if (@options or defined $options_help) { }
1245 0 28 if (not ref $options_help) { }
1250 0 28 if defined $preamble
1255 21 28 if $n++
1260 49 0 if (exists $opt->{'getopt'})
1268 20 29 if (defined(my $env = $self->real_environment_variable_name($target, $opt)))
1272 17 32 if (exists $opt->{'default'})
1276 16 1 !ref($default) ? :
0 17 !defined($default) ? :
1282 0 28 if defined $postamble
1292 13 21 if (defined(my $commands = $self->list_commands_for($target))) { }
1320 0 0 $self->config('include_auto') ? :
1323 0 0 unless my($name) = $command->aliases
1325 0 0 if $name =~ /\A(?: help | commands | tree)\z/msux and $exclude_auto
1328 0 0 if (defined(my $subtree = $self->list_commands_for($command)))
1332 0 0 unless @lines