Condition Coverage

blib/lib/Commandable/Finder/Packages.pm
Criterion Covered Total %
condition 12 20 60.0


and 3 conditions

line !l l&&!r l&&r condition
211 3 11 1 defined $name_method and not $pkg->can($name_method)

or 2 conditions

line l !l condition
162 0 6 delete $args{'name_method'} // "COMMAND_NAME"
163 0 6 delete $args{'description_method'} // "COMMAND_DESC"
164 0 6 delete $args{'arguments_method'} // "COMMAND_ARGS"
165 0 6 delete $args{'options_method'} // "COMMAND_OPTS"
166 0 6 delete $args{'code_method'} // "run"
198 0 6 $self->{'cache_packages'} //= [$self->{'mp'}->plugins]
219 13 0 $pkg->can($self->{'methods'}{'desc'}) || (next)

or 3 conditions

line l !l&&r !l&&!r condition
208 17 6 0 $self->{'cache_commands'} //= do { my %commands; foreach my $pkg ($self->packages) { next if defined $name_method and not $pkg->can($name_method); my $name = defined $name_method ? $pkg->$name_method : $pkg =~ s/\Q$self->{'base'}\E:://ru; next unless my $code = $pkg->can($self->{'methods'}{'code'}); my $desc = ($pkg->can($self->{'methods'}{'desc'}) || (next))->($pkg); my $args; if (my $argsmeth = $pkg->can($self->{'methods'}{'args'})) { $args = [map({"Commandable::Command::_Argument"->new(%$_);} $pkg->$argsmeth)]; } ; my $opts; if (my $optsmeth = $pkg->can($self->{'methods'}{'opts'})) { $opts = {map({my $o = "Commandable::Command::_Option"->new(%$_); map {$_, $o;} $o->names;} $pkg->$optsmeth)}; } ; $commands{$name} = "Commandable::Command"->new("name", $name, "description", $desc, "arguments", $args, "options", $opts, "package", $pkg, "code", $code); } ; $self->add_builtin_commands(\%commands); \%commands }