ASP/HTTPContext/SubContext.pm

filter: Statementstmt 16.6% 10 / 60 Branchbran 0.0% 0 / 16 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 15.7% 3 / 19 Podpod 42.8% 6 / 14 totaltotal 14.8% 19 / 128 CC 13 SCAR 34.0
CC
13
Cov
11%
execute
90.0
new
20.0
DESTROY
6.0
CRAP 30.0
« ASP/ModPerl.pm ↑ Summary ASP/UploadHook.pm »
1  
2 package Apache2::ASP::HTTPContext::SubContext;
3  
4 23 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 23 ▶use warnings 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 23 ▶use base 'Apache2::ASP::HTTPContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 #==============================================================================
10 sub new
11 {
12 0 ▶ my ($class, %args) = @_;
Subroutine new: not called CC=4 SCAR=30.0
Pod undocumented
13
14 die "Required param 'parent' was not provided"
15 0 ▶ unless $args{parent};
Branch: 1 branch
BranchTrueFalseTotal
unless $args{"parent"} 0 0 0
16 die "Param 'parent' isn't a Apache2::ASP::HTTPContext"
17 0 ▶ unless $args{parent}->isa( 'Apache2::ASP::HTTPContext' );
Branch: 1 branch
BranchTrueFalseTotal
unless $args{"parent"}->isa("Apache2::ASP::HTTPContext") 0 0 0
18
19 0 ▶ $class = ref($class) || $class;
Condition0%0/3
ref $class || $class
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table0%0/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
20 0 my $s = bless \%args, $class;
21
22 0 $Apache2::ASP::HTTPContext::instance = $s;
23 0 return $s;
24 }# end new()
25  
26  
27 #==============================================================================
28 sub setup_request
29 {
30 0 ▶ my ($s, $requestrec, $cgi) = @_;
Subroutine setup_request: not called CC=1 SCAR=6.9
Pod undocumented
31  
32 0 $s->{r} = $requestrec;
33 0 $s->{cgi} = $cgi;
34
35 0 $s->{connection} = $s->r->connection;
36
37 0 my $resolver = $s->config->web->handler_resolver;
38 0 $s->_load_class( $resolver );
39 0 $s->{handler} = $resolver->new()->resolve_request_handler( $s->r->uri );
40
41 0 return 1;
42 }# end setup_request()
43  
44  
45 #==============================================================================
46 sub execute
47 {
48 0 ▶ my ($s, $args) = @_;
Subroutine execute: not called CC=9 SCAR=45.0
Pod undocumented
49 # local $SIG{__DIE__} = \&Carp::confess;
50
51 0 $s->_load_class( $s->config->web->handler_runner );
52 0 eval {
53 0 $s->_load_class( $s->handler );
54 0 $s->config->web->handler_runner->new()->run_handler( $s->handler, $args );
55 };
56 0 ▶ if( $@ )
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 0 0
57 {
58 0 $s->server->{LastError} = $@;
59 0 return $s->handle_error;
60 }# end if()
61
62 0 $s->response->Flush;
63 0 ▶ my $res = $s->{parent} ? $s->response->Status : $s->end_request();
Branch: 1 branch
BranchTrueFalseTotal
$s->{'parent'} ? : 0 0 0
64 0 ▶ if( $s->page && $s->page->directives->{OutputCache} && defined($s->{_cache_buffer}) )
Branch: 1 branch
BranchTrueFalseTotal
if ($s->page and $s->page->directives->{"OutputCache"} and defined $s->{"_cache_buffer"}) 0 0 0
Condition0%0/6
$s->page and $s->page->directives->{"OutputCache"} and defined $s->{"_cache_buffer"}
!ll&&!rl&&r
000
$s->page and $s->page->directives->{"OutputCache"}
!ll&&!rl&&r
000
MC/DC0%0/3
$s->page and $s->page->directives->{"OutputCache"} and defined $s->{"_cache_buffer"}
$s->page $s->page->directives->{"OutputCache"} defined $s->{"_cache_buffer"}
Truth table0%0/4
A and B and C
A= $s->pageB= $s->page->directives->{"OutputCache"}C= defined $s->{"_cache_buffer"}
ABCresult
0XX0
10X0
1100
1111
65 {
66 0 ▶ if( $res == 200 || $res == 0 )
Branch: 1 branch
BranchTrueFalseTotal
if ($res == 200 or $res == 0) 0 0 0
Condition0%0/3
$res == 200 or $res == 0
l!l&&r!l&&!r
000
MC/DC0%0/2
$res == 200 or $res == 0
$res == 200 $res == 0
Truth table0%0/3
A or B
A= $res == 200B= $res == 0
ABresult
1X1
011
000
67 {
68 0 $s->page->_write_cache( \$s->{_cache_buffer} );
69 }# end if()
70 }# end if()
71
72 0 ▶ $res = 0 if $res =~ m/^200/;
Branch: 1 branch
BranchTrueFalseTotal
if $res =~ /^200/ 0 0 0
73 0 return $res;
74 }# end execute()
75  
76  
77 #==============================================================================
78 sub get_prop
79 {
80 0 ▶ my ($s, $prop) = @_;
Subroutine get_prop: not called CC=1 SCAR=6.9
Pod undocumented
81
82 0 $s->{parent}->get_prop($prop);
83 }# end get_prop()
84  
85  
86 #==============================================================================
87 sub set_prop
88 {
89 0 ▶ my ($s) = shift;
Subroutine set_prop: not called CC=1 SCAR=6.9
Pod undocumented
90 0 my $prop = shift;
91
92 0 $s->{parent}->set_prop($prop, @_);
93 }# end set_prop()
94  
95 0 ▶sub config { shift->get_prop('config') }
Subroutine config: not called CC=1 SCAR=6.9
Pod documented
96 0 ▶sub session { shift->get_prop('session') }
Subroutine session: not called CC=1 SCAR=6.9
Pod documented
97 0 ▶sub server { shift->get_prop('server') }
Subroutine server: not called CC=1 SCAR=6.9
Pod documented
98 0 ▶sub request { shift->get_prop('request') }
Subroutine request: not called CC=1 SCAR=6.9
Pod documented
99 0 ▶sub response { shift->get_prop('response') }
Subroutine response: not called CC=1 SCAR=6.9
Pod documented
100 0 ▶sub application { shift->get_prop('application') }
Subroutine application: not called CC=1 SCAR=6.9
Pod documented
101 0 ▶sub stash { shift->get_prop('stash') }
Subroutine stash: not called CC=1 SCAR=6.9
Pod undocumented
102 0 ▶sub global_asa { shift->get_prop('global_asa') }
Subroutine global_asa: not called CC=1 SCAR=6.9
Pod undocumented
103 0 ▶sub _is_setup { shift->get_prop('_is_setup') }
Subroutine _is_setup: not called CC=1 SCAR=6.9
104  
105  
106 #==============================================================================
107 sub rflush
108 {
109 0 ▶ my $s = shift;
Subroutine rflush: not called CC=1 SCAR=6.9
Pod undocumented
110
111 0 $s->{r}->rflush();
112 }# end rflush()
113  
114  
115 #==============================================================================
116 sub DESTROY
117 {
118 0 ▶ my $s = shift;
Subroutine DESTROY: not called CC=2 SCAR=17.9
119
120 0 ▶ if( my $parent = $s->{parent} )
Branch: 1 branch
BranchTrueFalseTotal
if (my $parent = $s->{"parent"}) 0 0 0
121 {
122 0 $Apache2::ASP::HTTPContext::instance = $parent;
123 }# end if()
124
125 0 undef(%$s);
126 }# end DESTROY()
127  
128 23 1;# return true:
129  
« ASP/ModPerl.pm ↑ Summary ASP/UploadHook.pm »