Action/State.pm

filter: Statementstmt 93.1% 27 / 29 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 5 totaltotal 78.0% 39 / 50 CC 5 SCAR 8.7
CC
5
Cov
84%
new
4.6
errors
2.1
BEGIN
1.0
CRAP 2.4
↑ Summary Action.pm »
1 package Apache::Action::State;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 @ISA = qw(Exporter);
8  
9 # Not a DB object!
10  
11 2 ▶sub new {
Subroutine new: called CC=4 SCAR=15.2
Pod undocumented
12 2 my $class = shift;
13 0 ▶ my $self = ($#_ == 0) ? { %{ (shift) } } : { @_ };
Branch: 1 branch
BranchTrueFalseTotal
$#_ == 0 ? : 0 2 2
14 2 ▶ die "No Request accessible to state" unless $self->{Request};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"Request"} 0 2 2
15 2 ▶ die "No Session accessible to state" unless $self->{Session};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"Session"} 0 2 2
16 2 return bless $self, $class;
17 }
18  
19 1 ▶sub error {
Subroutine error: called CC=1 SCAR=0.0
Pod undocumented
20 1 my $self = shift;
21 1 push( @{ $self->{Errors} }, @_ );
22 }
23  
24 1 ▶sub errors {
Subroutine errors: called CC=2 SCAR=7.4
Pod undocumented
25 1 my $self = shift;
26 1 ▶ if ($self->{Errors}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"Errors"}) 1 0 1
27 1 return @{ $self->{Errors} };
28 }
29 0 return ();
30 }
31  
32 1 ▶sub set {
Subroutine set: called CC=1 SCAR=0.0
Pod undocumented
33 1 my ($self, $key, $data) = @_;
34 1 $self->{Data}->{$key} = $data;
35 }
36  
37 1 ▶sub get {
Subroutine get: called CC=1 SCAR=0.0
Pod undocumented
38 1 my ($self, $key) = @_;
39 1 return $self->{Data}->{$key};
40 }
41  
42 3 1;
↑ Summary Action.pm »