Date | 2007/07/27 |
---|---|
Codebase | 4216 |
Reviews | 7696 |
DPMO | 1821 |
Sigma | 4.407 |
Name | Number | Min | Avg | Max | Total |
---|---|---|---|---|---|
Class complexity | 1 | 84.00 | 84.00 | 84.00 | 84.00 |
Code length | 56 | 0.00 | 5.16 | 68.00 | 289.00 |
File length | 1 | 400.00 | 400.00 | 400.00 | 400.00 |
Operation complexity | 55 | 1.00 | 2.18 | 20.00 | 120.00 |
Work order | 1 | 2.66 | 2.66 | 2.66 | 2.66 |
# | Line | Column | Name | Severity | Description |
---|---|---|---|---|---|
1 | 23 | 1 | ER-023 | 3 | Packages should begin with [] |
2 | 65 | 144 | ER-036 | 3 | Line is too long |
3 | 111 | 91 | ER-036 | 3 | Line is too long |
4 | 113 | 143 | ER-036 | 3 | Line is too long |
5 | 114 | 81 | ER-036 | 3 | Line is too long |
6 | 123 | 88 | ER-036 | 3 | Line is too long |
7 | 124 | 91 | ER-036 | 3 | Line is too long |
8 | 127 | 84 | ER-036 | 3 | Line is too long |
9 | 131 | 88 | ER-036 | 3 | Line is too long |
10 | 132 | 96 | ER-036 | 3 | Line is too long |
11 | 135 | 81 | ER-036 | 3 | Line is too long |
12 | 136 | 84 | ER-036 | 3 | Line is too long |
13 | 139 | 84 | ER-036 | 3 | Line is too long |
14 | 143 | 85 | ER-036 | 3 | Line is too long |
15 | 144 | 101 | ER-036 | 3 | Line is too long |
16 | 147 | 87 | ER-036 | 3 | Line is too long |
17 | 148 | 90 | ER-036 | 3 | Line is too long |
18 | 151 | 96 | ER-036 | 3 | Line is too long |
19 | 155 | 88 | ER-036 | 3 | Line is too long |
20 | 156 | 100 | ER-036 | 3 | Line is too long |
21 | 157 | 136 | ER-036 | 3 | Line is too long |
22 | 158 | 101 | ER-036 | 3 | Line is too long |
23 | 159 | 113 | ER-036 | 3 | Line is too long |
24 | 161 | 108 | ER-036 | 3 | Line is too long |
25 | 175 | 82 | ER-036 | 3 | Line is too long |
26 | 184 | 84 | ER-036 | 3 | Line is too long |
27 | 185 | 106 | ER-036 | 3 | Line is too long |
28 | 188 | 80 | ER-036 | 3 | Line is too long |
29 | 191 | 133 | ER-036 | 3 | Line is too long |
30 | 192 | 92 | ER-036 | 3 | Line is too long |
31 | 193 | 100 | ER-036 | 3 | Line is too long |
32 | 194 | 101 | ER-036 | 3 | Line is too long |
33 | 195 | 92 | ER-036 | 3 | Line is too long |
34 | 198 | 112 | ER-036 | 3 | Line is too long |
35 | 209 | 84 | ER-036 | 3 | Line is too long |
36 | 210 | 82 | ER-036 | 3 | Line is too long |
37 | 211 | 118 | ER-036 | 3 | Line is too long |
38 | 212 | 113 | ER-036 | 3 | Line is too long |
39 | 214 | 130 | ER-036 | 3 | Line is too long |
40 | 215 | 125 | ER-036 | 3 | Line is too long |
41 | 216 | 86 | ER-036 | 3 | Line is too long |
42 | 217 | 105 | ER-036 | 3 | Line is too long |
43 | 218 | 116 | ER-036 | 3 | Line is too long |
44 | 219 | 80 | ER-036 | 3 | Line is too long |
45 | 220 | 107 | ER-036 | 3 | Line is too long |
46 | 221 | 98 | ER-036 | 3 | Line is too long |
47 | 222 | 88 | ER-036 | 3 | Line is too long |
48 | 223 | 142 | ER-036 | 3 | Line is too long |
49 | 224 | 81 | ER-036 | 3 | Line is too long |
50 | 227 | 94 | ER-036 | 3 | Line is too long |
51 | 230 | 82 | ER-036 | 3 | Line is too long |
52 | 260 | 88 | ER-036 | 3 | Line is too long |
53 | 262 | 85 | ER-036 | 3 | Line is too long |
54 | 265 | 86 | ER-036 | 3 | Line is too long |
55 | 267 | 80 | ER-036 | 3 | Line is too long |
56 | 268 | 102 | ER-036 | 3 | Line is too long |
57 | 271 | 80 | ER-036 | 3 | Line is too long |
58 | 272 | 92 | ER-036 | 3 | Line is too long |
59 | 275 | 80 | ER-036 | 3 | Line is too long |
60 | 276 | 92 | ER-036 | 3 | Line is too long |
61 | 279 | 80 | ER-036 | 3 | Line is too long |
62 | 280 | 120 | ER-036 | 3 | Line is too long |
63 | 283 | 82 | ER-036 | 3 | Line is too long |
64 | 284 | 95 | ER-036 | 3 | Line is too long |
65 | 287 | 98 | ER-036 | 3 | Line is too long |
66 | 288 | 106 | ER-036 | 3 | Line is too long |
67 | 291 | 112 | ER-036 | 3 | Line is too long |
68 | 292 | 106 | ER-036 | 3 | Line is too long |
69 | 295 | 93 | ER-036 | 3 | Line is too long |
70 | 299 | 81 | ER-036 | 3 | Line is too long |
71 | 300 | 88 | ER-036 | 3 | Line is too long |
72 | 358 | 186 | ER-036 | 3 | Line is too long |
73 | 371 | 214 | ER-036 | 3 | Line is too long |
74 | 397 | 86 | ER-036 | 3 | Line is too long |
75 | 53 | 1 | ER-049 | 2 | Unify logging strategy - define individual logger for class |
76 | 65 | 9 | ER-109 | 3 | It is good practice to call in any case super() in a constructor. (see also: UnnecessaryConstructorRule ) |
77 | 75 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
78 | 79 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
79 | 83 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
80 | 89 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
81 | 93 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
82 | 97 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
83 | 101 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
84 | 107 | 9 | ER-011 | 1 | Cyclomatic complexity (15) exceeds 12 |
85 | 107 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
86 | 123 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
87 | 127 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
88 | 131 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
89 | 132 | 72 | ER-079 | 2 | Avoid casting primitive data types to lower precision |
90 | 135 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
91 | 139 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
92 | 140 | 72 | ER-030 | 3 | Avoid hardwired string literals |
93 | 143 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
94 | 147 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
95 | 151 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
96 | 155 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
97 | 172 | 9 | ER-011 | 1 | Cyclomatic complexity (20) exceeds 12 |
98 | 172 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
99 | 180 | 41 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
100 | 184 | 41 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
101 | 202 | 41 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
102 | 206 | 41 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
103 | 243 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
104 | 247 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
105 | 251 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
106 | 251 | 65 | ER-048 | 1 | Use BigDecimal instead of Float or Double for monetary values |
107 | 257 | 9 | ER-011 | 1 | Cyclomatic complexity (13) exceeds 12 |
108 | 257 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
109 | 267 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
110 | 268 | 72 | ER-079 | 2 | Avoid casting primitive data types to lower precision |
111 | 271 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
112 | 271 | 64 | ER-048 | 1 | Use BigDecimal instead of Float or Double for monetary values |
113 | 275 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
114 | 275 | 64 | ER-048 | 1 | Use BigDecimal instead of Float or Double for monetary values |
115 | 279 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
116 | 279 | 64 | ER-048 | 1 | Use BigDecimal instead of Float or Double for monetary values |
117 | 283 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
118 | 283 | 64 | ER-048 | 1 | Use BigDecimal instead of Float or Double for monetary values |
119 | 287 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
120 | 287 | 73 | ER-048 | 1 | Use BigDecimal instead of Float or Double for monetary values |
121 | 291 | 96 | ER-082 | 3 | Avoid using method parameter names that conflict with class member names |
122 | 291 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
123 | 295 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
124 | 299 | 57 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
125 | 303 | 29 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
126 | 303 | 36 | ER-048 | 1 | Use BigDecimal instead of Float or Double for monetary values |
127 | 314 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
128 | 318 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
129 | 322 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
130 | 326 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
131 | 330 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
132 | 334 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
133 | 338 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
134 | 342 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
135 | 346 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
136 | 350 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
137 | 354 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
138 | 356 | 32 | ER-030 | 3 | Avoid hardwired string literals |
139 | 358 | 47 | ER-079 | 2 | Avoid casting primitive data types to lower precision |
140 | 358 | 54 | ER-029 | 3 | Avoid hardwired numeric literals |
141 | 358 | 143 | ER-030 | 3 | Avoid hardwired string literals |
142 | 358 | 183 | ER-030 | 3 | Avoid hardwired string literals |
143 | 362 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
144 | 363 | 17 | ER-048 | 1 | Use BigDecimal instead of Float or Double for monetary values |
145 | 365 | 32 | ER-030 | 3 | Avoid hardwired string literals |
146 | 367 | 32 | ER-030 | 3 | Avoid hardwired string literals |
147 | 369 | 32 | ER-030 | 3 | Avoid hardwired string literals |
148 | 371 | 53 | ER-030 | 3 | Avoid hardwired string literals |
149 | 371 | 134 | ER-029 | 3 | Avoid hardwired numeric literals |
150 | 371 | 171 | ER-030 | 3 | Avoid hardwired string literals |
151 | 371 | 211 | ER-030 | 3 | Avoid hardwired string literals |
152 | 375 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
153 | 379 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
154 | 383 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
155 | 383 | 16 | ER-048 | 1 | Use BigDecimal instead of Float or Double for monetary values |
156 | 387 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
157 | 388 | 24 | ER-079 | 2 | Avoid casting primitive data types to lower precision |
158 | 391 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
159 | 392 | 24 | ER-079 | 2 | Avoid casting primitive data types to lower precision |
160 | 395 | 9 | ER-105 | 3 | Document all Interfaces and public methods. Use a Class header. Provide Javadoc |
1/*
2 * Hammurapi
3 * Automated Java code review system.
4 * Copyright (C) 2004 Hammurapi Group
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * URL: http://www.hammurapi.org
21 * e-Mail: support@hammurapi.biz
22 */
23package org.hammurapi;
24
25import java.sql.SQLException;
26import java.sql.Timestamp;
27import java.text.MessageFormat;
28import java.util.ArrayList;
29import java.util.Collection;
30import java.util.Date;
31import java.util.Iterator;
32import java.util.List;
33import java.util.Map;
34import java.util.TreeMap;
35
36import org.hammurapi.results.AggregatedResults;
37import org.hammurapi.results.Annotation;
38import org.hammurapi.results.BasicResults;
39import org.hammurapi.results.CompositeResults;
40import org.hammurapi.results.InspectorSummary;
41import org.hammurapi.results.quick.MetricSummary;
42import org.hammurapi.results.quick.Summary;
43import org.hammurapi.results.quick.Warning;
44import org.hammurapi.results.simple.SimpleAggregatedResults;
45
46import com.pavelvlasov.review.SimpleSourceMarker;
47import com.pavelvlasov.review.SourceMarker;
48
49/**
50 * @author Pavel Vlasov
51 * @version $Revision: 1.6 $
52 */
53public class QuickSummary implements CompositeResults {
54
55 private Summary summary;
56 private QuickResultsCollector collector;
57 private InspectorSet inspectorSet;
58 private String title;
59
60 /**
61 * @param total
62 * @param collector
63 * @throws SQLException
64 */
65 public QuickSummary(String title, QuickResultsCollector collector, InspectorSet inspectorSet, Collection children) throws SQLException {
66 this.collector=collector;
67 this.inspectorSet=inspectorSet;
68 this.summary=collector.getEngine().getSummary();
69 this.children=children;
70 this.title=title;
71 }
72
73 private Collection children;
74
75 public Collection getChildren() {
76 return children;
77 }
78
79 public void add(AggregatedResults child) {
80 throw new UnsupportedOperationException();
81 }
82
83 public int size() {
84 return summary.getResultSize();
85 }
86
87 private Collection violations=new ArrayList();
88
89 public Collection getViolations() {
90 return violations;
91 }
92
93 public Collection getWaivedViolations() {
94 return violations;
95 }
96
97 public String getName() {
98 return title;
99 }
100
101 public Waiver addViolation(Violation violation) {
102 throw new UnsupportedOperationException();
103 }
104
105 private Map severitySummary;
106
107 public Map getSeveritySummary() {
108 if (severitySummary==null) {
109 severitySummary=new TreeMap();
110
111 Iterator it=collector.getEngine().getInspectorSummary().iterator();
112 while (it.hasNext()) {
113 final org.hammurapi.results.quick.InspectorSummary ps=(org.hammurapi.results.quick.InspectorSummary) it.next();
114 Integer severity = new Integer(ps.getSeverity());
115 Map imap=(Map) severitySummary.get(severity);
116 if (imap==null) {
117 imap=new TreeMap();
118 severitySummary.put(severity, imap);
119 }
120 imap.put(ps.getName(),
121 new InspectorSummary() {
122
123 public String getDescription() {
124 return ps.getDescription();
125 }
126
127 public List getLocations() {
128 return null;
129 }
130
131 public int getLocationsCount() {
132 return (int) ps.getViolations();
133 }
134
135 public String getName() {
136 return ps.getName();
137 }
138
139 public String getVersion() {
140 return "";
141 }
142
143 public Number getSeverity() {
144 return new Integer(ps.getSeverity());
145 }
146
147 public String getConfigInfo() {
148 return ps.getConfigInfo();
149 }
150
151 public int getBaseLineLocationsCount() {
152 return -1;
153 }
154
155 public int compareTo(Object o) {
156 if (o instanceof InspectorSummary) {
157 return ps.getName().compareTo(((InspectorSummary) o).getName());
158 } else if (o instanceof Comparable) {
159 return -((Comparable) o).compareTo(this);
160 } else {
161 return this.hashCode()-o.hashCode();
162 }
163 }
164 });
165 }
166 }
167 return severitySummary;
168 }
169
170 private Collection warnings;
171
172 public Collection getWarnings() {
173 if (warnings==null) {
174 warnings=new ArrayList();
175 Iterator it=collector.getEngine().getWarning().iterator();
176 while (it.hasNext()) {
177 final Warning warning=(Warning) it.next();
178 warnings.add(new Violation() {
179
180 public String getMessage() {
181 return warning.getMessage();
182 }
183
184 public InspectorDescriptor getDescriptor() {
185 return inspectorSet.getDescriptor(warning.getInspector());
186 }
187
188 private SimpleSourceMarker sourceMarker;
189
190 {
191 if (warning.getSource()!=null && warning.getLine()!=null && warning.getCol()!=null) {
192 sourceMarker=new SimpleSourceMarker(
193 warning.getCol().intValue(),
194 warning.getLine().intValue(),
195 warning.getSource(),
196 null);
197
198 sourceMarker.setSignature(warning.getSourceSignature());
199 }
200 }
201
202 public SourceMarker getSource() {
203 return sourceMarker;
204 }
205
206 public int compareTo(Object o) {
207 if (o==this) {
208 return 0;
209 } else if (o instanceof Violation) {
210 Violation v=(Violation) o;
211 int vline = v.getSource()==null ? 0 : v.getSource().getLine();
212 int line = getSource()==null ? 0 : getSource().getLine();
213 if (vline==line) {
214 int vcolumn = v.getSource()==null ? 0 : v.getSource().getColumn();
215 int column = getSource()==null ? 0 : getSource().getColumn();
216 if (vcolumn==column) {
217 if (warning.getMessage()==null) {
218 return v.getMessage()==null ? 0 : 1;
219 } else {
220 if (v.getMessage()==null) {
221 return -1;
222 } else {
223 return warning.getMessage().compareTo(v.getMessage());
224 }
225 }
226 } else {
227 return column-vcolumn;
228 }
229 } else {
230 return line-vline;
231 }
232 } else {
233 return 1;
234 }
235 }
236
237 });
238 }
239 }
240 return warnings;
241 }
242
243 public boolean hasWarnings() {
244 return summary.getHasWarnings();
245 }
246
247 public void addWarning(Violation warning) {
248 throw new UnsupportedOperationException();
249 }
250
251 public void addMetric(SourceMarker source, String name, double value) {
252 throw new UnsupportedOperationException();
253 }
254
255 private Map metrics;
256
257 public Map getMetrics() {
258 if (metrics==null) {
259 metrics=new TreeMap();
260 Iterator it=collector.getEngine().getMetricSummary().iterator();
261 while (it.hasNext()) {
262 final MetricSummary metric=(MetricSummary) it.next();
263 metrics.put(
264 metric.getName(),
265 new com.pavelvlasov.metrics.Metric() {
266
267 public int getNumber() {
268 return (int) metric.getMeasurements();
269 }
270
271 public double getMin() {
272 return metric.getMinValue();
273 }
274
275 public double getMax() {
276 return metric.getMaxValue();
277 }
278
279 public double getAvg() {
280 return metric.getMetricTotal()/metric.getMeasurements();
281 }
282
283 public double getTotal() {
284 return metric.getMetricTotal();
285 }
286
287 public void add(double value, long time) {
288 throw new UnsupportedOperationException();
289 }
290
291 public void add(com.pavelvlasov.metrics.Metric metric) {
292 throw new UnsupportedOperationException();
293 }
294
295 public Collection getMeasurements() {
296 return null;
297 }
298
299 public String getName() {
300 return metric.getName();
301 }
302
303 public double getDeviation() {
304 // TODO - Calcualte deviation
305 return 0;
306 }
307
308 });
309 }
310 }
311 return metrics;
312 }
313
314 public void aggregate(AggregatedResults agregee) {
315 throw new UnsupportedOperationException();
316 }
317
318 public void setReviewsNumber(long reviews) {
319 throw new UnsupportedOperationException();
320 }
321
322 public void setCodeBase(long codeBase) {
323 throw new UnsupportedOperationException();
324 }
325
326 public void addAnnotation(Annotation annotation) {
327 throw new UnsupportedOperationException();
328 }
329
330 public Collection getAnnotations() {
331 return violations;
332 }
333
334 public WaiverSet getWaiverSet() {
335 throw new UnsupportedOperationException();
336 }
337
338 public void commit() {
339 // No action is required
340 }
341
342 public boolean isNew() {
343 return summary.getMinState()==QuickResultsCollector.RESULT_NEW;
344 }
345
346 public BasicResults getBaseLine() {
347 return null;
348 }
349
350 public long getCodeBase() {
351 return summary.getCodebase();
352 }
353
354 public String getDPMO() {
355 if (summary.getReviews()==0) {
356 return "Not available, no reviews";
357 } else {
358 return String.valueOf((int) (1000000*summary.getViolationLevel()/summary.getReviews())) + (summary.getHasWarnings() ? " (not accurate because of warnings)" : "");
359 }
360 }
361
362 public String getSigma() {
363 double p=1.0-summary.getViolationLevel()/summary.getReviews();
364 if (summary.getReviews()==0) {
365 return "No results";
366 } else if (p<=0) {
367 return "Full incompliance";
368 } else if (p>=1) {
369 return "Full compliance";
370 } else {
371 return MessageFormat.format("{0,number,#.###}", new Object[] {new Double(SimpleAggregatedResults.normsinv(p)+1.5)}) + (summary.getHasWarnings() ? " (not accurate because of warnings)" : "");
372 }
373 }
374
375 public Number getMaxSeverity() {
376 return summary.getMaxSeverity();
377 }
378
379 public long getReviewsNumber() {
380 return summary.getReviews();
381 }
382
383 public double getViolationLevel() {
384 return summary.getViolationLevel();
385 }
386
387 public int getViolationsNumber() {
388 return (int) summary.getViolations();
389 }
390
391 public int getWaivedViolationsNumber() {
392 return (int) summary.getWaivedViolations();
393 }
394
395 public Date getDate() {
396 Timestamp resultDate = summary.getResultDate();
397 return resultDate==null ? new Date() : new Date(resultDate.getTime());
398 }
399}
400
401