The function isBig will only return a specific value when its parameter is bigger than
5000. In any other case, it will implicitly return undefined.
This behaviour may not be what you had intended. In any case, you can add a
returnundefined to the other execution path to make the return value
explicit.
This check looks for functions where a
return
statement is found in some execution paths, but not in all.Consider this little piece of code
The function
isBig
will only return a specific value when its parameter is bigger than 5000. In any other case, it will implicitly returnundefined
.This behaviour may not be what you had intended. In any case, you can add a
return undefined
to the other execution path to make the return value explicit.