We are using codacy for static code analysis. On pushing a change to the js file, where we are declaring a function that returns an object, it is giving the below error.
Internally, codacy tells us this is reported since PMD 5.0. We are not sure if this is an actual issue in the code or in the analyzer. If it is a code issue then what is the correct way to solve this?
EDIT: Using PMD version 6.48.0