In an enterprise application, we have a large code base and sometimes, we need to temporarily restrict some methods or calls from executing, and we generally comment on the code. But, when we try to deploy the code, the Jenkins pipeline (if SonarQube is configured) may fail while scanning for code quality checks. We may see errors stating “Remove this comment on code”.
We can resolve this code smell using // NOSONAR: evictCache(companyId). The SonarQube will skip the scanning for code that is commented with the // NOSONAR tag.