forked from pica/ruby-sonar-plugin
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathCaneLineStyleViolation.java
More file actions
49 lines (39 loc) · 1.19 KB
/
CaneLineStyleViolation.java
File metadata and controls
49 lines (39 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.godaddy.sonar.ruby.metricfu;
public class CaneLineStyleViolation extends CaneViolation {
private int line;
private String description;
private String key = "UnknownViolation";
public CaneLineStyleViolation(String file, int line, String description) {
super(file);
setLine(line);
setDescription(description);
}
public CaneLineStyleViolation() {
}
public String getKey() {
return key;
}
public int getLine() {
return line;
}
public void setLine(int line) {
this.line = line;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
if (description.contains("tabs")) {
key = "LineStyleTabsViolation";
} else if (description.contains("whitespace")) {
key = "LineStyleWhitespaceViolation";
} else if (description.contains("characters")) {
key = "LineStyleLengthViolation";
}
}
@Override
public String toString() {
return "file: " + getFile() + " line: " + line + " description: " + description;
}
}