Branch Coverage

blib/lib/Catalyst/Plugin/CSRFToken.pm
Criterion Covered Total %
branch 25 68 36.7


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 1 2 if (my $session_token = delete $self->session->{'current_csrf_token'}) { }
68 1 0 $session_token eq $token ? :
76 0 1 exists $args{'session'} ? :
77 0 1 exists $args{'token_secret'} ? :
84 0 7 if (my $header_token = $self->request->header('X-CSRF-Token')) { }
93 0 0 exists $args{'csrf_token'} ? :
94 0 0 exists $args{'session'} ? :
95 0 0 exists $args{'token_secret'} ? :
96 0 0 exists $args{'max_age'} ? :
98 0 0 unless $token
99 0 0 if WWW::CSRF::check_csrf_token($session, $token_secret, $token, {"MaxAge", $max_age}) == 1
110 0 0 (shift())->(@_)->check_csrf_token ? :
115 0 4 exists $args{'csrf_token'} ? :
116 0 4 exists $args{'session'} ? :
117 0 4 exists $args{'token_secret'} ? :
118 0 4 exists $args{'max_age'} ? :
120 0 4 unless $token
130 3 1 unless $status == 0
138 0 0 unless defined $status
139 0 0 $status == 1 ? :
144 0 2 if $self->controller->can("handle_failed_csrf_token_check")
145 0 2 if $self->can("handle_failed_csrf_token_check")
173 0 0 unless $self->req->method eq "POST" or $self->req->method eq "PUT" or $self->req->method eq "PATCH"
179 0 0 if ($self->can('session') and $self->session->{'current_csrf_token'}) { }