Why you should care
The KSH script starts at the first and essentially ends when the code encounters an “exit” or the last line. When exiting a code without parameters, it causes the code to become unreliable and cause errors that tend to become unmanageable.
Business Impacts
It is recommended to have parameters in the script because lack of parameters will cause reliability issues leading to an unproductive and unmanageable code.
CAST Recommendations
How we detect
This code insight shows when using exit with no parameters the default behavior is to exit with the return code of the last command executed. If you want to manage errors in your script, you must control your own error code system and return a specified value.
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.