I am working on a custom SonarQube plugin designed for the Natural mainframe language, and I need to implement a rule to enforce a lines of code (LOC) threshold for detecting “Too Many Lines of Code” in a program.
I was trying to refer to the same rule for COBOL, but since COBOL rules are available only in the Enterprise version, I am unable to access them.
Could anyone suggest an appropriate LOC threshold for this rule or provide guidance on industry standards for mainframe languages like Natural?
You’re looking not for a sample implementation but for what the default threshold should be set to?
So first, as the implementer of the plugin, I would normally expect that you would have enough background in the language to understand what’s reasonable and what’s not. Or that you would have knowledgable colleagues who could advise you.
And second, in general rules about “too many” generally have parameterized settings for how many is “too” many. Because such judgments are necessarily arbitrary, and what’s too many for you may not be for someone else. So even if the default threshold you set is too low (or too high) it can be adjusted later by your users.