Branch Coverage

blib/lib/Dancer2/Plugin.pm
Criterion Covered Total %
branch 61 80 76.2


line true false branch
77 0 1 unless $self->isa("Dancer2::Plugin")
109 15 8 unless my $config_name = delete $args{'from_config'}
114 2 6 if (XXX)
119 7 1 if $config_name eq 1
124 4 4 defined $value ? :
133 8 15 if (my $keyword = delete $args{'plugin_keyword'})
135 6 2 if $keyword eq 1
138 1 7 ref $keyword ? :
152 0 6 unless ref $sym_ref
156 1 5 if XXX
181 1 65 if $name eq "no_dsl"
184 37 29 if $name eq "plugin" or $name eq "no_dsl"
188 29 0 if $name eq "app" and $caller->can("app") and not $no_dsl->{$class}
205 0 29 unless my $app = eval "${caller}::app()" || eval {
208 0 29 unless $app->can("with_plugin")
213 0 29 unless $class->can("keywords")
265 0 5 unless $plugin_addr
279 0 5 unless $plugin_config
0 5 unless $app_plugin_config
291 2 3 if ($_[0]->isa("Dancer2::Plugin"))
301 0 2 if ($plugin->hooks->{"plugin.$plugin_class.$hook_name"})
307 0 2 unless $hook_name =~ /^plugin\.$plugin_class/
339 0 4 unless $keyword =~ /^[a-zA-Z_]+[a-zA-Z0-9_]*$/
0 4 if grep(($keyword eq $_), ("info", "send_file", "set", "param", "push_header", "decode_json", "dancer_version", "psgi_app", "app", "var", "response_header", "dsl", "route_parameters", "from_yaml", "cookies", "session", "post", "log", "setting", "warning", "patch", "from_json", "from_dumper", "redirect", "response", "hook", "forward", "put", "get", "engine", "cookie", "request_header", "upload", "headers", "splat", "options", "del", "dancer_app", "encode_json", "false", "push_response_header", "error", "send_error", "request_data", "true", "query_parameters", "prefix", "to_json", "content", "template", "dirname", "delayed", "to_yaml", "captures", "flush", "vars", "to_dumper", "debug", "response_headers", "dance", "mime", "params", "content_type", "pass", "to_app", "header", "prepare_app", "config", "dancer_major_version", "runner", "start", "halt", "uri_for", "path", "done", "send_as", "body_parameters", "context", "request", "any", "status"))
1 3 if $Dancer2::Plugin::_keywords_by_plugin->{$keyword}
0 3 unless $keyword =~ /^[a-zA-Z_]+[a-zA-Z0-9_]*$/
430 36 1 unless $no_dsl->{$caller}
470 0 37 if $@
474 19 18 if ($app_dsl_cb)
494 30 270 if $class = $caller->can("dsl")
526 0 13 unless $app_dsl_cb
543 7 3 $_[0] ? :
548 741 155 unless $plugin_module->can($keyword)
557 38 90 if $name eq "plugin_keywords"
560 37 53 if $name eq "plugin_hooks"
563 0 52 unless $$exported_app{$global->{'into'}}
596 12 2 &Scalar::Util::blessed($hook) ? :
616 0 21 ref $name ? :
1 22 XXX ? :
619 0 23 ref $name ? :