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 (is_coderef($config_name))
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 is_arrayref($args)
181 1 68 if $name eq "no_dsl"
184 38 31 if $name eq "plugin" or $name eq "no_dsl"
188 31 0 if $name eq "app" and $caller->can("app") and not $no_dsl->{$class}
205 0 31 unless my $app = eval "${caller}::app()" || eval { do { $caller->dsl->app } }
208 0 31 unless $app->can("with_plugin")
213 0 31 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 3 unless $keyword =~ /^[a-zA-Z_]+[a-zA-Z0-9_]*$/
0 3 if grep(($keyword eq $_), ("engine", "dancer_app", "content_type", "warning", "body_parameters", "header", "any", "query_parameters", "flush", "vars", "cookies", "forward", "push_header", "patch", "put", "uri_for", "uri_for_route", "request_header", "options", "response_header", "push_response_header", "start", "to_yaml", "to_dumper", "prepare_app", "halt", "mime", "content", "setting", "path", "encode_json", "send_as", "dancer_major_version", "config", "send_error", "route_parameters", "request", "dirname", "prefix", "session", "true", "post", "del", "response", "redirect", "from_json", "status", "dance", "response_headers", "params", "get", "set", "info", "debug", "var", "pass", "send_file", "runner", "hook", "headers", "to_json", "from_dumper", "cookie", "template", "false", "captures", "from_yaml", "app", "param", "log", "context", "upload", "request_data", "done", "dsl", "dancer_version", "splat", "delayed", "psgi_app", "error", "to_app", "decode_json"))
0 3 if $Dancer2::Plugin::_keywords_by_plugin->{$keyword}
431 37 1 unless $no_dsl->{$caller}
462 0 38 if $@
470 6 0 $app_dsl_cb ? :
484 10 92 if $skip{$caller}
485 33 59 if eval { do { $caller->isa("Dancer2::Plugin") } }
486 18 41 if $class = $caller->can("dsl")
518 0 13 unless $app_dsl_cb
535 7 3 $_[0] ? :
540 750 154 unless $plugin_module->can($keyword)
549 39 92 if $name eq "plugin_keywords"
552 39 53 if $name eq "plugin_hooks"
555 0 53 unless $$exported_app{$global->{'into'}}
608 13 23 ref $name ? :
1 23 is_coderef($_[0]) ? :
611 0 24 ref $name ? :