[VOTE] SonarQube Lua Plugin version 0.1

82 views
Skip to first unread message

Fati Ahmadi

unread,
Oct 25, 2016, 7:12:58 AM10/25/16
to SonarQube
Hi all,

I would like to release the first version of lua-plugin, to be available in the Update Center
The candidate is here:

Would you please try it. Any feedback is more than welcome.


Vote open to everybody for 72 hours.
  [ ] +1
  [ ] +0
  [ ] -1

Many thanks for your time,

Fati

G. Ann Campbell

unread,
Oct 27, 2016, 11:24:02 AM10/27/16
to SonarQube
Hi Fati,

I picked a project at random to test this against. I ended up with https://github.com/facebookresearch/torch-rnnlib, and set sonar.sources to rnnlib.

With the default profile, I got an NPE during analysis: 
Unable to analyze file: /home/ganncamp/testProjects/lua/torch-rnnlib/rnnlib/cell.lua
...
Caused by: java.lang.NullPointerException
at org.sonar.lua.checks.utils.Function.getName(Function.java:37)
at org.sonar.lua.checks.FunctionNameCheck.visitNode(FunctionNameCheck.java:83)
at com.sonar.sslr.impl.ast.AstWalker.visitNode(AstWalker.java:114)
...

So I moved that file out of the way and tried again, only to get the same exception on a different file.

Then I tried a different project and got the same results. 


:-/
Ann

Fati Ahmadi

unread,
Oct 27, 2016, 1:01:48 PM10/27/16
to SonarQube
Hi Aan,

Many thanks for checking the plugin;)

I have new update on pre-release page now. Could you please download the updated plugin and try it again.

Many thanks for your time.

Fati

Op donderdag 27 oktober 2016 17:24:02 UTC+2 schreef G. Ann Campbell:

G. Ann Campbell

unread,
Oct 27, 2016, 1:39:08 PM10/27/16
to SonarQube
Hi Fati,

This version is much better. :-)

Your complexity calculation may be inflated. Admittedly, I don't know Lua, but I don't understand how this function scored a complexity of 13:

function layer:updateGradInput(input, gradOutput)
  self.gradInput:resizeAs(gradOutput):copy(gradOutput)
  self.clipped:resizeAs(input):clamp(input, -self.max_grad, self.max_grad)
  self.gradInput:add(-self.strength, self.clipped)
  return self.gradInput
end


Also, IMO you should consider adding a fuller description to the FuncCALL complexity rule. All I see in the description is "max complexity."

Other than those things, this looks like a great first effort. Congratulations!


Ann

G. Ann Campbell

unread,
Oct 27, 2016, 1:44:31 PM10/27/16
to SonarQube
Hi again,

I've just noticed/remembered that you asked for inclusion in the update center. So here's some feedback on that topic:

* The pom indicates a GNU LGPL 3 license, but you have to go digging in the code to find it. It should be more prominent
* There's no documentation 
* There's no apparent issue tracking system (turn on the issues function in the GitHub repo?)

For reference, here's the full list of requirements: http://docs.sonarqube.org/display/DEV/Deploying+to+Update+Center


Ann

Fati Ahmadi

unread,
Oct 28, 2016, 10:00:01 AM10/28/16
to SonarQube
Hi all,

 The vote has passed without anyone denied,  i would like to close the pre-release vote.

 Thank you Ann and Christopher for review and testing the Plugin.

Fati


Op donderdag 27 oktober 2016 19:44:31 UTC+2 schreef G. Ann Campbell:

Fati Ahmadi

unread,
Oct 28, 2016, 11:28:12 AM10/28/16
to SonarQube
Hi Ann,

I have updated the git. There is documentation, Issues function now activated, Also the update version of plugin, 

 "index" item is not calculated  as complexity  and functionCall description is "FunctionCaLL should not be too complex."

I here from you if i must do anything else for inclusion the plugin in update center.

Many thanks,
Fati  



Op donderdag 27 oktober 2016 19:44:31 UTC+2 schreef G. Ann Campbell:
Reply all
Reply to author
Forward
0 new messages