Skip to content

Commit 386912e

Browse files
committedDec 5, 2018
For #884: Review corrections.
1 parent a0881bf commit 386912e

File tree

2 files changed

+1
-63
lines changed

2 files changed

+1
-63
lines changed
 

‎qulice-spotbugs/pom.xml

-9
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,6 @@
4848
<artifactId>qulice-spi</artifactId>
4949
<version>${project.version}</version>
5050
</dependency>
51-
<dependency>
52-
<groupId>org.cactoos</groupId>
53-
<artifactId>cactoos</artifactId>
54-
<version>0.38</version>
55-
</dependency>
56-
<dependency>
57-
<groupId>com.jcabi</groupId>
58-
<artifactId>jcabi-log</artifactId>
59-
</dependency>
6051
<dependency>
6152
<groupId>junit</groupId>
6253
<artifactId>junit</artifactId>

‎qulice-spotbugs/src/main/java/com/qulice/spotbugs/SpotBugsValidator.java

+1-54
Original file line numberDiff line numberDiff line change
@@ -29,78 +29,25 @@
2929
*/
3030
package com.qulice.spotbugs;
3131

32-
import com.jcabi.log.Logger;
3332
import com.qulice.spi.Environment;
3433
import com.qulice.spi.ValidationException;
3534
import com.qulice.spi.Validator;
36-
import java.util.Collection;
37-
import java.util.LinkedList;
3835

3936
/**
4037
* Validates source code and compiled binaries with SpotBugs.
4138
*
4239
* @since 0.19
4340
*/
44-
@SuppressWarnings({"PMD.ExcessiveImports", "PMD.AvoidDuplicateLiterals"})
4541
public final class SpotBugsValidator implements Validator {
4642

4743
@Override
4844
public void validate(final Environment env) throws ValidationException {
49-
if (env.outdir().exists()) {
50-
if (!env.exclude("spotbugs", "")) {
51-
this.check(SpotBugsValidator.spotbugs(env));
52-
}
53-
} else {
54-
Logger.info(
55-
this,
56-
"No classes at %s, no SpotBugs validation",
57-
env.outdir()
58-
);
59-
}
45+
throw new UnsupportedOperationException("validate not implemented");
6046
}
6147

6248
@Override
6349
public String name() {
6450
return "SpotBugs";
6551
}
6652

67-
/**
68-
* Start spotbugs and return its output.
69-
* @param env Environment
70-
* @return Output of spotbugs
71-
*/
72-
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
73-
private static String spotbugs(final Environment env) {
74-
throw new UnsupportedOperationException("spotbugs not implemented");
75-
}
76-
77-
/**
78-
* Java options.
79-
* @return Options
80-
*/
81-
private static Collection<String> options() {
82-
return new LinkedList<>();
83-
}
84-
85-
/**
86-
* Check report for errors.
87-
* @param report The report
88-
* @throws ValidationException If it contains errors
89-
*/
90-
private void check(final String report) throws ValidationException {
91-
int total = 0;
92-
for (final String line
93-
: report.split(System.getProperty("line.separator"))) {
94-
if (line.matches("[a-zA-Z ]+: .*")) {
95-
Logger.warn(this, "SpotBugs: %s", line);
96-
++total;
97-
}
98-
}
99-
if (total > 0) {
100-
throw new ValidationException(
101-
"%d SpotBugs violations (see log above)",
102-
total
103-
);
104-
}
105-
}
10653
}

0 commit comments

Comments
 (0)
Please sign in to comment.