lib/OpenFrame/Response.pm

filter: Statementstmt 83.3% 50 / 60 Branchbran 60.0% 6 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 81.2% 13 / 16 Podpod 83.3% 5 / 6 totaltotal 80.4% 74 / 92 CC 6 SCAR 7.0
CC
6
Cov
80%
cookies
6.0
message
3.0
mimetype
2.2
CRAP 2.0
« lib/OpenFrame/Segment/HTTP/Response.pm ↑ Summary blib/lib/saofs.pl »
1 package OpenFrame::Response;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings::register;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use OpenFrame::Object;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Pipeline::Production;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use base qw ( OpenFrame::Object Pipeline::Production Exporter );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 our $VERSION=3.05;
12  
13 2 ▶use constant ofOK => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶use constant ofREDIRECT => 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 2 ▶use constant ofDECLINE => 4;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 2 ▶use constant ofERROR => 8;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 ##
19 ## we export this because its good
20 ##
21 2 our @EXPORT = qw ( ofOK ofREDIRECT ofDECLINE ofERROR );
22  
23 0 ▶sub last_modified { }
Subroutine last_modified: not called CC=1 SCAR=0.0
Pod undocumented
24  
25 0 ▶sub cookies {
Subroutine cookies: not called CC=2 SCAR=17.9
Pod documented
26 0 my $self = shift;
27 0 my $cookies = shift;
28 0 ▶ if (defined( $cookies )) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $cookies) { } 0 0 0
29 0 $self->{cookies} = $cookies;
30 0 return $self;
31 } else {
32 0 return $self->{cookies};
33 }
34 }
35  
36 1 ▶sub mimetype {
Subroutine mimetype: called CC=2 SCAR=7.9
Pod documented
37 1 my $self = shift;
38 1 my $mime = shift;
39 1 ▶ if (defined( $mime )) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $mime) { } 0 1 1
40 0 $self->{mimetype} = lc $mime;
41 0 return $self;
42 } else {
43 1 return $self->{mimetype};
44 }
45 }
46  
47 0 ▶sub contents {
Subroutine contents: not called CC=1 SCAR=6.9
Pod documented
48 0 my $self = shift;
49 0 return $self;
50 }
51  
52 2 ▶sub message {
Subroutine message: called CC=3 SCAR=11.0
Pod documented
53 2 my $self = shift;
54 2 my $mesg = shift;
55 2 ▶ if (defined( $mesg )) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $mesg) { } 1 1 2
56 1 $self->{ mesg } = $mesg ;
57 1 return $self;
58 } else {
59 1 my $msg = $self->{ mesg };
60 1 ▶ return ref($msg) ? $$msg
Branch: 1 branch
BranchTrueFalseTotal
ref $msg ? : 0 1 1
61 : $msg;
62 }
63 }
64  
65 3 ▶sub code {
Subroutine code: called CC=2 SCAR=6.9
Pod documented
66 3 my $self = shift;
67 3 my $code = shift;
68 3 ▶ if (defined( $code )) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $code) { } 1 2 3
69 1 $self->{ code } = $code;
70 1 return $self;
71 } else {
72 return $self->{ code }
73 2 }
74 }
75  
76  
77 ##
78 ## for backwards compatibility we have a package called
79 ## OpenFrame::Constants
80 ##
81 package OpenFrame::Constants;
82  
83  
84 2 1;
85  
86 __END__
« lib/OpenFrame/Segment/HTTP/Response.pm ↑ Summary blib/lib/saofs.pl »