Skip to content

Commit

Permalink
#531 less qulice suppressions
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Aug 5, 2022
1 parent a445864 commit 098c157
Show file tree
Hide file tree
Showing 52 changed files with 3 additions and 192 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mvn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, windows-2022, macos-12]
java: [11, 13]
java: [11, 17]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ SOFTWARE.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Duser.language=en -Duser.country=US</argLine>
<argLine>@{argLine} -Duser.language=en -Duser.country=US</argLine>
</configuration>
</plugin>
</plugins>
Expand All @@ -290,6 +290,7 @@ SOFTWARE.
<plugin>
<groupId>com.qulice</groupId>
<artifactId>qulice-maven-plugin</artifactId>
<version>0.21.1</version>
<configuration>
<excludes combine.children="append">
<exclude>checkstyle:/src/site/resources/.*</exclude>
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/jpeek/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.1
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
* @checkstyle ClassFanOutComplexityCheck (500 lines)
* @checkstyle ExecutableStatementCountCheck (500 lines)
* @checkstyle NPathComplexityCheck (500 lines)
* @checkstyle MagicNumberCheck (500 lines)
* @checkstyle CyclomaticComplexityCheck (500 lines)
* @checkstyle MethodLengthCheck (500 lines)
* @checkstyle JavaNCSSCheck (500 lines)
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/Header.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.8
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
public final class Header implements Iterable<Directive> {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/Index.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.6
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class Index implements Iterable<Directive> {

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/jpeek/Matrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.6
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class Matrix implements Iterable<Directive> {

Expand Down Expand Up @@ -141,10 +140,8 @@ private static int rank(final String color) {
if ("red".equals(color)) {
rank = 1;
} else if ("yellow".equals(color)) {
// @checkstyle MagicNumber (1 line)
rank = 3;
} else {
// @checkstyle MagicNumber (1 line)
rank = 5;
}
return rank;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/ReportWithStatistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.16
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class ReportWithStatistics implements XML {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.11
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
public final class Version implements Scalar<String> {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/XslReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.1
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class XslReport implements Report {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/graph/XmlGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
* ClassDataAbstractionCouplingCheck. The class probably needs to be split
* into smaller ones, perhaps extracting the maps into separate objects
* (extending MapEnvelopes), or maybe the list itself.
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
public final class XmlGraph implements Graph {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/skeleton/Classes.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
* @see <a href="http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricForOOD_ChidamberKemerer94.pdf">A packages suite for object oriented design</a>
* @since 0.27
* @checkstyle AbbreviationAsWordInNameCheck (5 lines)
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class Classes implements Iterable<CtClass> {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/skeleton/OpsOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
* @see <a href="http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricForOOD_ChidamberKemerer94.pdf">A packages suite for object oriented design</a>
* @since 0.27
* @checkstyle AbbreviationAsWordInNameCheck (5 lines)
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
* @checkstyle ParameterNumberCheck (500 lines)
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/skeleton/Skeleton.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
* @see <a href="http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricForOOD_ChidamberKemerer94.pdf">A packages suite for object oriented design</a>
* @since 0.23
* @checkstyle AbbreviationAsWordInNameCheck (5 lines)
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
public final class Skeleton {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/skeleton/TypesOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
* @see <a href="http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricForOOD_ChidamberKemerer94.pdf">A packages suite for object oriented design</a>
* @since 0.27
* @checkstyle AbbreviationAsWordInNameCheck (5 lines)
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class TypesOf extends SignatureVisitor implements Iterable<Directive> {

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/jpeek/skeleton/XmlClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@
* @see <a href="http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricForOOD_ChidamberKemerer94.pdf">A packages suite for object oriented design</a>
* @since 0.27
* @checkstyle AbbreviationAsWordInNameCheck (5 lines)
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
* @checkstyle ParameterNumberCheck (500 lines)
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
final class XmlClass extends ClassVisitor implements Iterable<Directive> {

/**
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/jpeek/web/AsyncReports.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.8
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
final class AsyncReports implements
BiFunc<String, String, Func<String, Response>> {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/web/DyNum.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.17
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class DyNum extends Number {

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/jpeek/web/Dynamo.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.14
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
final class Dynamo implements Region {

@Override
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/jpeek/web/Futures.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.8
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class Futures implements
BiFunc<String, String, Future<Func<String, Response>>>, Text {
Expand Down Expand Up @@ -85,7 +84,6 @@ final class Futures implements
Futures(final BiFunc<String, String, Func<String, Response>> func) {
this.origin = func;
this.service = Executors.newFixedThreadPool(
// @checkstyle MagicNumber (1 line)
Math.min(Runtime.getRuntime().availableProcessors(), 4),
new VerboseThreads(Futures.class)
);
Expand All @@ -99,7 +97,6 @@ public Future<Func<String, Response>> apply(final String group,
final String artifact) {
final String target = String.format("%s:%s", group, artifact);
this.queue.put(target, System.currentTimeMillis());
// @checkstyle MagicNumber (1 line)
if (this.times.size() > 1000) {
this.times.clear();
}
Expand Down Expand Up @@ -157,7 +154,6 @@ public String asString() throws Exception {
this.queue.size(),
Runtime.getRuntime().availableProcessors(),
Thread.getAllStackTraces().keySet().size(),
// @checkstyle MagicNumber (3 lines)
Runtime.getRuntime().freeMemory() / (1024L << 10),
Runtime.getRuntime().maxMemory() / (1024L << 10),
Runtime.getRuntime().totalMemory() / (1024L << 10),
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/jpeek/web/Mistakes.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.8
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
final class Mistakes {
Expand Down Expand Up @@ -120,7 +119,6 @@ public Iterable<Iterable<? extends Directive>> worst() throws IOException {
.withScanIndexForward(false)
.withIndexName("mistakes")
.withConsistentRead(false)
// @checkstyle MagicNumber (1 line)
.withLimit(20)
.withSelect(Select.ALL_ATTRIBUTES)
)
Expand Down Expand Up @@ -157,7 +155,6 @@ private void add(final String name, final double diff) throws IOException {
"ttl",
System.currentTimeMillis()
/ TimeUnit.SECONDS.toMillis(1L)
// @checkstyle MagicNumber (1 line)
+ TimeUnit.DAYS.toSeconds(100L)
)
.with("pos", 0L)
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/web/Pages.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.8
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class Pages implements Func<String, Response> {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/web/Reports.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
* {@link Futures}.
*
* @since 0.7
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class Reports implements BiFunc<String, String, Func<String, Response>> {

Expand Down
6 changes: 0 additions & 6 deletions src/main/java/org/jpeek/web/Results.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.8
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
final class Results {
Expand Down Expand Up @@ -110,7 +109,6 @@ public void add(final String artifact, final Path dir)
index.xpath("/index/@score").get(0)
).longValue();
final long rank = (long) ((double) score * (1.0d - diff.doubleValue()));
// @checkstyle MagicNumber (1 line)
if (elements < 100) {
Logger.info(
this, "%d elements NOT saved for %s by %s, rank=%d, score=%d, metrics=%d",
Expand Down Expand Up @@ -146,7 +144,6 @@ elements, artifact, new Version().value(), rank, score,
"ttl",
System.currentTimeMillis()
/ TimeUnit.SECONDS.toMillis(1L)
// @checkstyle MagicNumber (1 line)
+ TimeUnit.DAYS.toSeconds(100L)
)
);
Expand Down Expand Up @@ -205,7 +202,6 @@ public Iterable<Iterable<? extends Directive>> recent() {
.withScanIndexForward(false)
.withIndexName("recent")
.withConsistentRead(false)
// @checkstyle MagicNumber (1 line)
.withLimit(25)
.withAttributesToGet("artifact")
)
Expand Down Expand Up @@ -263,7 +259,6 @@ public Iterable<Iterable<? extends Directive>> all() {
)
.through(
new ScanValve()
// @checkstyle MagicNumber (1 line)
.withLimit(1000)
.withAttributeToGet(
"artifact", "classes", "defects", "version",
Expand Down Expand Up @@ -313,7 +308,6 @@ public Iterable<Iterable<Directive>> best() throws IOException {
.withScanIndexForward(false)
.withIndexName("ranks")
.withConsistentRead(false)
// @checkstyle MagicNumber (1 line)
.withLimit(20)
.withAttributesToGet(
"artifact", "score", "diff", "defects",
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/jpeek/web/RsPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.14
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class RsPage extends RsWrap {

Expand Down Expand Up @@ -79,7 +78,6 @@ final class RsPage extends RsWrap {
* @param src Sources
* @return Response
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
private static Response make(final Request req, final String xsl,
final Scalar<Iterable<XeSource>> src) {
final Response raw = new RsXembly(
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/org/jpeek/web/Sigmas.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.17
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
final class Sigmas {

/**
Expand Down Expand Up @@ -85,7 +83,6 @@ public void add(final Path dir) throws IOException {
final int classes = Integer.parseInt(
index.xpath("/index/metric[1]/classes/text()").get(0)
);
// @checkstyle MagicNumber (1 line)
if (defects < 0.15d && classes > 200) {
for (final XML metric : index.nodes("//metric")) {
this.add(metric);
Expand Down Expand Up @@ -118,7 +115,6 @@ private void add(final XML metric) throws IOException {
.with("version", new Version().value())
.with("artifact", "?")
.with("champions", 0L)
// @checkstyle MagicNumber (2 lines)
.with("mean", new DyNum(0.5d).longValue())
.with("sigma", new DyNum(0.1d).longValue())
);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/web/StickyFutures.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.8
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class StickyFutures
implements BiFunc<String, String, Future<Func<String, Response>>> {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jpeek/web/TkAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.17
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class TkAll implements Take {

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/jpeek/web/TkApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.5
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
* @checkstyle ClassFanOutComplexityCheck (500 lines)
*/
@SuppressWarnings("PMD.UseUtilityClass")
Expand Down Expand Up @@ -106,7 +105,6 @@ private static Take make(final Path home) throws IOException {
);
final BiFunc<String, String, Func<String, Response>> reports =
new AsyncReports(
// @checkstyle MagicNumber (1 line)
new StickyFutures(futures, 100)
);
return new TkSslOnly(
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/org/jpeek/web/TkIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
* <p>There is no thread-safety guarantee.
*
* @since 0.10
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
final class TkIndex implements Take {

Expand All @@ -52,7 +51,6 @@ public Response act(final Request req) {
new XeDirectives(
new Joined<>(
new HeadOf<>(
// @checkstyle MagicNumber (1 line)
20, new Results().best()
)
)
Expand All @@ -63,7 +61,6 @@ public Response act(final Request req) {
new XeDirectives(
new Joined<>(
new HeadOf<>(
// @checkstyle MagicNumber (1 line)
25, new Results().recent()
)
)
Expand Down
Loading

0 comments on commit 098c157

Please sign in to comment.