EP/Request/CGI.pm

filter: Statementstmt 25.0% 8 / 32 Branchbran 0.0% 0 / 16 Conditioncond 0.0% 0 / 25 MC/DCmcdc 0.0% 0 / 16 Subroutinesub 18.1% 2 / 11 Podpod 0.0% 0 / 9 totaltotal 9.1% 10 / 109 CC 18 SCAR 24.8
CC
18
Cov
11%
new
20.0
Client
12.0
Location
12.0
CRAP 12.0
« EP/Test.pm ↑ Summary EP/Install.pm »
1 # -*- perl -*-
2
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4
5 1 ▶use CGI ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 package XML::EP::Request::CGI;
8
9 1 $XML::EP::Request::CGI::VERSION = '0.01';
10
11
12 0 ▶sub new {
Subroutine new: not called CC=4 SCAR=30.0
Pod undocumented
13 0 my $proto = shift;
14 0 ▶ my $path = $ENV{'PATH_TRANSLATED'} || shift;
Condition0%0/3
$ENV{'PATH_TRANSLATED'} || shift()
l!l&&r!l&&!r
000
MC/DC0%0/2
$ENV{'PATH_TRANSLATED'} || shift()
$ENV{'PATH_TRANSLATED'} shift()
Truth table0%0/3
A || B
A= $ENV{'PATH_TRANSLATED'}B= shift()
ABresult
1X1
011
000
15 0 ▶ if ($path =~ /(.*)[\/\\]/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($path =~ m((.*)[/\\])) 0 0 0
16 0 chdir $1;
17 }
18 0 my $self = { 'PATH_TRANSLATED' => $path };
19 0 ▶ bless($self, ref($proto) || $proto);
Condition0%0/3
ref $proto || $proto
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
20 }
21
22
23 0 ▶sub Param { my $self = shift; $self->{cgi}->param(@_) }
Subroutine Param: not called CC=1 SCAR=6.9
Pod undocumented
24 0 ▶sub Client {
Subroutine Client: not called CC=3 SCAR=24.8
Pod undocumented
25 0 my $self = shift;
26 @_ ? ($self->{Client} = shift) :
27 0 ▶ ($self->{Client} || $ENV{HTTP_USER_AGENT});
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
Condition0%0/3
$self->{"Client"} or $ENV{"HTTP_USER_AGENT"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"Client"} or $ENV{"HTTP_USER_AGENT"}
$self->{"Client"} $ENV{"HTTP_USER_AGENT"}
Truth table0%0/3
A or B
A= $self->{"Client"}B= $ENV{"HTTP_USER_AGENT"}
ABresult
1X1
011
000
28 }
29 0 ▶sub Location {
Subroutine Location: not called CC=3 SCAR=24.8
Pod undocumented
30 0 my $self = shift;
31 @_ ? ($self->{Location} = shift) :
32 0 ▶ ($self->{Location} || $ENV{REQUEST_URI});
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
Condition0%0/3
$self->{"Location"} or $ENV{"REQUEST_URI"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"Location"} or $ENV{"REQUEST_URI"}
$self->{"Location"} $ENV{"REQUEST_URI"}
Truth table0%0/3
A or B
A= $self->{"Location"}B= $ENV{"REQUEST_URI"}
ABresult
1X1
011
000
33 }
34 0 ▶sub VirtualHost {
Subroutine VirtualHost: not called CC=3 SCAR=24.8
Pod undocumented
35 0 my $self = shift;
36 @_ ? ($self->{VirtualHost} = shift) :
37 0 ▶ ($self->{VirtualHost} || $ENV{SERVER_NAME});
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
Condition0%0/3
$self->{"VirtualHost"} or $ENV{"SERVER_NAME"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"VirtualHost"} or $ENV{"SERVER_NAME"}
$self->{"VirtualHost"} $ENV{"SERVER_NAME"}
Truth table0%0/3
A or B
A= $self->{"VirtualHost"}B= $ENV{"SERVER_NAME"}
ABresult
1X1
011
000
38 }
39 0 ▶sub PathInfo {
Subroutine PathInfo: not called CC=3 SCAR=24.8
Pod undocumented
40 0 my $self = shift;
41 @_ ? ($self->{PathInfo} = shift) :
42 0 ▶ ($self->{PathInfo} || $ENV{PATH_INFO});
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
Condition0%0/3
$self->{"PathInfo"} or $ENV{"PATH_INFO"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"PathInfo"} or $ENV{"PATH_INFO"}
$self->{"PathInfo"} $ENV{"PATH_INFO"}
Truth table0%0/3
A or B
A= $self->{"PathInfo"}B= $ENV{"PATH_INFO"}
ABresult
1X1
011
000
43 }
44 0 ▶sub PathTranslated {
Subroutine PathTranslated: not called CC=3 SCAR=24.8
Pod undocumented
45 0 my $self = shift;
46 @_ ? ($self->{PathTranslated} = shift) :
47 0 ▶ ($self->{PathTranslated} || $ENV{PATH_TRANSLATED});
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
Condition0%0/3
$self->{"PathTranslated"} or $ENV{"PATH_TRANSLATED"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"PathTranslated"} or $ENV{"PATH_TRANSLATED"}
$self->{"PathTranslated"} $ENV{"PATH_TRANSLATED"}
Truth table0%0/3
A or B
A= $self->{"PathTranslated"}B= $ENV{"PATH_TRANSLATED"}
ABresult
1X1
011
000
48 }
49 0 ▶sub FileHandle {
Subroutine FileHandle: not called CC=3 SCAR=24.8
Pod undocumented
50 0 my $self = shift;
51 0 ▶ @_ ? ($self->{FileHandle} = shift) : ($self->{FileHandle} || \*STDOUT);
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
Condition0%0/2
$self->{"FileHandle"} or \*STDOUT
l!l
00
MC/DC0%0/1
$self->{"FileHandle"} or \*STDOUT
$self->{"FileHandle"}
Truth table0%0/2
A
A= $self->{"FileHandle"}
Aresult
11
00
52 }
53 0 ▶sub Uri {
Subroutine Uri: not called CC=3 SCAR=24.8
Pod undocumented
54 0 my $self = shift;
55 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 0 0 0
56 0 $self->{Uri} = shift;
57 } else {
58 0 ▶ $self->{Uri} ||= "http://$ENV{SERVER_NAME}/$ENV{REQUEST_URI}";
Condition0%0/2
$self->{"Uri"} ||= qq[http://$ENV{"SERVER_NAME"}/$ENV{"REQUEST_URI"}]
l!l
00
MC/DC0%0/1
$self->{"Uri"} ||= qq[http://$ENV{"SERVER_NAME"}/$ENV{"REQUEST_URI"}]
$self->{"Uri"}
Truth table0%0/2
A
A= $self->{"Uri"}
Aresult
11
00
59 }
60 }
61
62
63 1 1;
« EP/Test.pm ↑ Summary EP/Install.pm »