The code contains too many throws to system exceptions

Why you should care

The code contains too many thows to system exceptions (java.lang.Error, java.lang.RuntimeException). Application should have their own error exception classes. Throwing generic exception force callers to use generic catches. Prefer to use applicative and more specialized exceptions.

How we detect

This Code Insight counts one occurrence each time one of these patterns are found into the source code:




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.