Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add number of violations reported by Sonar to the stats output #678

Open
khaes-kth opened this issue Dec 10, 2021 · 0 comments
Open

Add number of violations reported by Sonar to the stats output #678

khaes-kth opened this issue Dec 10, 2021 · 0 comments
Labels
good first issue Good for newcomers

Comments

@khaes-kth
Copy link
Collaborator

Currently, if Sorald does not fix any violations, we do not report the total number of violations. We can add an attribute to the json file to note how many violations are detected by Sonar.

For example, the following stats file does not show how many violations exist in the code:

{
    "repairs": [],
    "executionInfo": {
        "soraldVersion": "LOCAL",
        "javaVersion": "11.0.11",
        "originalArgs": [
            "repair",
            "--source",
            "zendesk-java-client",
            "--rule-key",
            "2272",
            "--stats-output-file",
            "output-2021-12-10-15-02-12/zendesk-java-client_2272_sorald_repair_stats.json"
        ]
    },
    "totalTimeMs": 24897,
    "repairTimeMs": 0,
    "startTimeMs": 1639149077672,
    "crashes": [],
    "endTimeMs": 1639149102569,
    "parseTimeMs": 0
}

Adding a sonarDetectedViolations at the root level should solve this.

@khaes-kth khaes-kth added the good first issue Good for newcomers label Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Development

No branches or pull requests

1 participant