Branch Coverage

lib/Web/DataService.pm
Criterion Covered Total %
branch 48 308 15.5


line true false branch
209 0 1 unless $_[0] =~ qr/ ^ [\w.:][\w.:-]* $ /sx
216 0 0 unless ref $_[0] and &reftype($_[0]) eq 'CODE'
243 0 1 ref $features_value eq 'ARRAY' ? :
248 0 1 unless defined $o and $o ne ''
257 1 0 if ($o eq 'standard') { }
0 0 elsif ($o =~ qr/ ^ no_ (\w+) $ /sx) { }
278 0 0 unless $SPECIAL_FEATURE{$key}
294 0 1 ref $special_value eq 'ARRAY' ? :
299 0 1 unless defined $s and $s ne ''
308 1 0 if ($s eq 'standard') { }
0 0 elsif ($s =~ qr/ ^ no_ (\w+) $ /sx) { }
0 0 elsif ($s =~ qr" ^ (\w+) = (\w+) (?: / ( \w [/\w]+ ) )? $ "sx) { }
335 0 0 if ($3)
344 0 0 unless $SPECIAL_PARAM{$key}
345 0 0 if $name =~ qr"[^\w/]"
351 0 0 if @aliases
357 0 1 if $self->{'feature'}{'format_suffix'} and $self->{'special'}{'format'}
360 0 1 if $self->{'feature'}{'doc_paths'} and $self->{'special'}{'document'}
362 0 1 unless $self->{'feature'}{'documentation'}
383 0 1 if (my $templating_plugin = $self->templating_plugin) { }
0 1 elsif ($INC{'Template.pm'} and not defined $self->templating_plugin) { }
385 0 0 unless eval "require $templating_plugin"
387 0 0 unless $templating_plugin->can('render_template')
396 0 0 unless require Web::DataService::Plugin::TemplateToolkit
404 1 0 if ($self->{'feature'}{'documentation'})
406 0 0 unless ($QUIET or $ENV{'WDS_QUIET'})
421 0 1 if (defined $self->{'templating_plugin'} and $self->{'templating_plugin'} ne 'Web::DataService::Plugin::Templating')
436 0 0 unless (defined $doc_dir)
440 0 0 if (-r $default) { }
0 0 elsif ($self->{'feature'}{'documentation'}) { }
447 0 0 unless ($QUIET or $ENV{'WDS_QUIET'})
461 0 0 if ($doc_dir)
463 0 0 unless $doc_dir =~ qr" ^ / "sx
466 0 0 unless -r $doc_dir
490 0 0 if ($output_dir)
492 0 0 unless $output_dir =~ qr" ^ / "sx
495 0 0 unless -r $output_dir
511 0 1 if (my $backend_plugin = $self->backend_plugin) { }
0 1 elsif ($INC{'Dancer.pm'} and $INC{'Dancer/Plugin/Database.pm'} and not defined $self->backend_plugin) { }
513 0 0 unless eval "require $backend_plugin"
515 0 0 unless $backend_plugin->can('get_connection')
554 0 1 unless defined $title and $title ne ''
559 1 0 unless ($self->path_re)
567 0 1 if ($prefix =~ qr" (.*) [/] $ "sx) { }
598 1 0 if ($self->{'doc_suffix'} and $self->{'doc_index'}) { }
0 0 elsif ($self->{'doc_suffix'}) { }
0 0 elsif ($self->{'doc_index'}) { }
619 0 1 unless $self->{'feature'}{'strict_params'}
644 0 4 unless defined $param and $param ne ''
653 0 4 if defined $self->{$param}
654 0 4 if defined $self->{'_config'}{$ds_name}{$param}
655 0 4 if defined $self->{'parent'}
656 0 4 if defined $self->{'_config'}{$param}
671 0 1 unless defined $self->{$plugin}
675 0 1 if ($self->{$plugin}->can('initialize_plugin') and not ${"$self->{$plugin}::_INITIALIZED";})
681 0 1 if (defined $self->{$plugin} and $self->{$plugin}->can('initialize_service'))
700 0 1 if (defined $FOUNDATION and defined $plugin_module and $plugin_module ne $FOUNDATION) { }
0 1 elsif ($plugin_module) { }
1 0 elsif ($INC{'Dancer.pm'}) { }
709 0 0 unless eval "require $plugin_module"
711 0 0 unless $plugin_module->can('read_config')
722 0 1 unless require Web::DataService::Plugin::Dancer
739 1 0 if ($FOUNDATION->can('initialize_plugin') and not ${"${FOUNDATION}::_INITIALIZED";})
745 0 1 if (ref $self eq 'Web::DataService' and $FOUNDATION->can('initialize_service'))
763 0 12 unless defined $param and $param ne ''
771 0 12 if defined $self->{'_config'}{$ds_name}{$param}
772 0 12 if defined $self->{'parent'}
773 0 12 if defined $self->{'_config'}{$param}
788 0 0 unless $SPECIAL_FEATURE{$name}
802 0 0 unless $SPECIAL_PARAM{$name}
816 2 0 if defined $name and not ref $name and $name =~ qr/ ^ [\w][\w.:-]* $ /sx
836 0 1 if (my $key = $self->key)
839 0 0 if $KEY_MAP{$key}
846 0 1 if (my $prefix = $self->path_prefix)
848 0 0 if (defined $prefix and $prefix ne '')
870 0 0 unless @WDS_INSTANCES
879 0 0 if ($param = $instance->{'special'}{'selector'}) { }
885 0 0 if (defined $key and $KEY_MAP{$key})
895 0 0 if (not defined $path or $path eq '' or $path eq '/')
905 0 0 if (defined $key and $key ne '') { }
929 0 0 if (defined $ds->{'path_re'} and $path =~ /$ds->{'path_re'}/)
938 0 0 if ($FOUNDATION->get_http_method eq 'OPTIONS' and $path eq '*' || $path eq '/*')
948 0 0 if (@prefixes > 1) { }
0 0 elsif (@prefixes == 1) { }
975 0 0 unless defined $self->{'backend_plugin'}
1016 0 1 if ($mode eq 'debug') { }
0 1 elsif ($mode eq 'one_process') { }
0 1 elsif ($mode eq 'one_request') { }
0 1 elsif ($mode eq 'late_path_check') { }
1 0 elsif ($mode eq 'quiet') { }
0 0 elsif ($mode eq 'diagnostic') { }
1018 0 0 unless $QUIET or $ENV{'WDS_QUIET'}
1058 0 0 if $mode eq 'debug' and $DEBUG
1059 0 0 if $mode eq 'one_request' and $ONE_REQUEST
1060 0 0 if $mode eq 'late_path_check' and $CHECK_LATER
1061 0 0 if $mode eq 'quiet' and $QUIET
1062 0 1 if $mode eq 'diagnostic' and $DIAGNOSTIC
1091 0 0 if $DEBUG
1097 0 0 unless $DEBUG
1131 0 0 ref $attrs ? :
1133 0 0 unless defined $attrs and $attrs ne '' and $attrs ne '/'
1135 0 0 if ($attrs =~ qr/ ^ (node|op|path) (abs|rel|site)? [:] ( [^#?]* ) (?: [?] ( [^#]* ) )? (?: [#] (.*) )? /sx) { }
1144 0 0 if ($arg ne 'path' and $path =~ qr/ (.*) [.] ([^.]+) $ /x)
1166 0 0 if ($self->{'generate_url_hook'})
1178 0 0 defined $path ? :
1189 0 0 if $attrs->{'node'} and not defined $format && $format eq 'pod'
1193 0 0 defined $attrs->{'params'} ? :
0 0 ref $attrs->{'params'} eq 'ARRAY' ? :
1199 0 0 if $self->{'special'}{'format'} and $p =~ qr/ ^ $self->{'special'}{'format'} = \S /x
1200 0 0 if $self->{'special'}{'selector'} and $p =~ qr/ ^ $self->{'special'}{'selector'} = \S /ox
1214 0 0 if ($self->{'feature'}{'fixed_paths'})
1216 0 0 if ($attrs->{'node'}) { }
0 0 elsif ($attrs->{'op'}) { }
1218 0 0 unless $path eq '/'
1232 0 0 if ($self->{'feature'}{'format_suffix'}) { }
0 0 elsif ($self->{'feature'}{'doc_paths'}) { }
1238 0 0 if ($attrs->{'node'} and $path ne '/') { }
0 0 elsif ($attrs->{'op'}) { }
1240 0 0 if $self->{'feature'}{'doc_paths'}
1249 0 0 if $format
1260 0 0 if ($attrs->{'node'} and $path ne '/')
1269 0 0 if ($self->{'special'}{'format'} and not $has_format and not $attrs->{'path'})
1274 0 0 if ($attrs->{'node'} and $format and $format ne 'html') { }
0 0 elsif ($attrs->{'op'}) { }
1283 0 0 if $format
1292 0 0 if ($self->{'special'}{'selector'} and not $has_selector)
1300 0 0 if $path eq '/'
1307 0 0 if ($type eq 'rel') { }
0 0 elsif ($type eq 'abs') { }
1324 0 0 if (@params)
1336 0 0 if ($attrs->{'fragment'})
1359 0 0 unless defined $path
1364 0 0 if (defined $title and $title ne '') { }
0 0 elsif ($title = $self->node_attr($path, 'title')) { }
1396 0 0 $self->{'port'} ? :
1416 0 0 $self->{'port'} ? :
1470 0 0 unless defined $primary_role and $primary_role ne ''
1474 0 0 unless $primary_role eq 'DOC' or %{"${primary_role}::";}
1483 0 0 if exists do { "${request_class}::" }->{'_CREATED'}
1494 0 0 unless %{"${role}::";}
1514 0 0 if ($@)
1516 0 0 if ($@ =~ qr/method name conflict.*the method '(.*?)'/) { }
1532 0 0 unless $primary_role eq 'DOC'
1559 0 0 $primary_role ? :
1561 0 0 if exists do { "${request_class}::" }->{'_CREATED'}
1567 0 0 if $primary_role and not %{"${primary_role}::";}
1572 0 0 if $primary_role
1584 0 0 if ($primary_role)
1592 0 0 unless %{"${role}::";}
1631 0 0 if $self->{'role_init'}{$role}
1646 0 0 if ($role->can('initialize'))
1648 0 0 if $DEBUG or $self->{'DEBUG'}
1666 0 0 unless defined $key and $key ne ''
1681 0 0 unless defined $key and $key ne ''