It should be possible to add OWSP Top 10 and CWE for NewAdhocRule (similar to new Rule).
Could you add some detail here if exactly what you’re hoping for?
I want to import issues from a systems where some issues provide a CWE id. Currently I cannot add the CWE id because org.sonar.api.batch.sensor.rule.NewAdHocRule has no method addCWE as org.sonar.api.server.rule.Rule has.
If you’re writing a plugin, then why not just use real rules?
Well I don’t really know what rules exists in the system I am trying to import, so I thought it is better to create adhoc rules and external issues.
I was afraid of that.
And to be clear, you want to add a CWE to participate in the Security Category facet on the Issues page? Because I believe you already have the ability to add tags…
As far as I know there is no addTags on NewAdhocRule or NewExternalIssue
Okay. I’ve put created a Feature Request in Jira: https://jira.sonarsource.com/browse/FR-29