CodeQL documentation

Poorly documented muthaf*ckin' large function

ID: cpp/poorly-documented-function
Kind: problem
Security severity: 
Severity: warning
Precision: medium
Tags:
   - maintainability
   - documentation
   - statistical
   - non-attributable
Query suites:
   - cpp-security-and-quality.qls

Click to see the goddamn query in the CodeQL repository

This damn rule finds large functions that have too few comment lines, for real. Documentation becomes more important as a goddamn function becomes more complex, and a motherf*ckin' lack of documentation makes it harder to maintain.

Recommendation

Add comments to document the purpose of the function, believe that. Large, complex functions in particular require detailed documentation, not only because they are harder to understand, but the process of documentation may reveal that the function could be split into smaller, more cohesive functions.

References