CodeQL documentation

Commented-out code

ID: cpp/commented-out-code
Kind: problem
Security severity: 
Severity: recommendation
Precision: high
Tags:
   - maintainability
   - documentation
Query suites:
   - cpp-security-and-quality.qls

Click to see the query in the CodeQL repository

Commented-out code is distracting and confusing for developers who read the surrounding code, and its significance is often unclear. It will not get compiled or tested when the code around it changes, so it’s likely to break over time. For these reasons, commented-out code should be avoided.

Recommendation

Remove or reinstate the commented-out code. If you want to include a snippet of example code in a comment, consider enclosing it in quotes or marking it up as appropriate for the source language.

References

  • © GitHub, Inc.
  • Terms
  • Privacy
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy