Branch Coverage

blib/lib/Dancer2/Plugin/WebService.pm
Criterion Covered Total %
branch 0 202 0.0


line true false branch
69 0 0 unless exists $plg->config->{'Default format'} and $plg->config->{'Default format'} =~ /$fmt_rgx/
74 0 0 unless (-d $module_dir)
79 0 0 unless exists $method->{'Active'} and $method->{'Active'} =~ /(?i)[y1t]/
83 0 0 if ($plg->auth_method ne 'INTERNAL')
84 0 0 unless (exists $method->{'Command'})
86 0 0 unless (-f $method->{'Command'})
87 0 0 unless (-x $method->{'Command'})
89 0 0 if (exists $method->{'Use sudo'} and $method->{'Use sudo'} =~ /(?i)[y1t]/) { }
91 0 0 if (-f "$_/sudo" and -x "$_/sudo")
92 0 0 unless (defined $sudo)
111 0 0 if (exists $plg->config->{'Routes'}{$_}{'Protected'} and $plg->config->{'Routes'}{$_}{'Protected'} =~ /(?i)[y1t]/) { }
114 0 0 if ($plg->auth_method eq '') { }
119 0 0 if (exists $plg->config->{'Routes'}{$_}{'Groups'}) { }
121 0 0 unless 'ARRAY' eq ref $plg->config->{'Routes'}{$_}{'Groups'}
144 0 0 unless opendir DIR, $plg->dir_session
148 0 0 if (-f "$plg->{'dir_session'}/$token/control/lastaccess" and -f "$plg->{'dir_session'}/$token/control/username" and -f "$plg->{'dir_session'}/$token/control/groups") { }
151 0 0 if (time - $lastaccess > $plg->Session_timeout) { }
158 0 0 unless opendir __TOKEN, "$plg->{'dir_session'}/$token/data"
162 0 0 if 'SCALAR' eq ref $TokenDB{$token}{'data'}{$record}
186 0 0 $app->request->query_parameters->{'sort'} =~ /(?i)1|t|y/ ? :
0 0 exists $app->request->query_parameters->{'sort'} ? :
187 0 0 $app->request->query_parameters->{'pretty'} =~ /(?i)1|t|y/ ? :
0 0 exists $app->request->query_parameters->{'pretty'} ? :
193 0 0 if (exists $app->request->query_parameters->{$_}) { }
195 0 0 if ($app->request->query_parameters->{$_} =~ /$fmt_rgx/) { }
212 0 0 if ($app->request->{'route'}{'regexp'} =~ m<^\^[/\\]+(.*?)[/\\]+\(\?#token.*>) { }
0 0 elsif ($app->request->{'route'}{'regexp'} =~ m(^\^[/\\]+(.*?)\$)) { }
219 0 0 if ($app->request->body)
222 0 0 if ($plg->Format->{'from'} eq 'json') { }
0 0 elsif ($plg->Format->{'from'} eq 'xml') { }
0 0 elsif ($plg->Format->{'from'} eq 'yaml') { }
0 0 elsif ($plg->Format->{'from'} eq 'perl') { }
0 0 elsif ($plg->Format->{'from'} eq 'human') { }
230 0 0 unless @array
232 0 0 if (@array % 2 == 0) { }
240 0 0 1 == scalar @{$arrayref;} ? :
244 0 0 if ($@)
251 0 0 if ('HASH' ne ref $plg->{'data'})
253 0 0 if ('ARRAY' eq ref $plg->{'data'}) { }
274 0 0 unless exists $plg->config->{'Routes'}{$plg->route_name} and $plg->config->{'Routes'}{$plg->route_name}{'Protected'}
276 0 0 if (exists $plg->data->{'token'}) { }
278 0 0 if (exists $TokenDB{$plg->data->{'token'}}) { }
281 0 0 if (time - $TokenDB{$plg->data->{'token'}}{'control'}{'lastaccess'} > $plg->Session_timeout) { }
306 0 0 unless (exists $TokenDB{$plg->data->{'token'}}{'control'}{'groups'}{$_})
342 0 0 if ($app->request->param('what') =~ /(?i)v/) { }
0 0 elsif ($app->request->param('what') =~ /(?i)a/) { }
0 0 elsif ($app->request->param('what') =~ /(?i)c/) { }
349 0 0 -f '/etc/redhat-release' ? :
0 0 if (fileno __F)
384 0 0 if (exists $TokenDB{$plg->data->{'token'}})
406 0 0 if ($plg->ClientIP =~ /$plg->rules_compiled->[$i]/)
412 0 0 if $plg->error
416 0 0 unless (exists $plg->data->{$_})
417 0 0 if ($plg->data->{'username'} =~ /^\s*$/)
418 0 0 if ($plg->data->{'password'} eq '')
424 0 0 if ('INTERNAL' eq $plg->auth_method) { }
428 0 0 if (exists $conf->{'Accounts'}{$user})
429 0 0 if ($conf->{'Accounts'}{$user} eq '<any>') { }
0 0 elsif ($conf->{'Accounts'}{$user} eq $plg->data->{'password'}) { }
433 0 0 if ($plg->error and exists $conf->{'Accounts'}{'<any>'})
434 0 0 if ($conf->{'Accounts'}{'<any>'} eq '<any>') { }
0 0 elsif ($conf->{'Accounts'}{'<any>'} eq $plg->data->{'password'}) { }
452 0 0 if (@{$plg->auth_config->{'Arguments'};})
455 0 0 unless open SHELL, '-|', "$command 2> /dev/null"
459 0 0 unless (2 == scalar @output)
464 0 0 if $plg->error
467 0 0 unless open URANDOM__, '<', '/dev/urandom'
477 0 0 unless (mkdir $_)
488 0 0 unless (Storable::lock_store(\$v, "$plg->{'dir_session'}/$plg->{'data'}{'token'}/control/$k"))
513 0 0 if ($plg->Format->{'to'} eq 'json') { }
0 0 elsif ($plg->Format->{'to'} eq 'xml') { }
0 0 elsif ($plg->Format->{'to'} eq 'yaml') { }
0 0 elsif ($plg->Format->{'to'} eq 'perl') { }
0 0 elsif ($plg->Format->{'to'} eq 'human') { }
517 0 0 if ($plg->pretty) { }
548 0 0 if ($@)
568 0 0 if (@_) { }
570 0 0 if (1 == @_) { }
572 0 0 if ('HASH' eq ref $_[0]) { }
587 0 0 if ($plg->error)
606 0 0 if (@_) { }
608 0 0 if ('HASH' eq ref $plg->data) { }
0 0 elsif ('ARRAY' eq ref $plg->data) { }
0 0 elsif ('SCALAR' eq ref $plg->data) { }
619 0 0 if $_ eq ${$plg->data;}
625 0 0 if $_ eq $plg->data
630 0 0 if ('HASH' eq ref $plg->data) { }
0 0 elsif ('ARRAY' eq ref $plg->data) { }
0 0 elsif ('SCALAR' eq ref $plg->data) { }
648 0 0 unless (exists $plg->data->{'token'} and exists $TokenDB{$plg->data->{'token'}})
653 0 0 if (0 == scalar @_) { }
0 0 elsif (1 == scalar @_) { }
658 0 0 if ('ARRAY' eq ref $_[0]) { }
683 0 0 unless (exists $plg->data->{'token'} and exists $TokenDB{$plg->data->{'token'}})
689 0 0 if 1 == @_ and 'HASH' eq ref $_[0]
695 0 0 ref $_[$j] ? :
697 0 0 unless (Storable::lock_store($data, "$plg->{'dir_session'}/$plg->{'data'}{'token'}/data/$_[$i]"))
718 0 0 unless (exists $plg->data->{'token'} and exists $TokenDB{$plg->data->{'token'}})
726 0 0 if (@_) { }
727 0 0 if 1 == @_ and 'ARRAY' eq ref $_[0]
731 0 0 if (exists $TokenDB{$plg->data->{'token'}}{'data'}{$_})