Object.pm

filter: Statementstmt 79.4% 31 / 39 Branchbran n/a Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 81.2% 13 / 16 Podpod 6.6% 1 / 15 totaltotal 61.3% 46 / 75 CC 2 SCAR 2.6
CC
2
Cov
76%
new
2.1
get_created_at
2.0
get_identifier
2.0
CRAP 1.3
« MemoryCache.pm ↑ Summary SizeAwareMemoryCache.pm »
1 ######################################################################
2 # $Id: Object.pm,v 1.8 2002/04/07 17:04:46 dclinton Exp $
3 # Copyright (C) 2001-2003 DeWitt Clinton All Rights Reserved
4 #
5 # Software distributed under the License is distributed on an "AS
6 # IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or
7 # implied. See the License for the specific language governing
8 # rights and limitations under the License.
9 ######################################################################
10  
11 package Cache::Object;
12  
13 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15  
16 sub new
17 134 ▶{
Subroutine new: called CC=2 SCAR=7.2
Pod documented
18 134 my ( $proto ) = @_;
19 134 ▶ my $class = ref( $proto ) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
01340
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
20 134 my $self = {};
21 134 bless ( $self, $class );
22 134 return $self;
23 }
24  
25  
26 sub get_created_at
27 0 ▶{
Subroutine get_created_at: not called CC=1 SCAR=6.9
Pod undocumented
28 0 my ( $self ) = @_;
29  
30 0 return $self->{_Created_At};
31 }
32  
33 sub set_created_at
34 134 ▶{
Subroutine set_created_at: called CC=1 SCAR=0.0
Pod undocumented
35 134 my ( $self, $p_created_at ) = @_;
36  
37 134 $self->{_Created_At} = $p_created_at;
38 }
39  
40  
41 sub get_accessed_at
42 20 ▶{
Subroutine get_accessed_at: called CC=1 SCAR=0.0
Pod undocumented
43 20 my ( $self ) = @_;
44  
45 20 return $self->{_Accessed_At};
46 }
47  
48 sub set_accessed_at
49 180 ▶{
Subroutine set_accessed_at: called CC=1 SCAR=0.0
Pod undocumented
50 180 my ( $self, $p_accessed_at ) = @_;
51  
52 180 $self->{_Accessed_At} = $p_accessed_at;
53 }
54  
55  
56 sub get_data
57 50 ▶{
Subroutine get_data: called CC=1 SCAR=0.0
Pod undocumented
58 50 my ( $self ) = @_;
59  
60 50 return $self->{_Data};
61 }
62  
63 sub set_data
64 134 ▶{
Subroutine set_data: called CC=1 SCAR=0.0
Pod undocumented
65 134 my ( $self, $p_data ) = @_;
66  
67 134 $self->{_Data} = $p_data;
68 }
69  
70  
71 sub get_expires_at
72 344 ▶{
Subroutine get_expires_at: called CC=1 SCAR=0.0
Pod undocumented
73 344 my ( $self ) = @_;
74  
75 344 return $self->{_Expires_At};
76 }
77  
78  
79 sub set_expires_at
80 134 ▶{
Subroutine set_expires_at: called CC=1 SCAR=0.0
Pod undocumented
81 134 my ( $self, $p_expires_at ) = @_;
82  
83 134 $self->{_Expires_At} = $p_expires_at;
84 }
85  
86  
87 sub get_key
88 60 ▶{
Subroutine get_key: called CC=1 SCAR=0.0
Pod undocumented
89 60 my ( $self ) = @_;
90  
91 60 return $self->{_Key};
92 }
93  
94  
95 sub set_key
96 496 ▶{
Subroutine set_key: called CC=1 SCAR=0.0
Pod undocumented
97 496 my ( $self, $p_key ) = @_;
98  
99 496 $self->{_Key} = $p_key;
100 }
101  
102  
103  
104 sub get_size
105 40 ▶{
Subroutine get_size: called CC=1 SCAR=0.0
Pod undocumented
106 40 my ( $self ) = @_;
107  
108 40 return $self->{_Size};
109 }
110  
111  
112 sub set_size
113 362 ▶{
Subroutine set_size: called CC=1 SCAR=0.0
Pod undocumented
114 362 my ( $self, $p_size ) = @_;
115  
116 362 $self->{_Size} = $p_size;
117 }
118  
119  
120 sub get_identifier
121 0 ▶{
Subroutine get_identifier: not called CC=1 SCAR=6.9
Pod undocumented
122 0 my ( $self ) = @_;
123  
124 0 warn( "get_identifier has been marked deprepricated. use get_key" );
125  
126 0 return $self->get_key( );
127 }
128  
129  
130 sub set_identifier
131 0 ▶{
Subroutine set_identifier: not called CC=1 SCAR=6.9
Pod undocumented
132 0 my ( $self, $p_identifier ) = @_;
133  
134 0 warn( "set_identifier has been marked deprepricated. use set_key" );
135  
136 0 return $self->set_key( $p_identifier );
137 }
138  
139  
140  
141  
142 4 1;
143  
144  
145 __END__
« MemoryCache.pm ↑ Summary SizeAwareMemoryCache.pm »