The “disallowed ” rules like Java:S3688 say you can use regex, but they don’t give examples. The example shows className:java.lang.String but if that can be a regex then TECHNICALLY shouldn’t it be java\.lang\.String ? Also how do I put multiple classes? Is there a general page describing the particular regex format used by SQ, and if so, shouldn’t all regex-using rules point to it?
Oh, and if I were to put java\.lang (not that I WOULD), does that automatically flag everything underneath or would I also need java\.lang\..* ?
Hey @MisterPi!
You’re right. The example regex should be java\.lang\.String or java[.]lang[.]String. We should update that.
The aim here is one template rule per class. You can instansiate many rules from one template rule.
You would need to use the latter.
I’ll pass on your feedback to see if we can improve the rule description.
Of course the original regex would still work, but it would also match something like javaxlang.String (not that that would be too likely to occur).
There is also my original question about documentation of the regex standard used by SQ.