Thanks for your message. I’m not sure I have enough data to reproduce your issue. In the configuration of the analysis, we distinguish between “main” sources and “test” sources. This rule triggers if it finds the invocation of assert methods in the “main” code.
Could you please share with me the configuration of your analysis and the project structure? For some reason, this file was recognized as the “main” code. I’m interested in the values of the properties “sonar.sources” and “sonar.tests”.
As a side note, if you’re using Gradle or Maven we suggest using scanners for Gradle or Maven respectively. This will help you avoid such problems.
And which build tool are you using? For Maven and Gradle, if you’re using corresponding plugins, you should have these properties automatically populated.