Exception.java
biz/hammurapi/Exception.java
Violations
Inspector |
Message |
Severity |
Location |
Java Inspector 048 |
Copyrights information should be present in each file. |
1 |
|
Java Inspector 086 |
Use equals() instead of == or != to compare objects. |
1 |
56:70
|
Java Inspector 015 |
Do not change parameter value. For comprehensibility, formal parameters should be final |
2 |
57:25
|
Java Inspector 089 |
Undocumented constructor |
2 |
37:9
|
Java Inspector 089 |
Undocumented constructor |
2 |
41:9
|
Java Inspector 089 |
Undocumented constructor |
2 |
45:9
|
Java Inspector 089 |
Undocumented constructor |
2 |
50:9
|
Java Inspector 026 |
Avoid hardwired string literals. Allowed literals: [] |
3 |
59:38
|
Java Inspector 026 |
Avoid hardwired string literals. Allowed literals: [] |
3 |
59:43
|
Metrics
Name |
Measurements |
Total |
Min |
Avg |
Max |
Deviation |
Code length |
5 |
10.0 |
1.0 |
2.0 |
4.0 |
0.6333333333333334 |
Cyclomatic complexity |
5 |
7.0 |
1.0 |
1.4 |
3.0 |
0.32 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23package biz.hammurapi;
24
25
26
27
28
29
30public class Exception extends java.lang.Exception {
31
32
33
34
35 private static final long serialVersionUID = 9056009202942745656L;
36
37 public Exception() {
38 super();
39 }
40
41 public Exception(String message) {
42 super(message);
43 }
44
45 public Exception(String message, Throwable cause) {
46
47 super(message+rootCause(cause), cause);
48 }
49
50 public Exception(Throwable cause) {
51
52 super(rootCause(cause), cause);
53 }
54
55 static String rootCause(Throwable cause) {
56 while (cause!=null && cause.getCause()!=null && cause!=cause.getCause()) {
57 cause=cause.getCause();
58 }
59 return cause==null ? "" : "\nRoot cause: "+cause.toString();
60 }
61}
62