Branch Coverage

CGI/Application/Plugin/ProtectCSRF.pm
Criterion Covered Total %
branch 26 46 56.5


line true false branch
85 0 4 unless $pkg->can('session')
216 4 0 if (ref $$self{'__CAP_PROTECT_CSRF_CONFIG'} ne 'HASH')
220 0 4 exists $args{'csrf_error_status'} ? :
221 0 4 exists $args{'csrf_error_mode'} ? :
222 4 0 exists $args{'csrf_error_tmpl'} ? :
224 0 4 exists $args{'csrf_id'} ? :
225 0 4 exists $args{'csrf_post_only'} ? :
227 4 0 if (ref $args{'csrf_error_tmpl_param'} eq 'HASH' and keys %{$args{'csrf_error_tmpl_param'};})
267 0 0 if $fast
283 3 1 unless exists $publish_csrf_id_runmodes{$self->can($rm)}
285 0 1 if (ref $$self{'__CAP_PROTECT_CSRF_CONFIG'} ne 'HASH')
308 1 3 unless exists $protect_csrf_runmodes{$self->can($rm)}
310 0 3 if (ref $$self{'__CAP_PROTECT_CSRF_CONFIG'} ne 'HASH')
314 0 3 if ($$self{'__CAP_PROTECT_CSRF_CONFIG'}{'csrf_post_only'} and $ENV{'REQUEST_METHOD'} ne 'POST') { }
318 1 0 if (not $self->query->param($$self{'__CAP_PROTECT_CSRF_CONFIG'}{'csrf_id'}) && $self->csrf_id or $self->query->param($$self{'__CAP_PROTECT_CSRF_CONFIG'}{'csrf_id'}) ne $self->csrf_id)
327 1 0 if ($err_flg)
335 1 0 if (keys %{$$self{'__CAP_PROTECT_CSRF_CONFIG'}{'csrf_error_tmpl_param'};})
360 1 1 unless $coderef and exists $publish_csrf_id_runmodes{$coderef}
362 0 1 if (ref $$self{'__CAP_PROTECT_CSRF_CONFIG'} ne 'HASH')
376 3 1 if ($$token[0] eq 'S') { }
1 0 elsif ($$token[0] =~ /^(E|PI)$/) { }
0 0 elsif ($$token[0] =~ /^(T|C|D)$/) { }
378 1 2 if (lc $$token[1] eq 'form') { }