I am getting few false positive code smells | java:S125

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) - Enterprise EditionVersion 9.9.2 (build 77730)LGPL v3
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

I am getting java:S125 code smell and it is false positive, how can I get rid from it, basically how to get rid of these code smells which are adding to total count

          // Generate the schema for rows
            /*
             * Example:
             * If recordType = "positions", topic = "positionsTopic"
             * The generated schema for rows will be:
             *   "type Positions {
This block of commented-out lines of code should be removed.
             *       FIELD1: FieldType1
             *       FIELD2: FieldType2
             *       ...
             *    }"
             */
            rowsSchema.append("type ").append(recordTypeObject).append(" {\n");

Hi,

Welcome to the community!

This particular rule works on a heuristic, which is necessarily a bit loose. To the rule (and at a quick glance), most of this looks exactly like code.

Your best bet is just to mark this instance False Positive. Or if you’re getting to many of these, you may just want to disable the rule.

 
HTH,
Ann