Condition Coverage

blib/lib/PAGI/Server.pm
Criterion Covered Total %
condition 207 367 56.4


and 3 conditions

line !l l&&!r l&&r condition
2223 0 2 22 ref $listen eq "ARRAY" and @$listen
2239 0 2 18 defined $spec->{'host'} and defined $spec->{'port'}
2498 16 7 255 $self->{'quiet'} and $level ne "error"
2601 42 0 3 $self->{'http2'} and $HTTP2_AVAILABLE
2714 196 0 18 $self->{'workers'} and $self->{'workers'} > 0
2761 1 1 1 $inh->{'type'} eq "tcp" and $handle->can("sockport")
2874 0 0 182 $socket and $socket->can("sockport")
2941 0 0 0 $weak_self and not $weak_self->{'quiet'}
2946 0 0 0 $weak_self and not $weak_self->{'quiet'}
2958 8 184 0 $self->{'access_log'} and -t $self->{'access_log'}
2988 191 0 1 ($ENV{'PAGI_ENV'} // "") eq "production" and not $self->{'max_connections'}
3032 0 0 0 $inh->{'type'} eq "tcp" and $socket->can("sockport")
3065 0 0 0 $socket and not $spec->{'_inherited'}
3107 0 0 18 $socket and not $spec->{'_inherited'}
3134 0 0 18 @listen_entries and $listen_entries[0]{'socket'}
3154 3 15 0 $self->{'access_log'} and -t $self->{'access_log'}
3176 15 0 3 ($ENV{'PAGI_ENV'} // "") eq "production" and not $self->{'max_connections'}
3204 0 0 7 $self->{'heartbeat_timeout'} and $self->{'heartbeat_timeout'} > 0
3315 215 0 3 defined $listen_fds and $listen_fds =~ /^\d+$/
215 0 3 defined $listen_fds and $listen_fds =~ /^\d+$/ and $listen_fds > 0
3316 0 2 1 defined $ENV{'LISTEN_PID'} and $ENV{'LISTEN_PID'} == $$
3396 0 0 5 $key and defined $ENV{'PAGI_REUSE'}
3406 5 0 0 $entry->{'spec'}{'type'} eq "unix" and not $entry->{'spec'}{'_inherited'}
5 0 0 $entry->{'spec'}{'type'} eq "unix" and not $entry->{'spec'}{'_inherited'} and -e $entry->{'spec'}{'path'}
3557 0 0 29 $self->{'heartbeat_timeout'} and $self->{'heartbeat_timeout'} > 0
3614 7 0 0 $weak_self->{'running'} and not $weak_self->{'shutting_down'}
3666 11 0 0 not $entry->{'socket'} and $reuseport
11 0 0 not $entry->{'socket'} and $reuseport and $spec->{'type'} eq "tcp"
3722 0 0 11 $entry->{'spec'}{'type'} eq "tcp" and $entry->{'socket'}
0 0 11 $entry->{'spec'}{'type'} eq "tcp" and $entry->{'socket'} and $entry->{'socket'}->can("sockport")
3795 5 0 4 $ssl_params && $spec->{'type'} eq 'tcp'
3877 158 44 1 $self->{'tls_enabled'} and $self->{'http2_enabled'}
3879 0 0 1 $handle and $handle->can("alpn_selected")
3910 0 0 203 $listener_spec && $listener_spec->{'type'}
3988 0 0 0 $listener and $listener->read_handle
3993 0 0 0 $self->{'listener'} and not $self->{'_listen_entries'}
4000 0 0 0 $weak_self and $weak_self->{'running'}
4007 0 0 0 $listener and $listener->read_handle
4012 0 0 0 $weak_self->{'listener'} and not $weak_self->{'_listen_entries'}
4027 5 0 2 $self->{'max_requests'} and $self->{'max_requests'} > 0
4116 206 0 0 $receive_pending and not $receive_pending->is_ready
4221 0 0 147 $$receive_pending_ref and not $$receive_pending_ref->is_ready
4234 0 147 0 $timeout_f->is_ready and not $self->{'shutdown_pending'}->is_ready
4264 3 0 186 $key and not $self->{'_hot_restart_in_progress'}
3 0 186 $key and not $self->{'_hot_restart_in_progress'} and defined $ENV{'PAGI_REUSE'}
4272 181 1 7 $entry->{'spec'}{'type'} eq "unix" and not $entry->{'spec'}{'_inherited'}
182 0 7 $entry->{'spec'}{'type'} eq "unix" and not $entry->{'spec'}{'_inherited'} and -e $entry->{'spec'}{'path'}
4337 0 0 0 $conn and $conn->can("_close")
4444 0 2 3 defined $qs and length $qs
4451 1 182 14 defined $qs && length $qs
4510 409 0 10 $self->{'max_connections'} && $self->{'max_connections'} > 0

or 2 conditions

line l !l condition
2192 2 379 delete $params->{'disable_tls'} // 0
2262 312 21 $host //= "127.0.0.1"
2263 326 7 $port //= 5000
2282 14 352 delete $params->{'extensions'} // {}
2284 8 358 delete $params->{'access_log_format'} // "clf"
2288 359 7 delete $params->{'quiet'} // 0
2289 12 354 delete $params->{'log_level'} // "info"
2295 12 354 delete $params->{'timeout'} // 60
2296 12 354 delete $params->{'max_header_size'} // 8192
2297 12 354 delete $params->{'max_header_count'} // 100
2298 15 351 delete $params->{'max_body_size'} // 10000000
2299 53 313 delete $params->{'workers'} // 0
2300 14 352 delete $params->{'max_requests'} // 0
2301 0 366 delete $params->{'listener_backlog'} // 2048
2302 19 347 delete $params->{'shutdown_timeout'} // 30
2303 0 366 delete $params->{'reuseport'} // 0
2304 13 353 delete $params->{'max_receive_queue'} // 1000
2305 11 355 delete $params->{'max_ws_frame_size'} // 65536
2306 2 364 delete $params->{'max_connections'} // 0
2307 11 355 delete $params->{'sync_file_threshold'} // 65536
2308 11 355 delete $params->{'request_timeout'} // 0
2309 11 355 delete $params->{'ws_idle_timeout'} // 0
2310 11 355 delete $params->{'sse_idle_timeout'} // 0
2311 0 366 delete $params->{'heartbeat_timeout'} // 50
2312 1 365 delete $params->{'lifespan_startup_timeout'} // 30
2313 3 363 delete $params->{'lifespan_mode'} // "auto"
2316 12 353 delete $params->{'write_high_watermark'} // 65536
2317 12 353 delete $params->{'write_low_watermark'} // 16384
2325 6 357 $ENV{'PAGI_ENV'} // ""
2328 99 264 delete $params->{'http2'} // 0
2331 2 361 delete $params->{'h2_max_concurrent_streams'} // 100
2332 1 362 delete $params->{'h2_initial_window_size'} // 65535
2333 1 362 delete $params->{'h2_max_frame_size'} // 16384
2334 1 362 delete $params->{'h2_enable_push'} // 0
2335 1 362 delete $params->{'h2_enable_connect_protocol'} // 1
2336 1 362 delete $params->{'h2_max_header_list_size'} // 65536
2337 0 363 delete $params->{'h2_rst_rate_limit'} // {"burst", 1000, "rate", 33}
2496 475 0 $_LOG_LEVELS{$level} // 2
2577 5 40 $ssl->{'min_version'} // "TLSv1_2"
2590 4 41 $ssl->{'cipher_list'} // "ECDHE+AESGCM:DHE+AESGCM:ECDHE+CHACHA20:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA"
2731 4 0 $startup_result->{'message'} // "Lifespan startup failed"
2890 145 47 $ENV{'PAGI_REUSE'} // ""
2988 1 191 $ENV{'PAGI_ENV'} // ""
3069 0 0 $ENV{'PAGI_REUSE'} // ""
3111 3 15 $ENV{'PAGI_REUSE'} // ""
3176 3 15 $ENV{'PAGI_ENV'} // ""
3247 0 0 $self->{'heartbeat_timeout'} || 10
3338 0 0 $inherited{$key} //= {"fd", $fd, "type", "unix", "path", $path, "handle", $fh, "source", "systemd"}
3346 0 1 $inherited{$key} //= {"fd", $fd, "type", "tcp", "host", $host, "port", $port, "handle", $fh, "source", "systemd"}
3382 5 0 $self->{'_listen_entries'} // []
3394 5 0 $self->{'_listen_entries'} // []
3405 5 0 $self->{'_listen_entries'} // []
3426 5 0 $self->{'shutdown_timeout'} // 30
3451 0 0 $self->{'shutdown_timeout'} // 30
3763 2 0 $startup_result->{'message'} // "Lifespan startup failed"
3838 9 0 $self->{'heartbeat_timeout'} || 50
3910 45 158 $self->{'tls_enabled'} // 0
203 0 $listener_spec && $listener_spec->{'type'} // "tcp"
1 0 $self->{'h2c_enabled'} // 0
3986 0 0 $self->{'_listen_entries'} // []
4005 0 0 $weak_self->{'_listen_entries'} // []
4056 207 0 $self->{'lifespan_mode'} // "auto"
4068 206 0 $self->{'is_worker'} // 0
4087 302 0 $event->{'type'} // ""
4093 4 0 $event->{'message'} // ""
4104 0 0 $event->{'message'} // ""
4143 49 0 $self->{'lifespan_mode'} // "auto"
4183 206 0 $self->{'lifespan_startup_timeout'} // 30
4200 48 157 $result->{'lifespan_supported'} // 1
4228 147 0 $self->{'shutdown_timeout'} // 30
4238 146 1 $result // {"success", 1}
4256 188 9 $self->{'_listen_entries'} // []
4262 188 9 $self->{'_listen_entries'} // []
4271 188 9 $self->{'_listen_entries'} // []
4287 0 0 $shutdown_result->{'message'} // "Lifespan shutdown failed"
4299 197 0 $self->{'shutdown_timeout'} // 30
4436 200 0 $_[0]{'client_ip'} // "-"
4439 198 0 $_[0]{'timestamp'} // "-"
4442 5 0 $i->{'path'} // "/"
4445 5 0 $i->{'method'} // "-"
5 0 $i->{'http_version'} // "1.1"
4447 195 0 $_[0]{'method'} // "-"
4448 195 0 $_[0]{'path'} // "/"
4453 1 0 $_[0]{'http_version'} // "1.1"
4454 205 0 $_[0]{'status'} // "-"
4456 10 0 $_[0]{'size'} // 0
4459 2 0 $_[0]{'size'} // 0
4460 194 0 $_[0]{'duration'} // 0
4461 4 0 $_[0]{'duration'} // 0
4462 2 0 $_[0]{'duration'} // 0
4480 4 0 $self->{'listeners'} // []
4488 5 0 $self->{'listeners'} // []

or 3 conditions

line l !l&&r !l&&!r condition
2325 0 0 363 delete $params->{'validate_events'} // (($ENV{'PAGI_ENV'} // "") eq "development" ? 1 : 0)
2763 0 1 0 $self->{'bound_port'} //= $spec->{'port'}
2877 0 182 0 $self->{'bound_port'} //= $bound
3034 0 0 0 $self->{'bound_port'} //= $spec->{'bound_port'}
3088 0 0 0 $self->{'bound_port'} //= $spec->{'bound_port'}
3104 0 18 0 $self->{'bound_port'} //= $spec->{'bound_port'}
3168 18 0 0 $s->{'bound_port'} // $s->{'port'}
3878 1 0 0 $stream->write_handle // $stream->read_handle
4389 0 0 13 $pos >= $len or substr($format, $pos, 1) ne "i"
4475 178 0 1 $self->{'bound_port'} // $self->{'port'}