Sonarqube Javascript rule "Function names should comply with a naming convention" doesn't work with functions declared in variables -
i started using sonarqube few days ago, have question javascript rule "function names should comply naming convention".
some of developers not respect naming conventions naming functions, of time define functions this:
ontextfieldchange1111111: function(field, newvalue, oldvalue, eopts) { ... }
and looks method doesn't fire rule "function names should comply naming convention".
is specific configuration make work? or there rule check this?
this particular sonarqube rule uses regular expression check function name. default uses expression:
^[a-z][a-za-z0-9]*$
the function name in question matches regular expression. if want check other things, can alter default regular expression yourself. (you have log in administrator change default setting).
i think particular rule works functions defined as
function thisismyfunction()
and not functions defined variables. afaik there no sonarqube rule checks latter. in fact there sonarqube rule encourages developers define functions variable if defined in code block (see 'function declarations should not made within blocks' javascript rule)
i know can write , add own sonarqube rules, have no experience myself.
Comments
Post a Comment