Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- what are you trying to achieve
- what have you tried so far to achieve this
Hello
Version information regarding our environment
SonarQube : 8.3.1.34397
Javascript scanner (SonarJS) : 6.2.1 (build 12157)
Description of my problem
It seems that the Javascript scanner don’t recognize some Javascript object during parsing and so when the object is analyzed in another javascript file, the system detect a problem by indicate that the reference is unknown
In one Javascript file we have the declaration of the object , like
var GSMCheckArticlesBusiness = {};
GSMCheckArticlesBusiness.addFaultsItems = function(controller){
var ctrl = controller;
var xmlInput = '<GSMArtWithFaultUpdate>';
var articleRecords = ctrl.getTask().getAllArticleRecords();
...
...
}
In another files we use the object
...
...
if(ctrl.getTask().getType() == TASK_TYPE.CHECK_ARTICLES){
xmlInput += GSMCheckArticlesBusiness.addFaultsItems(ctrl);
}
...
...
During the analyze of this last javascript files , Sonar indicate an error
“GSMCheckArticlesBusiness” does not exist. Change its name or declare it so that its usage doesn’t result in a “ReferenceError”
Do you have an idea , why the object is not recognized ?