Condition Coverage

lib/Plack/Middleware/XSRFBlock.pm
Criterion Covered Total %
condition 31 56 55.3


and 3 conditions

line !l l&&!r l&&r condition
158 17 4 4 $token and not $self->token_per_request->($self, $request, $env)
229 150 21 4 $tag eq "head" and $self->meta_tag
247 0 150 25 defined $tag and defined $attr->{'method'}
150 0 25 defined $tag and defined $attr->{'method'} and $tag eq "form"
150 0 25 defined $tag and defined $attr->{'method'} and $tag eq "form" and $attr->{'method'} =~ $self->http_method_regex
249 0 0 25 defined $attr and exists $attr->{'action'}
0 25 0 defined $attr and exists $attr->{'action'} and $attr->{'action'} =~ m[^https?://([^/:]+)[/:]]
25 0 0 defined $attr and exists $attr->{'action'} and $attr->{'action'} =~ m[^https?://([^/:]+)[/:]] and defined $http_host
25 0 0 defined $attr and exists $attr->{'action'} and $attr->{'action'} =~ m[^https?://([^/:]+)[/:]] and defined $http_host and $1 ne $http_host

or 2 conditions

line l !l condition
39 0 88 $self->parameter_name || 'xsrf_token'
54 0 88 $self->cookie_name || 'PSGI-XSRF-Token'
57 0 88 $self->cookie_is_session_cookie || 0
60 8 80 $self->cookie_options || {}
71 0 88 $self->cookie_expiry_seconds || 10800
126 0 17 $env->{'psgix.logger'} || sub {
148 30 0 $headers->get('Content-Type') || ''

or 3 conditions

line l !l&&r !l&&!r condition
45 0 88 0 $self->http_method_regex || qr/^post$/i
48 0 88 0 $self->contents_to_filter_regex || qr"^(?: (?:text/html) | (?:application/xhtml(?:\+xml)?) )\b"xi
85 1 5 5 $val ||= $request->parameters->{$self->parameter_name}
92 6 0 5 defined $val or length $val
328 0 0 0 not defined $signature or $signature eq ""