S2699 Custom Configuration

Hi,
Trying to configure JGiven to be ignored skipped/marked as fixed for S2699.
I cannot get it fixed. Please help me, thx
Using

  • Community Edition
  • Version 7.9.1 (build 27448)
    “Java Code Quality and Security” - latest version


Java Code Quality and Security
Code Analyzer for Java

  • 6.3 (build 21585)installed

Hello,

The input you entered looks good to me.
I can see two reasons it is not correctly supported:

  • The quality profile “MMU QP” is not the one used during analysis.
    Can you check that it is indeed the default one for Java?
  • The project is not well configured.
    It can result in missing semantics, and less precise results.
    Do you see anything suspicious in the logs? Are you using the scanner for maven?
1 Like

MMU QP is used during the analysis as I temporarily disabled S2699 rule and at the moment its not taken in consideration in further analysis.
Yes we use sonar:sonar from Jenkins.
“Do you see anything suspicious in the logs?” -are we taking about server sonarqube logs, or logs of the maven analysis itself?

I also tried: com.tngtech.jgiven.junit.ScenarioTest#then*, com.tngtech.jgiven.junit.ScenarioTest#then
But nothing changed

MMU QP is used during the analysis as I temporarily disabled S2699 rule and at the moment its not taken in consideration in further analysis.

Good, we can remove this possibility from the list.

are we taking about server sonarqube logs, or logs of the maven analysis itself?

Maven analysis logs.
They should contain a warning if the input parameter is not well formatted.
And potentially another one if the project is missing an important configuration.

By coming back at your problem, I realized that, since you are using maven scanner, a miss-configuration is unlikely to happen.

So I ended up trying by myself and managed to reproduce the problem.
It turns out that the parameter was indeed well formatted, but… not the good one. In fact, then() is defined in ScenarioTestBase. Changing the parameters to com.tngtech.jgiven.base.ScenarioTestBase#then* will do the trick!

1 Like

Thank you,
I will try your suggestion.
It would be nice to update the documentation of the rule and specify that wildcards configuration are sensitive to inheritance