nlpub/watset-java

View on GitHub
examples/PickleClustering.java

Summary

Maintainability
A
0 mins
Test Coverage

Replace this use of System.out or System.err by a logger.
Open

            System.out.print("Chinese Whispers: ");
Severity: Major
Found in examples/PickleClustering.java by sonar-java

When logging a message there are several important requirements which must be fulfilled:

  • The user must be able to easily retrieve the logs
  • The format of all logged message must be uniform to allow the user to easily read the log
  • Logged data must actually be recorded
  • Sensitive data must only be logged securely

If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a dedicated logger is highly recommended.

Noncompliant Code Example

System.out.println("My Message");  // Noncompliant

Compliant Solution

logger.log("My Message");

See

Replace this use of System.out or System.err by a logger.
Open

            System.out.println(cw.getClustering());
Severity: Major
Found in examples/PickleClustering.java by sonar-java

When logging a message there are several important requirements which must be fulfilled:

  • The user must be able to easily retrieve the logs
  • The format of all logged message must be uniform to allow the user to easily read the log
  • Logged data must actually be recorded
  • Sensitive data must only be logged securely

If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a dedicated logger is highly recommended.

Noncompliant Code Example

System.out.println("My Message");  // Noncompliant

Compliant Solution

logger.log("My Message");

See

This block of commented-out lines of code should be removed.
Open

 * Licensed under the Apache License, Version 2.0 (the "License");
Severity: Major
Found in examples/PickleClustering.java by sonar-java

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

Wrong lexicographical order for 'java.io.IOException' import. Should be before 'org.nlpub.watset.util.NetworkXFormat'.
Open

import java.io.IOException;
Severity: Minor
Found in examples/PickleClustering.java by checkstyle

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Wrong lexicographical order for 'java.nio.file.Files' import. Should be before 'org.nlpub.watset.util.NetworkXFormat'.
Open

import java.nio.file.Files;
Severity: Minor
Found in examples/PickleClustering.java by checkstyle

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Extra separation in import group before 'java.io.IOException'
Open

import java.io.IOException;
Severity: Minor
Found in examples/PickleClustering.java by checkstyle

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Wrong lexicographical order for 'java.nio.file.Paths' import. Should be before 'org.nlpub.watset.util.NetworkXFormat'.
Open

import java.nio.file.Paths;
Severity: Minor
Found in examples/PickleClustering.java by checkstyle

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

There are no issues that match your filters.

Category
Status