Pure JSP Comments can decrease Costs

[nz_btn text="Cost" link="http://casthighlight.wpengine.com/category/product/indicators-methodology/cost/" target="_self" icon="icon-office" animate="false" animation_type="ghost" color="green" size="small" shape="rounded" type="normal" hover_normal="opacity" hover_ghost="fill"][nz_btn text="Software Agility" link="http://casthighlight.wpengine.com/software-resiliency/" target="_self" animate="false" animation_type="ghost" color="black" size="medium" shape="rounded" type="normal" hover_normal="fill" hover_ghost="fill" icon="icon-dashboard"][nz_btn text="Embedded Documentation" target="_self" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="ghost" hover_normal="fill" hover_ghost="screen" link="http://casthighlight.wpengine.com/category/product/indicators-methodology/code-insights/software-resiliency/code-reliability/" icon="icon-code"]

Pure JSP Comments can decrease Costs

This code insight counts one violation each time a scriptlet contains only java comments. This includes for example the following patterns : <% /** ... */ %> <% /* ... */ %> <% // ... %> Including cases with several comments: <% /* ... */ /* ... */ %> And of course cases using XML format tags: <jsp:scriptlet> /* ...*/ </jsp:scriptlet>

Why you should care

Java comments are for commenting java code. If a JSP scriptlet contains no java code, then no java comment is needed. A scriptlet containing only java comment is symptomatic of :
  • a comment aiming to produce documentation at JSP script level. In this case a JSP comment would be more appropriated.
  • a commented out java code: this is a bad practice because useless code should be removed.
so <%-- … %> is prefered to <% /** ... */ %> <% /* ... */ %> <% // ... %>

Business Impacts

[nz_btn text="Cost" target="_self" animate="false" animation_type="ghost" color="green" size="small" shape="rounded" type="normal" hover_normal="opacity" hover_ghost="fill" link="http://casthighlight.wpengine.com/category/product/indicators-methodology/innovation/" icon="icon-office"]

CAST recommendations

References

https://www.quantifiedcode.com/knowledge-base/readability/Avoid%20%22non-Pythonic%22%20attribute%20names/3ueqPTsn

About CAST and Highlight’s Code Insights

Over the last 25 years, CAST has leveraged unique knowledge on software quality measurement by analyzing thousands of applications and billions of lines of code. Based on this experience and community standards on programming best practices, Highlight implements hundreds of code insights across 15+ technologies to calculate health factors of a software.
[nz_btn text="See features" link="http://casthighlight.wpengine.com/outputs-analytics/" target="_self" icon="icon-stats" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="normal" hover_normal="fill" hover_ghost="fill"][nz_btn text="How it works" link="http://casthighlight.wpengine.com/how-it-works/" target="_self" icon="icon-cog" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="ghost" hover_normal="fill" hover_ghost="fill"]
For reference only. For the complete details please refer the original article
https://doc.casthighlight.com/alt_jspcomment-prefer-pure-jsp-comments/
Have more questions? Submit a request

Comments

Powered by Zendesk