We’re trying to detect usage of global variables in our js code by using a sonar analysis. It seems that this rule was present in old versions of the javascript plugin, but not anymore (we’re using version 1.2 of the plugin).
Are we doing something wrong ? Or is there a way to use XPath to mimic this rule ?
Thanks in advance
Previous version of the Sonar Javascript plugin was based on JSLint, and JSLint has a check for global variables. However, in the newest versions of the Sonar Javascript plugin, we removed JSLint and implemented our own parser and rules. This is why you don’t get violations on this now.
Currently, we haven’t implemented this rule but it’s in our backlog (see http://jira.codehaus.org/browse/SONARPLUGINS-1821). Feel free to vote for it to push it up to the top of the backlog!