[vc_row][vc_column][nz_btn text=”Software Elegance” link=”http://casthighlight.wpengine.com/category/product/indicators-methodology/software-elegance” 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 Complexity” 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/software-elegance/code-complexity/” icon=”icon-code”][vc_empty_space height=”12px”][vc_empty_space height=”12px”][vc_row_inner][vc_column_inner width=”1/2″][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
Why you should care
[/vc_column_text][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
Artifacts with a SELECT clause tend to be complex in nature as SELECT clauses with many clauses are difficult to read and does not help the reader in identifying the columns that can be retrieved. Also a query that retrieves many columns can potentially cause performance problems as such performance problems may arise when the query is executed.
[/vc_column_text][/vc_column_inner][vc_column_inner width=”1/2″][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
Business Impacts
It is recommended to avoid complex artifacts in the code as their complex nature can result in loss of time and slow down the innovative capabilities of the code.
These factors can make the code unsuitable for clients.[/vc_column_text][vc_empty_space height=”12px”][nz_btn text=”Acceleration” target=”_self” animate=”false” animation_type=”ghost” color=”orange” size=”small” shape=”rounded” type=”normal” hover_normal=”opacity” hover_ghost=”fill” link=”http://casthighlight.wpengine.com/category/product/indicators-methodology/acceleration/” icon=”icon-office”][/vc_column_inner][/vc_row_inner][vc_empty_space height=”32px”][vc_single_image image=”5362″ img_link_large=”” img_link_target=”_self” img_size=”full” alignment=”none”][vc_row_inner][vc_column_inner width=”1/2″][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
CAST Recommendations
Instead of using SELECT, every column to be used in the query, should be explicitly listed while using a table alias.
For Example –
SELECT column1, column2, column3. FROM TABLE
instead of
SELECT * FROM TABLE[/vc_column_text][/vc_column_inner][vc_column_inner width=”1/2″][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
References
https://www.appmarq.com/public/efficiency,7108,Avoid-Artifacts-with-a-Complex-SELECT-Clause-ABAP
http://mansriva.blogspot.com/2014/12/sqlpl-sql-coding-standards-guidelines.html
https://stackoverflow.com/questions/3639861/why-is-select-considered-harmful[/vc_column_text][nz_btn text=”Style Guide” link=”https://github.com/Kristories/awesome-guidelines” target=”_self” icon=”icon-book” animate=”false” animation_type=”ghost” color=”turquoise” size=”small” shape=”rounded” type=”ghost” hover_normal=”fill” hover_ghost=”screen”][/vc_column_inner][/vc_row_inner][vc_separator color=”grey” align=”align_center” style=”” border_width=”” el_width=””][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
How we detect
[/vc_column_text][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
This code insight focuses on how functions, procedure and triggers should not have a too high cyclomatic complexity
[/vc_column_text][vc_separator color=”grey” align=”align_center” style=”” border_width=”” el_width=””][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
How we detect
[/vc_column_text][nz_btn text=”Complexity – SQL Queries” target=”_self” animate=”false” animation_type=”ghost” color=”purple” size=”small” shape=”rounded” type=”normal” hover_normal=”opacity” hover_ghost=”fill”][vc_empty_space height=”12px”][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
Ineffective Interprocess Communications: Utilizing SELECT * in SQL can create technical issues during the cloud migration process as the database application could constrained by physical machines which might using other services. It can also disrupt the application when accessing it from the cloud.
[/vc_column_text][vc_row_inner][vc_column_inner width=”1/1″][vc_single_image image=”5362″ img_link_large=”” img_link_target=”_self” img_size=”full” alignment=”none”][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
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.
[/vc_column_text][vc_empty_space height=”16px”][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”][/vc_column_inner][/vc_row_inner][/vc_column][/vc_row]
Leave a Reply