codeclimate/sonar-wrapper

View on GitHub
src/main/java/cc/report/JsonReport.java

Summary

Maintainability
A
35 mins
Test Coverage

Method execute has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public void execute(String projectName, Date date, Collection<Trackable> trackables, AnalysisResults result, Function<String, RuleDetails> ruleDescriptionProducer) {
Severity: Minor
Found in src/main/java/cc/report/JsonReport.java - About 35 mins to fix

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

                    System.out.println(gson.toJson(codeClimateIssue) + "\0");

    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

    There are no issues that match your filters.

    Category
    Status