The addDescriptionSection() method of the security hotspot type rule is invalid

I am developing the SonarQube plug-in and operating according to plug-in example. My version of SonarQube is 9.9.0.65466 and the API version I use is 9.14.0.375.

I found that for the NewRule instance, after calling the addDescriptionSection() method and calling the setType (RuleType. SECURITY_HOTSPOT) method, the corresponding Description Section cannot be generated for the rule, but when I modify it to setType (RuleType. CODE_SMELL), all Description Sections can be created normally.

Please confirm whether this is a problem. Thanks.

Hello @Dog_Kz,

Thanks for your post.

Do you mean that the description section is not rendered in the GUI? If yes, can you let me know which section key you are using for the section?

Hello @aurelien.poscia ,
I attached pictures to describe my problem in detail:

Normal condition

When I use the following code to create a rule, set the type to “CODE_SMELL”:

All corresponding fragments are displayed on the final GUI:

Abnormal conditions

When I only change the type to “SECURITY_HOTSPOT”:

Only one fragment is displayed on the final GUI:

Thanks @Dog_Kz for the detailled answer.

Advanced rule descriptions are indeed not yet supported for security hotspots rules.

As a result, only the content of the field htmlDescription is taken into account by SonarQube, we are ignoring descriptionSections for such rules.

Aurélien

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.