Avoid using ellipsis in functions

Why you should care

Functions should not be defined with a variable number of arguments. Varargs methods are a convenient way to define methods that require a variable number of arguments, but they should not be overused. They can produce confusing results if used inappropriately.

How we detect

This Code Insight counts one occurrence each time the following pattern is detected in the source code:

 

void function ( String... strings )
{
// ...
}

References

5362

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.