Branch Coverage

blib/lib/Plack/Middleware/Statsd.pm
Criterion Covered Total %
branch 33 50 66.0


line true false branch
34 5 0 if (my $client = $self->client)
42 1 14 if defined $self->$attr
44 1 13 unless defined $method
48 0 57 unless defined $method
54 3 0 if (my $logger = $env->{'psgix.logger'}) { }
67 1 4 if (my $attr = &first(sub { not is_coderef($self->$_); } , "histogram", "increment", "set_add"))
71 1 3 if (my $catch = $self->catch_errors)
73 1 0 unless (is_coderef($catch))
77 1 0 if (my $logger = $env->{'psgix.logger'}) { }
100 1 6 if (my $catch = $self->catch_errors) { }
115 0 7 unless $client
119 0 7 if defined $rate and $rate >= 1
129 7 0 if (defined $env->{'CONTENT_LENGTH'})
136 7 0 if (my $method = $env->{'REQUEST_METHOD'})
137 1 6 unless $method =~ /^\w+$/a
141 1 6 if (my $type = _mime_type_to_metric($env->{'CONTENT_TYPE'}))
146 7 0 if $env->{'REMOTE_ADDR'}
157 0 7 if ($h->exists($xsendfile))
161 7 0 if ($h->exists("Content-Length"))
166 7 0 if (my $type = _mime_type_to_metric($h->get("Content-Type")))
172 0 7 $env->{'psgix.harakiri.supported'} ? :
0 7 if ($env->{'psgix.harakiri.supported'} ? $env->{'psgix.harakiri'} : $env->{'psgix.harakiri.commit'})
181 0 7 if $client->can("flush")
190 6 8 unless $type
191 0 8 unless $type =~ m[^\w+/(?:\w+[\-\+])*\w+(?: *;\w+=\w+)?]a