Why you should care
Specify precision which is the total number of digits, and scale, which is the number of digits to the right of the decimal point. The range of a Char variable is from 1 to 32767 bytes. When the expression falls outside this range, it is no longer precise and a numeric overflow or undeflow error occurs.
It is recommended to specify precision as it helps alleviate potential risks in the code and ensure that the code is reliable and accessible
How we detect
This code insight shows that char-based variable must always be declared.
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.