Can javascript:S138 pick up functions in general, but exclude AMD module functions?


(Alain O'Dea) #1

javascript:S138 fires on whole AMD modules unless they are under 200 lines. Lots of our AMD modules are over 200 lines long.

AMD modules (https://requirejs.org/docs/whyamd.html) look like this:

define(['jquery'] , function ($) {
    return function () {};
});

Is there a way to have it pick up functions in general, but exclude AMD module functions?


(Elena Vilchik) #2

Hello Alain,

Which version of SonarJS do you use? AMD are already ignored in this rule since version 2.6 (released 2.5 years ago)


(Alain O'Dea) #3

Thank you, Elena.

We’re running:
SonarQube Enterprise: 7.4.0.18908
SonarJS: 5.0 (build 6962)