Condition Coverage

lib/HTTP/Promise/Headers.pm
Criterion Covered Total %
condition 96 379 25.3


and 3 conditions

line !l l&&!r l&&r condition
32 14 0 0 exists $ENV{'MOD_PERL'} and $HTTP::Promise::Headers::MOD_PERL = $ENV{'MOD_PERL'} =~ m[^mod_perl/(\d+\.[\d\.]+)]
48 14 0 0 $HTTP::Promise::Headers::Config{'useithreads'} && $INC{'threads.pm'}
235 62 30 8 defined $type and lc [split(m[/], $type, 2)]->[0] eq "multipart"
278 2 2 3 length $self->{'boundary'} and $self->{'_ctype_cached'} eq $self->content_type
339 0 0 2 defined $type and length "$type"
348 0 0 0 defined $type and length "$type"
357 2 0 14 defined $type and length "$type"
366 0 0 3 defined $type and length "$type"
376 4 0 24 defined $type and length "$type"
464 0 0 11 defined $fname and length $fname
538 114 0 0 $self->{'debug'} and not $self->{'debug_level'}
592 1 0 0 &Scalar::Util::blessed($_[0]) and $_[0]->isa("Module::Generic::Exception")
603 1 0 0 ref $_ eq 'CODE' && !$self->{'_msg_no_exec_sub'}
608 1 0 0 exists $self->{'error_max_length'} && $self->{'error_max_length'} =~ /^[-+]?\d+$/
609 1 0 0 $max_len > 0 and length $args->{'message'} > $max_len
625 0 0 1 exists $self->{'_exception_class'} && length $self->{'_exception_class'}
653 1 0 0 defined ${"${class}::FATAL_ERROR";} and ${"${class}::FATAL_ERROR";}
694 0 1 0 not $args->{'no_return_null_object'} and want("OBJECT")
704 1 0 0 not $self->{'error'} and want("OBJECT")
855 0 0 0 ref $_ eq 'CODE' && !$self->{'_msg_no_exec_sub'}
864 0 0 0 ref $_ eq 'CODE' && !$self->{'_msg_no_exec_sub'}
870 0 0 0 exists $opts->{'caller_info'} and length $opts->{'caller_info'}
894 0 0 0 $r and not ${"${class}::LOG_DEBUG";}
0 0 0 $HTTP::Promise::Headers::MOD_PERL and not ${"${class}::LOG_DEBUG";}
0 0 0 not -t STDIN and $self->{'_log_handler'}
0 0 0 not -t STDIN and $self->{'_log_handler'} and ref $self->{'_log_handler'} eq "CODE"
0 0 0 not -t STDIN and ${$class . "::MESSAGE_HANDLER";}
0 0 0 not -t STDIN and ${$class . "::MESSAGE_HANDLER";} and ref ${$class . "::MESSAGE_HANDLER";} eq "CODE"
896 0 0 0 $self->{'_log_handler'} and ref $self->{'_log_handler'} eq "CODE"
953 0 0 0 ref $_[-1] eq "HASH" and exists $_[-1]{'level'}
0 0 0 $self->{'_message_default_level'} =~ /^\d+$/ and $self->{'_message_default_level'} > 0
970 0 0 0 $_[0] =~ /^\d+$/ || ref $_[-1] eq 'HASH' && exists $_[-1]{'level'} && $_[-1]{'level'} =~ /^\d+$/ and @_ > 1
978 0 0 0 ref $_[-1] eq "HASH" and exists $_[-1]{'level'}
991 0 0 0 defined ${$class . "::DEBUG";} and ${$class . "::DEBUG";} >= $message_level
0 0 0 length $target_re and $class =~ /^$target_re$/
0 0 0 length $target_re and $class =~ /^$target_re$/ and ${$class . "::GLOBAL_DEBUG";} >= $message_level
1050 0 0 10 defined $attr and length $attr
1056 0 0 10 defined $v and length $v
1097 2 0 0 defined $te and length $te
1109 52 0 63 defined $ct and length $ct
1121 0 0 17 defined $ct and length "$ct"
1145 0 0 94 defined $field and length "$field"
1199 0 0 0 scalar @_ == 1 and ref $_[0] eq "HASH"
1206 0 0 0 scalar @_ > 1 and ref $_[-1] eq "HASH"
1214 0 0 0 scalar keys %$opts == 1 and [keys %$opts]->[0] eq "class"
1219 0 0 0 not defined $err and !scalar(@_) || defined $class
0 0 0 defined $err and &Scalar::Util::blessed($err)
0 0 0 defined $err and &Scalar::Util::blessed($err) and scalar @_ == 1 || scalar @_ == 2 && defined $class
1292 1 0 1 defined $value and $value ne ""
1 0 1 defined $value and $value ne "" and $value =~ /\S/
1378 173 10 97 length $self->{'type'} and $self->{'_ctype_cached'} eq $self->content_type
1397 132 0 51 defined $ctype_raw and length "$ctype_raw"
1476 0 0 9 defined $field and length $field
1490 0 0 4 defined $v and $v =~ /^[[:blank:]\h]*Basic[[:blank:]\h]+(.+?)$/
1502 0 0 141 defined $f and length "$f"
1508 15 0 0 defined $opts->{'time_zone'} and length $opts->{'time_zone'}
1511 0 0 0 &Scalar::Util::blessed($this) and $this->isa("DateTime")
0 0 0 &Scalar::Util::blessed($this) and $this->isa("Module::Generic::DateTime")
1559 62 0 64 defined $v and length "$v"
1560 1 63 0 ref $v and not overload::Method($v, "\"\"")
1575 1 0 63 &Scalar::Util::blessed($v) and $v->isa("Module::Generic::DateTime")
1604 0 0 0 scalar @_ == 1 and defined $_[0]
0 0 0 scalar @_ == 1 and defined $_[0] and ref $_[0]
0 0 0 scalar @_ == 1 and defined $_[0] and ref $_[0] and &Scalar::Util::reftype($_[0]) eq "ARRAY"
1628 0 0 59 scalar @_ == 1 and &Scalar::Util::reftype($_[0]) eq "HASH"
1651 0 0 0 defined $f and length "$f"
1704 0 0 59 $obj and $pkg
1749 0 0 3 defined $f and length "$f"
1798 0 0 207 defined $f and length "$f"
1837 0 0 24 defined $f and length "$f"
1848 22 0 1 defined $v and length $v
1871 1 0 0 ref $v and not overload::Method($v, "\"\"")
1880 0 0 9 defined $f and length "$f"
1937 5 0 0 $serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
1963 0 0 4 exists $obj->{'_deserialisation_params'} && ref $obj->{'_deserialisation_params'} eq 'HASH'
1983 0 0 0 scalar @args == 1 && ref $args[0] eq 'ARRAY'
1984 0 0 0 defined $ref && ref $ref eq 'ARRAY' && scalar @$ref > 1
1988 0 0 0 exists $hash->{'_headers_to_restore'} && ref $hash->{'_headers_to_restore'} eq 'ARRAY'

or 2 conditions

line l !l condition
162 0 0 $self->new_field('accept', $accept_raw) || (return $self->pass_error)
202 0 0 $self->new_field('alt_svc', [$name, $value], $def) || (return $self->pass_error)
213 0 0 $self->new_field('alt_svc', $_) || (return $self->pass_error)
271 0 0 $self->new_field('content_type', $ct) || (return $self->pass_error)
303 0 0 $self->new_field('content_type', $ct) || (return $self->pass_error)
491 1 0 'HTTP::Promise::Stream'->new(\$encfile, {'decoding', 'quoted-printable'}) || (return $self->pass_error('HTTP::Promise::Stream'->error))
605 0 1 $args->{'class'} //= ""
626 1 0 $self->_is_class_loaded($ex_class) or scalar keys %{"${ex_class}::";}
718 66 0 shift @_ || (return 0)
824 0 0 $self->message_frame((caller 1)[3]) || 1
827 0 0 (caller 1)[3] // ""
829 0 0 (caller $stackFrame + 1)[3] // ""
847 0 0 (caller $stackFrame + 1)[3] // ""
855 0 0 $_ // ""
864 0 0 $_ // ""
1076 0 0 'Module::Generic::HeaderValue'->new($value) || (return $self->pass_error('Module::Generic::HeaderValue'->error))
1125 15 0 'Module::Generic::HeaderValue'->new_from_header($ct) || (return $self->pass_error('Module::Generic::HeaderValue'->error))
1149 0 0 $MOD_PATH || 'lib/HTTP/Promise/Headers.pm'
1164 94 0 $class->new(@_) || (return $self->pass_error($class->error))
1263 59 0 $opts->{'eol'} || "\r\n"
1730 114 0 shift @_ || (return $self->error('No class to load was provided.'))
1911 5 0 shift @_ // ""
1950 5 0 $hash //= {}

or 3 conditions

line l !l&&r !l&&!r condition
341 1 1 0 $type eq 'text/html' || $self->content_is_xhtml
368 2 0 1 $type eq 'application/xhtml+xml' || $type eq 'application/vnd.wap.xhtml+xml'
469 0 1 0 lc $charset eq "utf8" or lc $charset eq "utf-8"
483 1 2 1 $encoding eq "Q" or $encoding eq "B"
532 114 0 0 ref $self || $self
544 0 114 0 $self->{'debug'} || ${"${class}::DEBUG";}
582 2 0 0 ref $self || $self
592 0 0 1 &Scalar::Util::blessed($_[0]) and $_[0]->isa("Module::Generic::Exception") or &Scalar::Util::blessed($_[0])
653 0 0 1 $self->{'fatal'} or defined ${"${class}::FATAL_ERROR";} and ${"${class}::FATAL_ERROR";}
798 0 0 0 ref $self || $self
800 0 0 0 $self->{'verbose'} or $self->{'debug'}
0 0 0 $self->{'verbose'} or $self->{'debug'} or ${$class . "::DEBUG";}
945 0 0 0 ref $self || $self
970 0 0 0 $_[0] =~ /^\d+$/ || ref $_[-1] eq 'HASH' && exists $_[-1]{'level'} && $_[-1]{'level'} =~ /^\d+$/
991 0 0 0 int $self->{'debug'} >= $message_level or int $self->{'verbose'} >= $message_level
0 0 0 int $self->{'debug'} >= $message_level or int $self->{'verbose'} >= $message_level or defined ${$class . "::DEBUG";} and ${$class . "::DEBUG";} >= $message_level
0 0 0 int $self->{'debug'} >= $message_level or int $self->{'verbose'} >= $message_level or defined ${$class . "::DEBUG";} and ${$class . "::DEBUG";} >= $message_level or int $self->{'debug_level'} >= $message_level
0 0 0 int $self->{'debug'} >= $message_level or int $self->{'verbose'} >= $message_level or defined ${$class . "::DEBUG";} and ${$class . "::DEBUG";} >= $message_level or int $self->{'debug_level'} >= $message_level or int $self->{'debug'} >= 100
0 0 0 int $self->{'debug'} >= $message_level or int $self->{'verbose'} >= $message_level or defined ${$class . "::DEBUG";} and ${$class . "::DEBUG";} >= $message_level or int $self->{'debug_level'} >= $message_level or int $self->{'debug'} >= 100 or length $target_re and $class =~ /^$target_re$/ and ${$class . "::GLOBAL_DEBUG";} >= $message_level
1096 0 0 2 $self->header('Content-Encoding') || $self->header('Transfer-Encoding')
1107 11 0 104 shift @_ || $self->default_type
1123 2 0 15 index($ct, ";") == -1 or index($ct, "boundary") == -1
1190 0 0 0 ref $self || $self
1219 0 0 0 !scalar(@_) || defined $class
0 0 0 scalar @_ == 1 || scalar @_ == 2 && defined $class
1264 59 0 0 $fh ||= select
1265 0 59 0 $self->_is_glob($fh) or $self->_is_a($fh, "HTTP::Promise::IO")
1489 4 0 1 defined $v or want("OBJECT")
1560 0 0 64 not length "$v" or ref $v and not overload::Method($v, "\"\"")
1949 0 0 0 ref $self || $self
5 0 0 $class //= ref $self || $self
1964 4 0 0 delete $hash->{'_class'} || ref $obj || $obj
1984 0 0 0 ref $self || $self