Scala

Scala

Made by DeepSource

Incorrect number of args to String.format SC-W1008

Bug risk
Critical

String.format() requires that you supply all the arguments corresponding to the format specifiers. Missing arguments usually leads to an improperly formatted string. Such strings can critically alter the behaviour and control-flow of the program if the program relies on it.

Bad Practice

val intro = String.format("My name is %s and I am %d years old", name)

Recommended

val intro = String.format("My name is %s and I am %d years old", name, age)