[vc_row][vc_column][nz_btn text=”Software Agility” link=”http://casthighlight.wpengine.com/software-agility/” icon=”icon-dashboard” color=”black” shape=”rounded”][nz_btn text=”Code Readability” link=”http://casthighlight.wpengine.com/category/product/indicators-methodology/code-insights/software-agility/code-readability/” icon=”icon-code” color=”black” shape=”rounded” type=”ghost” hover_ghost=”screen”][vc_empty_space height=”12px”][vc_column_text]
Avoid too many classes in the same file
[/vc_column_text][vc_column_text]This code insight counts one occurrence each time a source file is found with multiple class definitions. Developers can spend time looking for a class in a file if multiple classes are there. Converserly, it is straightforward when the file contains only the searched class.[/vc_column_text][vc_empty_space height=”12px”][vc_empty_space][vc_single_image image=”5362″ img_size=”full”][vc_row_inner][vc_column_inner width=”1/2″][vc_separator][vc_column_text]
CAST recommendations
Ideally, for readability purpose, one source file contains one class.[/vc_column_text][/vc_column_inner][vc_column_inner width=”1/2″][vc_separator][vc_column_text]
References
https://dzone.com/articles/why-single-java-source-file-can-not-have-more-than
https://stackoverflow.com/questions/968347/can-a-java-file-have-more-than-one-class[/vc_column_text][/vc_column_inner][/vc_row_inner][vc_row_inner][vc_column_inner][vc_single_image image=”5362″ img_size=”full”][vc_column_text]
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/” icon=”icon-stats” color=”black” shape=”rounded”][nz_btn text=”How it works” link=”http://casthighlight.wpengine.com/how-it-works/” icon=”icon-cog” color=”black” shape=”rounded” type=”ghost”][/vc_column_inner][/vc_row_inner][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]
c
[/vc_column_text][/vc_column][/vc_row]
Leave a Reply