SimpleHTTP/State.pm

filter: Statementstmt 84.0% 37 / 44 Branchbran 40.0% 4 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod 0.0% 0 / 3 totaltotal 74.6% 50 / 67 CC 6 SCAR 9.9
CC
6
Cov
76%
reset
6.0
wheel_alive
4.3
close_wheel
2.0
CRAP 2.7
« SimpleHTTP/Response.pm ↑ Summary
1 package POE::Component::Server::SimpleHTTP::State;
2  
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 7 ▶use POE::Wheel::ReadWrite;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 7 our $VERSION = '2.24';
8  
9 7 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 7 has 'wheel' => (
12 is => 'ro',
13 isa => 'POE::Wheel::ReadWrite',
14 clearer => 'clear_wheel',
15 predicate => 'has_wheel',
16 required => 1,
17 );
18  
19 7 has 'response' => (
20 is => 'ro',
21 isa => 'POE::Component::Server::SimpleHTTP::Response',
22 writer => 'set_response',
23 clearer => 'clear_response',
24 );
25  
26 7 has 'request' => (
27 is => 'ro',
28 isa => 'HTTP::Request',
29 writer => 'set_request',
30 clearer => 'clear_request',
31 );
32  
33 7 has 'connection' => (
34 is => 'ro',
35 isa => 'POE::Component::Server::SimpleHTTP::Connection',
36 writer => 'set_connection',
37 clearer => 'clear_connection',
38 init_arg => undef,
39 );
40  
41 has 'done' => (
42 is => 'ro',
43 isa => 'Bool',
44 init_arg => undef,
45 6 ▶ default => sub { 0 },
Subroutine __ANON__: called CC=1 SCAR=0.0
46 7 writer => 'set_done',
47 );
48  
49 has 'streaming' => (
50 is => 'ro',
51 isa => 'Bool',
52 init_arg => undef,
53 6 ▶ default => sub { 0 },
Subroutine __ANON__: called CC=1 SCAR=0.0
54 7 writer => 'set_streaming',
55 );
56  
57 sub reset {
58 0 ▶ my $self = shift;
Subroutine reset: not called CC=2 SCAR=17.9
Pod undocumented
59 0 $self->clear_response;
60 0 $self->clear_request;
61 0 $self->set_streaming(0);
62 0 $self->set_done(0);
63 0 ▶ $self->wheel->set_output_filter( $self->wheel->get_input_filter ) if $self->has_wheel;
Branch: 1 branch
BranchTrueFalseTotal
if $self->has_wheel 0 0 0
64 0 return 1;
65 }
66  
67 sub close_wheel {
68 1 ▶ my $self = shift;
Subroutine close_wheel: called CC=2 SCAR=7.0
Pod undocumented
69 1 ▶ return unless $self->has_wheel;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->has_wheel 0 1 1
70 1 $self->wheel->shutdown_input;
71 1 $self->wheel->shutdown_output;
72 1 $self->clear_wheel;
73 1 return 1;
74 }
75  
76 sub wheel_alive {
77 7 ▶ my $self = shift;
Subroutine wheel_alive: called CC=4 SCAR=14.6
Pod undocumented
78 7 ▶ return unless $self->has_wheel;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->has_wheel 0 7 7
79 7 ▶ return unless defined $self->wheel;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->wheel 0 7 7
80 7 ▶ return unless $self->wheel->get_input_handle();
Branch: 1 branch
BranchTrueFalseTotal
unless $self->wheel->get_input_handle 0 7 7
81 7 return 1;
82 }
83  
84 7 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
85  
86 7 __PACKAGE__->meta->make_immutable();
87  
88 7 'This monkey has gone to heaven';
89  
90 __END__
« SimpleHTTP/Response.pm ↑ Summary