lib/AI/MicroStructure/Scoring.pm untested

filter: Statementstmt 0.0% 0 / 47 Branchbran 0.0% 0 / 20 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 12 totaltotal 0.0% 0 / 92 CC 11 SCAR 17.0
CC
11
Cov
0%
entropy
6.0
expected_score
6.0
scale
6.0
CRAP 5.5
1 package AI::MicroStructure::Scoring;
2  
3 use strict;
4  
5  
6  
7  
8 sub new {
9  
10 my($class) = shift ;
11
12 my $self = bless { cache => [] }, $class;
13
14
15
16
17 my ($entropy,$expected,$scale,$scaleval,$database,
18 $lowestscore,$highestscore,$lambda,$H);
19 $class->entropy($entropy);
20 $class->expected_score($expected);
21 $class->scale($scale);
22 $class->scale_value($scaleval);
23 $class->database ($database);
24 $class->lowest_score($lowestscore);
25 $class->highest_score($highestscore);
26 $class->lambda($lambda);
27 $class->H($H);
28
29 return $self;
30 }
31  
32 =head2 entropy
33  
34 Title : entropy
35 Usage : $obj->entropy($newval)
36 Function:
37 Example :
38 Returns : value of entropy (a scalar)
39 Args : on set, new value (a scalar or undef, optional)
40  
41  
42 =cut
43  
44 sub initialize { return @_; }
45  
46 sub entropy{
47 my $self = shift;
48  
49 return $self->{'entropy'} = shift if @_;
50 return $self->{'entropy'};
51 }
52  
53 =head2 expected_score
54  
55 Title : expected_score
56 Usage : $obj->expected_score($newval)
57 Function:
58 Example :
59 Returns : value of expected (a scalar)
60 Args : on set, new value (a scalar or undef, optional)
61  
62  
63 =cut
64  
65 sub expected_score{
66 my $self = shift;
67  
68 return $self->{'expected'} = shift if @_;
69 return $self->{'expected'};
70 }
71  
72 =head2 scale
73  
74 Title : scale
75 Usage : $obj->scale($newval)
76 Function:
77 Example :
78 Returns : value of scale (a scalar)
79 Args : on set, new value (a scalar or undef, optional)
80  
81  
82 =cut
83  
84 sub scale{
85 my $self = shift;
86  
87 return $self->{'scale'} = shift if @_;
88 return $self->{'scale'};
89 }
90  
91 =head2 scale_value
92  
93 Title : scale_value
94 Usage : $obj->scale_value($newval)
95 Function:
96 Example :
97 Returns : value of scale_value (a scalar)
98 Args : on set, new value (a scalar or undef, optional)
99  
100  
101 =cut
102  
103 sub scale_value{
104 my $self = shift;
105  
106 return $self->{'scale_value'} = shift if @_;
107 return $self->{'scale_value'};
108 }
109  
110 =head2 description
111  
112 Title : description
113 Usage : $obj->description($newval)
114 Function:
115 Example :
116 Returns : value of description (a scalar)
117 Args : on set, new value (a scalar or undef, optional)
118  
119  
120 =cut
121  
122 sub description{
123 my $self = shift;
124  
125 return $self->{'description'} = shift if @_;
126 return $self->{'description'};
127 }
128  
129 =head2 database
130  
131 Title : database
132 Usage : $obj->database($newval)
133 Function:
134 Example :
135 Returns : value of database (a scalar)
136 Args : on set, new value (a scalar or undef, optional)
137  
138  
139 =cut
140  
141 sub database{
142 my $self = shift;
143  
144 return $self->{'database'} = shift if @_;
145 return $self->{'database'};
146 }
147  
148 =head2 lowest_score
149  
150 Title : lowest_score
151 Usage : $obj->lowest_score($newval)
152 Function:
153 Example :
154 Returns : value of lowest_score (a scalar)
155 Args : on set, new value (a scalar or undef, optional)
156  
157  
158 =cut
159  
160 sub lowest_score{
161 my $self = shift;
162  
163 return $self->{'lowest_score'} = shift if @_;
164 return $self->{'lowest_score'};
165 }
166  
167 =head2 highest_score
168  
169 Title : highest_score
170 Usage : $obj->highest_score($newval)
171 Function:
172 Example :
173 Returns : value of highest_score (a scalar)
174 Args : on set, new value (a scalar or undef, optional)
175  
176  
177 =cut
178  
179 sub highest_score{
180 my $self = shift;
181  
182 return $self->{'highest_score'} = shift if @_;
183 return $self->{'highest_score'};
184 }
185  
186 =head2 lambda
187  
188 Title : lambda
189 Usage : $obj->lambda($newval)
190 Function:
191 Example :
192 Returns : value of lambda (a scalar)
193 Args : on set, new value (a scalar or undef, optional)
194  
195  
196 =cut
197  
198 sub lambda{
199 my $self = shift;
200  
201 return $self->{'lambda'} = shift if @_;
202 return $self->{'lambda'};
203 }
204  
205 =head2 H
206  
207 Title : H
208 Usage : $obj->H($newval)
209 Function:
210 Example :
211 Returns : value of H (a scalar)
212 Args : on set, new value (a scalar or undef, optional)
213  
214  
215 =cut
216  
217 sub H{
218 my $self = shift;
219 return $self->{'H'} = shift if @_;
220 return $self->{'H'};
221 }
222  
223  
224 1;
225  
226