examples/bad-method.cgi

filter: Statementstmt 92.8% 13 / 14 Branchbran 87.5% 7 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 91.6% 22 / 24 CC 1 SCAR 0.0
CC
1
Cov
91%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Test/CGI/External.pm ↑ Summary
1 #!/usr/local/bin/perl
2 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 my $rm = $ENV{REQUEST_METHOD};
5 4 ▶if (! $rm) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($rm) 0 4 4
6 0 die "No request method";
7 }
8 4 ▶if ($rm eq 'POST') {
Branch: 3 branches
BranchTrueFalseTotal
if ($rm eq 'POST') { } 1 3 4
elsif ($rm eq 'GET') { } 1 2 3
elsif ($rm eq 'HEAD') { } 1 1 2
9 1 print <<EOF;
10 Status: 405
11 Allow: GET, HEAD
12  
13 EOF
14 }
15 elsif ($rm eq 'GET') {
16 1 print <<EOF;
17 Content-Type: text/plain
18  
19 Greetings
20 EOF
21 }
22 elsif ($rm eq 'HEAD') {
23 1 print <<EOF;
24 Content-Type: text/plain
25  
26 EOF
27 }
28 else {
29 1 print <<EOF;
30 Status: 501
31  
32 EOF
33 }
34  
« blib/lib/Test/CGI/External.pm ↑ Summary