How to fix | Remove this commented out code in SonarQube

By | February 23, 2025

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.

Leave a Reply

Your email address will not be published. Required fields are marked *