Why you should care
It’s recommended to use efficient practices over inefficient types to ensure the code runs efficiently and interchangably across platforms. It also ensures that the code is not complex in the process
Business Impacts
Using less efficient types is absolutely risky for the code because it’s name is certainly a giveaway. It is best practice to avoid less efficient types so that the code can be more productive.
CAST Recommendations
How we detect
PLS_INTEGER is defined in the STANDARD package as a subtype of BINARY_INTEGER. PLS_INTEGER operations use machine arithmetic, so they are generally faster than NUMBER and INTEGER operations. Also, prior to Oracle Database 10g, they are faster than BINARY_INTEGER. In Oracle Database 10g, however, BINARY_INTEGER and PLS_INTEGER are now identical and can be used interchangeably.
The types NATURALN and POSITIVEN are defined to be NOT NULL subtypes of NATURAL and POSITIVE, respectively; thus, you will incur the performance penalty described in the NotNullVariables alert description when you use them.
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.