Branch Coverage

blib/lib/Catalyst/Plugin/CSRFToken.pm
Criterion Covered Total %
branch 27 74 36.4


line true false branch
13 6 0 if (my $config = +(shift())->config->{'Plugin::CSRFToken'})
14 6 0 if exists $config->{'default_secret'}
22 6 0 if (my $config = +(shift())->config->{'Plugin::CSRFToken'})
23 0 6 if exists $config->{'max_age'}
31 6 0 if (my $config = +(shift())->config->{'Plugin::CSRFToken'})
32 0 6 if exists $config->{'param_key'}
40 6 0 if (my $config = +(shift())->config->{'Plugin::CSRFToken'})
41 6 0 if exists $config->{'auto_check'}
53 1 0 unless $length
66 0 3 exists $args{'csrf_token'} ? :
67 0 3 unless $token
68 1 2 if (my $session_token = delete $self->session->{'current_csrf_token'}) { }
69 1 0 $session_token eq $token ? :
77 0 1 exists $args{'session'} ? :
78 0 1 exists $args{'token_secret'} ? :
85 0 7 if (my $header_token = $self->request->header('X-CSRF-Token')) { }
89 7 0 if exists $self->req->body_parameters->{$self->csrf_token_param_key}
91 0 0 if exists $self->req->body_data->{$self->csrf_token_param_key}
98 0 0 exists $args{'csrf_token'} ? :
99 0 0 exists $args{'session'} ? :
100 0 0 exists $args{'token_secret'} ? :
101 0 0 exists $args{'max_age'} ? :
103 0 0 unless $token
104 0 0 if WWW::CSRF::check_csrf_token($session, $token_secret, $token, {"MaxAge", $max_age}) == 1
115 0 0 (shift())->(@_)->check_csrf_token ? :
120 0 4 exists $args{'csrf_token'} ? :
121 0 4 exists $args{'session'} ? :
122 0 4 exists $args{'token_secret'} ? :
123 0 4 exists $args{'max_age'} ? :
125 0 4 unless $token
135 3 1 unless $status == 0
143 0 0 unless defined $status
144 0 0 $status == 1 ? :
149 0 2 if $self->controller->can("handle_failed_csrf_token_check")
150 0 2 if $self->can("handle_failed_csrf_token_check")
178 0 0 unless $self->req->method eq "POST" or $self->req->method eq "PUT" or $self->req->method eq "PATCH"
184 0 0 if ($self->can('session') and $self->session->{'current_csrf_token'}) { }