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
212 3 12 1 defined $name_method and not $pkg->can($name_method)

or 2 conditions

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

or 3 conditions

line l !l&&r !l&&!r condition
209 22 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 }