Archive
Software Agility
-
Avoid collapsible nested ‘if’
Merging collapsible if statements increases the codeβs readability.
-
Avoid catches that only rethrow
catch clause that only rethrows the caught exception has the same effect as omitting the catch altogether and letting it bubble up automatically, but…
-
Avoid nested try-catch blocks
Although this is sometimes unavailable, nesting try/catch blocks severely impacts the readability of the source code as it makes it difficult to understand which…
-
Avoid long case statements
The switch statement should be used only to clearly define some new branches in the control flow. As soon as a case clause contains…
-
The code contains non-wrapped immediate function calls
When a function is to be invoked immediately, the entire invocation expression should be wrapped in parents. Wrapping an immediate function invocation in parentheses…
-
The code contains too many var statements declaring several variables in it
Although JavaScript allows to declare multiple variables in a single chain, it is recommended to declare each variable separately as it is easier to…
-
Avoid small switch/Case
SWITCH statements are useful when there are many different cases depending on the value of the same expression. However, code will me more readable…
-
The code contains too many negative comparisons
This pattern verifies the presence in source code of negative comparisons. Depending on the frequency, CAST Highlight will trigger this code insight.
-
The code contains too many MOVE instructions with multiple assignments
[vc_row][vc_column][nz_btn text=”Software Agility” link=”http://doc.casthighlight.com/software-agility/” icon=”icon-dashboard” color=”black” shape=”rounded”][nz_btn text=”Embedded Documentation” link=”http://doc.casthighlight.com/category/product/indicators-methodology/code-insights/software-agility/embedded-documentation/” icon=”icon-code” color=”black” shape=”rounded” type=”ghost” hover_ghost=”screen”][vc_empty_space height=”12px”][vc_row_inner][vc_column_inner width=”1/2″][vc_column_text] Why you should care [/vc_column_text][vc_column_text]Description coming soon…[/vc_column_text][/vc_column_inner][vc_column_inner…
-
Spaces between function name and opening parenthesis cause bugs
[vc_row][vc_column][nz_btn text=”Software Agility” link=”http://casthighlight.wpengine.com/software-agility/” target=”_self” animate=”false” animation_type=”ghost” color=”black” size=”small” shape=”rounded” type=”normal” hover_normal=”fill” hover_ghost=”fill” icon=”icon-dashboard”][nz_btn text=”Code Readability” target=”_self” animate=”false” animation_type=”ghost” color=”black” size=”small” shape=”rounded” type=”ghost” hover_normal=”fill”…