Condition Coverage

blib/lib/Respite/Server.pm
Criterion Covered Total %
condition 19 189 10.0


and 3 conditions

line !l l&&!r l&&r condition
25 5 0 0 $ENV{'MOD_PERL'} and not $self->{'force_daemon'}
46 15 0 0 ref $c->{$name} && exists $c->{$name}{$key}
105 0 0 0 $self and ref $self
114 0 0 0 $ENV{'CONTENT_TYPE'} and $ENV{'CONTENT_TYPE'} =~ /\bjson\b/
130 0 0 0 not $self->{'no_data_uriencode'} and eval { do { require Data::URIEncode } } || grep({$_ =~ /[:.]/;} keys %$args) && throw('Failed to load Data::URIEncode', {'msg', $@})
153 0 0 0 ref $ref and $ref->{'error'}
162 0 0 0 ref $ref eq "ARRAY" and @$ref == 3
0 0 0 ref $ref eq "ARRAY" and @$ref == 3 and $ref->[0] =~ /^\d+$/
216 0 0 0 (!$no_brand || $no_brand < 0) && $env->{'PATH_INFO'} =~ m[^/+(.+)/([^/]+)$]
305 0 0 0 defined $3 && length $3
320 0 0 0 $pass and not @$pass
322 0 0 0 not $sig and $type
0 0 0 not $sig and $type and $type ne "none"
381 0 0 0 defined $val and length $val
382 0 0 0 $brand and &$d("username") ne $brand
404 5 0 0 $ad and $ad eq 1
406 5 0 0 $is_dev && $ssl && !&$val('no_dev_port', '')
415 5 0 0 $is_dev && $ssl
471 0 0 0 $ARGV[0] && $class->can("__$ARGV[0]")
533 0 0 0 $pid and kill 0, $pid
553 0 0 0 $pid and kill 0, $pid

or 2 conditions

line l !l condition
14 0 0 eval { do { $_[0]->dispatch_class->_revision } } || '-'
105 0 0 $self || __PACKAGE__
130 0 0 Data::URIEncode::flat_to_complex($args) || {}
146 0 0 $ENV{'PATH_INFO'} ||= ""
241 0 0 $self->{'is_psgi'} || \%ENV
247 0 0 +(shift())->{'content_type'} ||= "application/json"
276 0 0 $ENV{'SCRIPT_FILENAME'} // ""
318 0 0 $self->get_api_pass($brand || '', $ip, $sig, $type, $user, $exception) || []
329 0 0 $sig ||= {}
633 6 0 $how || shift @ARGV || 'f'
638 4 2 `$cmd` || "No error log\n"
644 2 1 $out || "No processes found\n"

or 3 conditions

line l !l&&r !l&&!r condition
13 18 0 0 $_[0]{'server_name'} ||= $0 =~ m[/(\w+)$]x ? $1 : throw("Missing server_name")
14 0 0 0 $_[0]{'revision'} ||= eval { do { $_[0]->dispatch_class->_revision } } || '-'
25 0 0 5 $self->{'non_daemon'} or $ENV{'MOD_PERL'} and not $self->{'force_daemon'}
42 60 0 0 $name ||= $self->server_name
52 0 5 0 $self->{'dispatch_factory'} ||= do { my $meta = $self->api_meta || $self->dispatch_class || throw('Missing one of api_meta or dispatch_class'); if (not ref $meta) { (my $file = "$meta.pm") =~ s[::][/]g; throw("Failed to load dispatch class", {"class", $meta, "file", $file, "msg", $@}) unless $meta->can("new") or eval { do { require $file } }; throw("Specified class does not have a run_method method", {"class", $meta}) unless $meta->can("run_method"); sub { $meta->new(@_); } ; } else { require Respite::Base; "Respite::Base"->new({"api_meta", $meta})->api_preload if $preload; sub { "Respite::Base"->new({%{shift();}, "api_meta", $meta}); } ; } }
53 5 0 0 $self->api_meta || $self->dispatch_class || throw('Missing one of api_meta or dispatch_class')
56 5 0 0 $meta->can("new") or eval { do { require $file } }
78 0 0 0 shift() || throw("Missing apache request during ${class}::modperlhandler", {'trace', 1})
115 0 0 0 not $ENV{'REQUEST_METHOD'} or $ENV{'REQUEST_METHOD'} eq "GET"
0 0 0 not $ENV{'REQUEST_METHOD'} or $ENV{'REQUEST_METHOD'} eq "GET" or $ENV{'REQUEST_METHOD'} eq "HEAD"
116 0 0 0 $ENV{'CONTENT_LENGTH'} || throw("Missing CONTENT_LENGTH on $ENV{'REQUEST_METHOD'} request", {'len', $ENV{'CONTENT_LENGTH'}})
130 0 0 0 eval { do { require Data::URIEncode } } || grep({$_ =~ /[:.]/;} keys %$args) && throw('Failed to load Data::URIEncode', {'msg', $@})
139 0 0 0 eval { do { $self->json->decode($req) } } || throw('Trouble unencoding json', {'ip', $ENV{'REMOTE_ADDR'}, 'msg', $@, 'head', substr($req, 0, 10) . '...'})
153 0 0 0 eval { do { throw('Trouble dispatching', {'path', $ENV{'PATH_INFO'}, 'msg', $ref}) } } || $@
171 0 0 0 eval { do { $self->json->encode($ref) } } || do { warn "Trouble encoding json: $@"; q[{'error':'Trouble encoding json - check server logs for details'}] }
196 0 0 0 delete $args->{'_t'} || do { my $k = $self->config('admin_cookie_key'); $k ? $self->parse_cookies->{$k} : '' }
225 0 0 0 $self->{'cgi_obj'} ||= do { eval { do { CGI::initialize_globals() } } or warn "Failed to initialize globals: $@" if $INC{'CGI.pm'}; throw("Cannot load CGI library during a non-JSON request", {"msg", $@, "type", $ENV{'CONTENT_TYPE'}}) unless eval { do { $self->{'is_psgi'} ? require CGI::PSGI : require CGI } }; local $CGI::POST_MAX = $self->max_request_size; my $q = $self->{'is_psgi'} ? "CGI::PSGI"->new($self->{'is_psgi'}) : "CGI"->new($r || $self->{'apache_req'} || ()) }
226 0 0 0 eval { do { CGI::initialize_globals() } } or warn "Failed to initialize globals: $@"
229 0 0 0 $r || $self->{'apache_req'} || ()
253 0 0 0 $self->{'apache_req'} || eval { do { 'Apache2::RequestUtil'->request if $ENV{'MOD_PERL'} } }
290 0 0 0 $script || throw('Missing script')
315 0 0 0 $sig ||= $args->{'x_respite_auth'}
341 0 0 0 not ref $ref or ref $ref eq "ARRAY"
342 0 0 0 $ref->{'~cidr~'} || $ref->{'-cidr'}
355 0 0 0 $cidr{$cidr} ||= _cidr($cidr)
356 0 0 0 $n < $range->[0] or $n > $range->[1]
409 5 0 0 ref $app or $app =~ m[^/]
431 0 0 0 $config::config{'rootdir_server'} || sub { require FindBin; $FindBin::RealBin; }
453 0 0 0 $self->{'server_revision'} ||= $self->server_name . '/' . $self->revision . ($self->{'nshv'} ? ' ' . $self->SUPER::server_revision : "")
575 1 0 0 kill 15, $pid or kill 9, $pid
625 0 0 0 $self->{'server'}{$file or 'log_file'} || throw('No log_file to size')
634 6 0 0 $self->{'server'}{$file or 'log_file'} || throw('No log_file to tail')
651 0 0 0 eval { do { config::provider() } } or $self->_configs->{'provider'}
656 0 0 0 eval { do { CGI::initialize_globals() } } or warn "Failed to initialize globals: $@"