org.sonar.l10n.web.rules.Web.AvoidCommentedOutCodeCheck.html Maven / Gradle / Ivy
The newest version!
Here are the main reasons why commented code is a code smell:
- It always raises more questions than it gives answers
- Everybody will forget very quickly how relevant the commented code is
- This is distraction when going down the code as it stops the flow of eyes
- It is a bad SCM engine : Subversion, CVS and Git are really more trustworthy !
- The simple fact of understanding why code was commented out in the first place can take a lot of time
Noncompliant Code Example
<p>
<!-- Non-Compliant -->
<!--
<b>Hello</b>,
<i>world</i>!
-->
...
</p>
Compliant Solution
<p>
<!-- Compliant -->
...
</p>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy