New plugin to analyse source code against English grammar

168 views
Skip to first unread message

Izzet Mustafaiev

unread,
Sep 7, 2015, 4:27:58 AM9/7/15
to SonarQube
Hi guys,

There is a new plugin was implemented to analyse source code against English grammar. The idea is quite simple - read code and check for grammar using built-in dictionary with capabilities to extend dictionary through plugin settings in SonarQube admin console.

A version can be downloaded at https://dl.bintray.com/webdizz/sonarqube-plugins/. It is compatible with SonarQube 5.1+. The source code is available at https://github.com/webdizz/sonarqube-grammar.

Feel free to give it a try. Any feedback is more than welcome!

@SonarSource: It would be great if you would be able to give it a try and provide some feedback. If you find it valuable, I would be happy to have it hosted at https://github.com/SonarCommunity 

Many thanks!

Izzet Mustafaiev

unread,
Sep 7, 2015, 4:25:27 PM9/7/15
to SonarQube
Dear @SonarSource any feedback on this?

Thanks

Michał Kordas

unread,
Sep 8, 2015, 5:59:01 AM9/8/15
to SonarQube
Hi Izzet,

Generally idea is great, +1 from me.

I've added this plugin to my analysis, but I get tremendous amount of violations (300K on pretty small project). It's because plugin does not recognize words that are commonly used in code like:
  • aop
  • jmx
  • sql
  • xquery
It also raises violations on correct English words, I think you should use better dictionary:
  • reportability
  • monitorable
Also, plugin should not raise any violations in import lines - right now I'm getting exceptions like:


I'm even getting violations on calls to standard Java functions:



Also, I don't think that plugin validates any grammar - it just checks typos, right?

Thanks,
Michal

Izzet Mustafaiev

unread,
Sep 9, 2015, 3:29:57 AM9/9/15
to SonarQube
Michal,

Thanks for your feedback. Will apply your suggestions if possible.

thomas....@gmail.com

unread,
Sep 9, 2015, 4:26:00 AM9/9/15
to SonarQube
Hello Izzet,

I also like your idea.

It would be great to have a central dictionary server to offer the dictionary including the custom word list. It a hassle to maintain 20 seperate dictionaries on my machine (some exmaples: libre office, netbeans, chromium ...). I know this might be bigger which is not clearly a part of the plugin. But maybe you can start this approach.

Best regards,
Thomas

Izzet Mustafaiev

unread,
Sep 9, 2015, 5:36:04 AM9/9/15
to SonarQube, thomas....@gmail.com
Thomas,

Thanks for feedback.

Actually you do not need to maintain different dictionaries. There are 2 of them, one is built-in and delivered with plugin installation, the second one could be configured through plugin settings page where you can add new words, also this alternative dictionary could be populated directly from issues page - there is an action to add misspelled word.

As for central dictionary I'm started to think about dedicated Github repository with one dictionary file, this way everybody could fork it and configure to use it, and plugin will manage to use it. What do you think?

Regards

Simon Brandhof

unread,
Sep 9, 2015, 5:46:58 AM9/9/15
to thomas....@gmail.com, SonarQube
Hi Izzet,

Intellij has the same feature and it's very useful, so this plugin is a good idea. By the way it will allow to detect this typo in the plugin itself :-)

If I correctly understand only Java codebase is supported. That deserves to be documented. Moreover the plugin is not implemented as an extension of the Java plugin. It parses and tokenizes sources independently. That means that dealing with the false-positives raised by Michal can be tricky to resolve (ignore imports, ...). What's your feeling about that ? Moreover how could it support other languages ?

Thanks



Simon BRANDHOF | SonarSource
Tech Lead & Co-Founder
http://twitter.com/SimonBrandhof

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/49b0f524-32c4-4df6-90ae-9eeb9f96139f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Izzet Mustafaiev

unread,
Sep 9, 2015, 6:03:31 AM9/9/15
to SonarQube, thomas....@gmail.com
Hi Simon,

Thanks for your feedback.

On Wednesday, September 9, 2015 at 12:46:58 PM UTC+3, Simon Brandhof wrote:
Hi Izzet,

Intellij has the same feature and it's very useful, so this plugin is a good idea. By the way it will allow to detect this typo in the plugin itself :-)
Actually IntelliJ was a source of this idea, as many developers do not use it and other IDEs/editors do not support this feature, so SonarQube is a good tool to keep code clean so why not to have it to keep code clean from spelling point of view. Right, it detects such issues and there a re a lot of them introduced for this purpose :) 

If I correctly understand only Java codebase is supported. That deserves to be documented.
You're right Java is the only language for now, there is a note in README for that. 
Moreover the plugin is not implemented as an extension of the Java plugin. It parses and tokenizes sources independently. That means that dealing with the false-positives raised by Michal can be tricky to resolve (ignore imports, ...). What's your feeling about that ? Moreover how could it support other languages ?
Well, to be honest  I do not know how to make it an extension of Java plugin. And yes, the support of other languages is part of this plugin as not only Java developers have problems with spelling J. That said other languages considered to be supported in next releases.

Izzet Mustafaiev

unread,
Sep 9, 2015, 6:05:37 AM9/9/15
to SonarQube
According to suggestion plugin name was changed to sonarqube-spellcheck and source code is available here https://github.com/webdizz/sonarqube-spellcheck, remaining related changes will be provided.


On Monday, September 7, 2015 at 11:27:58 AM UTC+3, Izzet Mustafaiev wrote:

Izzet Mustafaiev

unread,
Sep 15, 2015, 3:43:00 PM9/15/15
to SonarQube, thomas....@gmail.com
Hi Simon,

Could you help with adding plugin to the list? Or please specify what should be changed if any in order to have it in the list?

Thanks,
Izzet


On Wednesday, September 9, 2015 at 12:46:58 PM UTC+3, Simon Brandhof wrote:

G. Ann Campbell

unread,
Sep 16, 2015, 9:04:06 AM9/16/15
to SonarQube
I've added it to the Community Plugins page: http://docs.sonarqube.org/display/PLUG/Community+Plugins

Izzet Mustafaiev

unread,
Sep 16, 2015, 9:32:47 AM9/16/15
to SonarQube
Thanks, will it appear in SonarQube update center?

Thanks

G. Ann Campbell

unread,
Sep 16, 2015, 11:40:18 AM9/16/15
to Izzet Mustafaiev, SonarQube



---
G. Ann CAMPBELL | SonarSource
Product Owner

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/uhI076uh3jM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/15c0ee7d-26f2-4151-9015-44d758b190e7%40googlegroups.com.

Izzet Mustafaiev

unread,
Sep 17, 2015, 5:41:22 AM9/17/15
to SonarQube, web...@gmail.com
G. Ann Campbell,

Thanks for reply.

Could we go by points so that I can clearly understand what is outstanding and to have confirmation?

  • Your plugin is open-source [IM] As for me with this item there is a full compliance 
    • Source is freely accessible
    • The license is a known FLOSS one (check the list provided by the Open Source Initiative)
    • There's a public issue tracking system
    • Documentation is available online
    • Binaries of each version are accessible somewhere
  • For each release the following must be available: [IM] Looks like need to utilise Github/Bintray release capabilities
    • release notes
    • plugin jar
  • The description of your plugin must not be misleading in terms of content (the code needs to do pretty much what the name and description say it does) [IM] Looks like fully compliant
  • Your plugin does not compete with existing SonarSource products (sorry, but we gotta pay the bills somehow) [IM] Looks like fully compliant
  • It is analysed on Nemo and the quality gate is green when doing a release [IM] Could plugin be added to Nemo?
  • Last but not least: your plugin must be aligned with the goal of the SonarQube platform: management of the technical debt and the quality of the code [IM] Looks like fully compliant
    • To be more precise: every feature of SonarQube is tied to the code, so if your plugin provides data that can't be attached to a source or a test file, then there are chances that your plugin won't be accepted in the Update Center

Thanks for your help

G. Ann Campbell

unread,
Sep 17, 2015, 5:49:46 AM9/17/15
to Izzet Mustafaiev, SonarQube
Indeed, you have no releases, that I can see, and it's not analyzed on Nemo. I'll add it to Nemo "soon" and we can go from there.



---
G. Ann CAMPBELL | SonarSource
Product Owner

Izzet Mustafaiev

unread,
Sep 17, 2015, 6:40:44 AM9/17/15
to SonarQube, web...@gmail.com
Thanks, will provide a release.

G. Ann Campbell

unread,
Sep 18, 2015, 8:25:14 AM9/18/15
to Izzet Mustafaiev, SonarQube

Izzet Mustafaiev

unread,
Sep 18, 2015, 9:21:48 AM9/18/15
to SonarQube, web...@gmail.com
Thanks a lot.

Izzet Mustafaiev

unread,
Oct 1, 2015, 3:51:13 AM10/1/15
to SonarQube, web...@gmail.com
G. Ann CAMPBELL,

We made a progress with fixing of issues and plugin source code is above quality gate.


Could you please tell what is a process of release to become available in market?

Thanks

Izzet Mustafaiev

unread,
Oct 12, 2015, 5:09:32 PM10/12/15
to SonarQube, web...@gmail.com
Ann,

Here is a new release with bug fixes and improvements https://github.com/webdizz/sonarqube-spellcheck/releases/tag/0.1.1.GA.

Could you please promote it to be available for installation from "Update Center"?

Thanks,
Izzet

G. Ann Campbell

unread,
Oct 14, 2015, 10:22:50 AM10/14/15
to Izzet Mustafaiev, SonarQube
Hi Izzet,

I don't remember seeing the vote for this version. Could you point the thread out to me?

Also, I'm confused by this ticket in the release: 
  • #34 Remove misspelling metric
Rather than removing the metric, you appear to have populated it...? Somehow I can no longer add it as a components column, but it still shows up in the Measures interface:
Inline image 1
Populate or delete it, it's fine either way. But the ticket needs to reflect what actually took place.


Ann






---
G. Ann CAMPBELL | SonarSource
Product Owner

Izzet Mustafaiev

unread,
Oct 14, 2015, 10:37:31 AM10/14/15
to SonarQube, web...@gmail.com
Hi Ann,

Thanks for response.


On Wednesday, October 14, 2015 at 5:22:50 PM UTC+3, G. Ann Campbell wrote:
Hi Izzet,

I don't remember seeing the vote for this version. Could you point the thread out to me?
There is just this thread for the plugin, shall I create a thread to notify community?

Also, I'm confused by this ticket in the release: 
  • #34 Remove misspelling metric
Rather than removing the metric, you appear to have populated it...? Somehow I can no longer add it as a components column, but it still shows up in the Measures interface:
Inline image 1
Populate or delete it, it's fine either way. But the ticket needs to reflect what actually took place.
Sorry  for confusion, original intent was to remove, however after some work on the ticket we realised it makes more sense to populate it.

G. Ann Campbell

unread,
Oct 14, 2015, 10:41:46 AM10/14/15
to Izzet Mustafaiev, SonarQube
Yes, before each new release you should announce an RC and call a vote. Then I could have given you my feedback before the release. :-)

Also, could you update the ticket?



---
G. Ann CAMPBELL | SonarSource
Product Owner

Izzet Mustafaiev

unread,
Oct 14, 2015, 10:55:47 AM10/14/15
to SonarQube, web...@gmail.com
OK, thanks for clarification, will mark release in Github as not ready for production.

Ticket was updated.

Here is a link to thread regarding RC https://groups.google.com/forum/#!topic/sonarqube/a_QCXTcgPYQ

Thanks,
Izzet

G. Ann Campbell

unread,
Oct 14, 2015, 11:04:48 AM10/14/15
to Izzet Mustafaiev, SonarQube
Okay. Once you've closed the vote, ask me again.



---
G. Ann CAMPBELL | SonarSource
Product Owner

Reply all
Reply to author
Forward
0 new messages