I'm new to SonarQube and Squid (and CheckStyle and FindBugs and PMD). I'm using SonarQube 4.1.1. and the default 'Sonar way with Findbugs' quality profile to evaluate some of my Java projects.
In the result of my analysis I get a ton of the same critical issue from Squid:
Exception handlers should provide some context and preserve the original exception When handling a caught exception, two mandatory informations should be either logged, or present in a rethrown exception:
- Some context to ease the reproduction of the issue.
- The original's exception, for its message and stack trace.
In my code I use a logger, e.g.
catch(Exception e) {
LOG.error(SampleClass.class.getSimpleName() + ": " + e);
}
Why is this rule fired? The exception is logged. Is it, because I don't use a 'Logger' but a 'Log'?
A second question I have is: Where can I see and change the Squid rules and maybe add a couple of my own? As far as I understand FindBug, CheckStyle and PMD I can write my own rules. Is this possible with Squid too?