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 63 if $name eq "no_dsl"
184 36 28 if $name eq "plugin" or $name eq "no_dsl"
188 28 0 if $name eq "app" and $caller->can("app") and not $no_dsl->{$class}
205 0 28 unless my $app = eval "${caller}::app()" || eval {
208 0 28 unless $app->can("with_plugin")
213 0 28 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 6 unless $keyword =~ /^[a-zA-Z_]+[a-zA-Z0-9_]*$/
0 6 if grep(($keyword eq $_), ("encode_json", "dancer_major_version", "push_response_header", "request", "context", "put", "dancer_version", "done", "halt", "get", "decode_json", "psgi_app", "true", "push_header", "redirect", "set", "body_parameters", "runner", "path", "mime", "response", "error", "headers", "from_dumper", "any", "vars", "query_parameters", "options", "false", "dance", "request_header", "template", "del", "to_yaml", "prepare_app", "flush", "send_file", "upload", "setting", "uri_for", "status", "response_headers", "session", "route_parameters", "var", "post", "info", "send_as", "start", "engine", "from_json", "to_dumper", "params", "dirname", "pass", "splat", "dsl", "delayed", "to_json", "dancer_app", "patch", "content_type", "config", "response_header", "request_data", "prefix", "log", "app", "to_app", "cookies", "debug", "param", "header", "cookie", "warning", "forward", "hook", "send_error", "captures", "content", "from_yaml"))
1 5 if $Dancer2::Plugin::_keywords_by_plugin->{$keyword}
0 1 unless $keyword =~ /^[a-zA-Z_]+[a-zA-Z0-9_]*$/
0 1 if grep(($keyword eq $_), ("splat", "uri_for", "engine", "dsl", "header", "content_type", "true", "request", "route_parameters", "pass", "session", "from_json", "config", "options", "delayed", "redirect", "template", "var", "info", "captures", "response", "hook", "mime", "response_headers", "dirname", "headers", "cookie", "halt", "context", "request_header", "param", "upload", "query_parameters", "forward", "send_error", "error", "debug", "cookies", "psgi_app", "path", "del", "send_file", "encode_json", "to_yaml", "flush", "response_header", "from_yaml", "dancer_major_version", "set", "prefix", "done", "dance", "params", "start", "to_dumper", "push_response_header", "put", "post", "to_json", "vars", "to_app", "dancer_version", "request_data", "any", "decode_json", "get", "setting", "from_dumper", "runner", "patch", "push_header", "send_as", "log", "warning", "prepare_app", "body_parameters", "app", "false", "status", "dancer_app", "content"))
430 35 1 unless $no_dsl->{$caller}
470 0 36 if $@
474 18 18 if ($app_dsl_cb)
494 29 260 if $class = $caller->can("dsl")
526 1 11 unless $app_dsl_cb
544 666 145 unless $plugin_module->can($keyword)
553 36 89 if $name eq "plugin_keywords"
556 36 53 if $name eq "plugin_hooks"
559 0 53 unless $$exported_app{$global->{'into'}}
592 12 2 &Scalar::Util::blessed($hook) ? :
612 0 20 ref $name ? :
1 20 XXX ? :
615 0 20 ref $name ? :