All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.web.rules.Web.AvoidCommentedOutCodeCheck.html Maven / Gradle / Ivy

Go to download

Analyze HTML (also within PHP/Ruby/etc. templates) and JSP/JSF code.

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