Whats the best way to get started on a SonarQube plugin for a new language - sonarqube

I want to develop a sonarqube plugin for analyzing a new language. The language's grammar is developed. There is a parser available for it. The parser throws out an AST.
I want to write visitors for this AST and then develop rules. Is there a sample plugin(I saw the github sonar-examples but I didnt find it to be clear) or good documentation on what steps I should take?
Guidance from people who have developed Sonarqube plugins for languages much appreciated!

This Supporting New Languages outline should get you started. Beyond that, go to the Google Group to ask specific questions.

Related

Pydio Cells Plugins

I need to extend/customize a Pydio Cells v2 deployment and am looking for informations on how to write and deploy plugins for Pydio Cells. Sadly I cannot find any informations about that. All I can find is infos about the "old" Pydio. Could anyone give me some hints please?
There is a developer guide, but it seems to be only for the REST APIs. It's still unclear where you put the logic and all that. IIRC they also said the microservice architecture could be language agnostic.
So far I couldn't find any tutorial. That's too bad for such a promising project.

Testing a DSL / Grammar Written With Xtext

I've been set a task of writing a grammar / DSL with XText. It seems reasonably simple. I've been asked to incrementally add rules to the grammar as per a specification. I want to be able to test each new rule that I create.
I have Spring Tool Suite Version: 3.9.2.RELEASE, Build Id: 201712210947, Platform: Eclipse Oxygen.2 (4.7.2).
I've seen textboxes in web browsers that show syntax highlighting based on the validity of the input as per the grammar rules. Also, I'm aware that unit testing is a possibility.
What's the simplest way, minimal fuss, of verifying that the grammar works as expected?
Your help is greatly appreciated.
Thanks in advance,
Ryan
Writing a bunch of unit tests using ParseHelper and ValidationTestHelper should be the most sustainable way to do this.
e.g. https://github.com/eclipse/xtext-eclipse/blob/master/org.eclipse.xtext.xtext.ui.examples/projects/domainmodel/org.eclipse.xtext.example.domainmodel.tests/src/org/eclipse/xtext/example/domainmodel/tests/ValidationTests.xtend
The answer depends on what you mean by 'verifying that the grammar works as expected'. As Christian noted, unit tests using ParseHelper and ValidationTestHelper will tell you if your grammar is being parsed into the correct model and generating the appropriate errors otherwise. If however you want to test things like content assist, syntax higlighting and such, you have to go a little further and write some tests using AbstactEditorTest, AbstractOutlineTest, etc. in the ui.tests package for your Xtext project. After looking at a lot of tutorials I finally went ahead and bought Lorenzo Bettini's book:
Implementing Domain-Specific Languages with Xtext and Xtend - Second Edition
It was a great help in understanding Xtext, and how to test a grammar as you create it.

Wanting to make an Xposed module

So I'm wanting to make an xposed module but cannot find any good video tutorials out there let alone an updated one also I know C# Decently and hardly any Java... Any help to help me get started would be appreciated. Thanks
You will need Java to create any Xposed modules. Android itself is based on (primarily) Java, so you will need Java knowledge to make Xposed modules.
That said, C# and Java are extremely similar languages, and you can quickly pick up the other if you know one.
As for Tutorials, Rovo89 (the creator of Xposed) has a simple tutorial here at https://github.com/rovo89/XposedBridge/wiki/Development-tutorial. This tutorial is almost completely upto-date, and you can use this to create your first module.
You will find another detailed tutorial here - https://forum.xda-developers.com/showthread.php?t=2709324. Keep in mind that this link is very old, so wherever there are any conflicts, go by Rovo89's tutorial.
After going through the beginner tutorial mentioned by Akhil, you will want to look at the API docs http://api.xposed.info/reference/packages.html and read through source code of some huge modules like GravityBox to get an idea of how the Framework is used. For teaching purpose mod some app which is open source and then move on to closed source app by reverse engineering them. For reverse engineering I use ByteCodeViewer.

Code smells reporting/tracking tool

I was wondering if you know any tools that help keep track of "code smells". So that team members could report some finding in the code and then possibly vote on the most problematic ones (in terms of future project development).
Any experiences?
Have you looked at find bugs or check style? Both of these are pretty good for this.
I would also recommend pmd. These let you analyse common problems such as not setting method parameters final.
Lastly, I'd recommend using Sonar as this will highlight any code errors in order of priority. Such as code that is knowingly going to through a NPE, it will highlight this to you and can be integrated with Jenkins.
All these together can really help you move towards the "Clean Code" mantra.

Hudson/Jenkins source code metrics?

Are there any useful plugins for source code metrics for Hudson/Jenkins?
I'm looking for total lines of code, total number of tests, classes, etc. with graphing.
Does anything like this exist?
Are you using Java? If so, SONAR should certainly be your first port of call. It does a lot on it's own and also wraps up all the major Java analysis tools, such as:
Out of the box, you'll get metrics on:
Potential Architectural & Design issues
Unit test coverage (uses cobertura)
Lines of code\packages\classes etc
Potential bugs
Code duplication
Adherence to code formatting standards
(plus many more)
It allows you to traverse from the high level analysis through to the source code it relates to. It will be easier if you're using Maven for your build though...
There is a Hudson plugin. And it's free.
Try CCCC (http://sourceforge.net/projects/cccc/). It does code counting, module counting (classes), etc., and the plugin also graphs it for you. (for C, C++)
Incidently, what language are you looking at?
There's also CLOC (Count lines of Code) which will tell you how many lines of each language you have, although I can't seem to find a link for it.
You don't specify which language you are using, but Redsolo's awesome blog post Guide to building .NET projects using Hudson shows you how to use FxCop and NUnit on Hudson to give some of what you are looking for. The Violations plugin used also supports Simian, CPD, PMD and PyLint.

Resources