I’m using SQ 7.3. In general, I agree with the No Magic Numbers rule (S109), but I’m not convinced it’s helpful in Unit Tests where literals are likely more readable than constants. Is there a way to disable a rule like this for a given source path (e.g. rule is enabled for src/main/java and disabled for src/test/java)?
I know we could use
//SONAR for each one, but that’s potentially a lot of work.
See this discussion where the top two answers seem to agree: