Software ResiliencyProgramming Best Practices
Production Risk
Style Guide
How we detect
Why you should care
The PLSQL CASE has similar functionality of an IF-THEN-ELSE statement. The CASE statement evaluates a single expression and expresses it against several potential values or evaluates Boolean Values while choosing the first one that is TRUE.
WHEN clauses are executed in order. WHEN clauses is executed only once. Without a WHEN clause the CASE statement generally does not end, or not fully executed causing errors.
WHEN clauses are executed in order. WHEN clauses is executed only once. Without a WHEN clause the CASE statement generally does not end, or not fully executed causing errors.
Business Impacts
It is recommended to have CASE be utilized with a WHEN clause so that there are less risks in the code and is more productive.
CAST Recommendations
References
https://docs.oracle.com/cd/E19159-01/819-3669/bnalq/index.html
How we detect
This code insight shows that each case instruction should have a default clause.
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.
See featuresHow it works