SONAR code violation filtering by user - plugins

Does anyone know if there is SONAR extension for filtering violations by user/author who introduced them ?
Idea is to pick a user, and SONAR would list all violations made in the code by that specific user.
Maybe some ideas could be provided if it is possible to achieve such functionality ?
Thanks.

You could also use the REST-API to get the violations (something like 'http://sonar-host/api/violations?resource=1&depth=-1&priorities=BLOCKER,CRITICAL,MAJOR') to get the interesting violations and then use 'svn annotate' to get the relevant annotions and therefore the user. That is what I did, and in the meantime it works well.

SonarQube, "Issues" Main manu/tab provides this feature. You can do all sorts of filtering by project, by user etc through that feature.
This is in version 4.3.2

Related

Edit an another's plugin

I have a plugin's resource codes and I want to edit. Because I want to change plugin's prefix but it isn't possible unless edit plugin. I tried edit with Eclipse but I had a lot of errors.
If you have source codes of some plugins, there meight be a problem, that they are using some api for example WorldEdit api, but you don't have it added in your project. You have to look into code and find out what they use. Then download the api and add it in Build Path - Right Click the project->Build bath->add external Jars. I hope this will help.
You may be getting errors from imports, API's, etc.
The best way to change this is to contact the developer of the plugin, who has the project themselves. It's not a good idea to change code unless you have full permission; but I will still tell you some possible ways to fix it.
Your imports may be faulty, check those.
Actually REVIEW the code yourself– Don't mess around with things you don't know what they do.
CHANGE YOUR PACKAGE NAMES (This got me before, simple mistake)
If there are comments in the code, use those to your advantage
Google your errors.
If you are new to Java, don't skip to changing code already. TRUST ME. Learn all you can before skipping to other "higher level" developer styles.
Like I said, these are vague and simple ways to fix it; the best way to have your feature implemented is to contact the developer.
*I understand that this thread is old; I'm just saying this because there are currently no answers that describe this for other Google travelers of the internet.

Sonar - Ignore Lombok code via custom annotation

I'm trying to ignore Lombok code (generated code) from Sonar analysis based on files which have a custom annotation, #ExcludeLombok.
I've tried this guide which did not work.
In fact, I've even tried excluding an entire directory from analysis and it still wouldn't work.
I've also tirelessly searched through StackOverflow looking for a solution, and I've seen this has been discussed a good bit on here, but I've seen that people have been suggesting to write a single test to get the coverage up, which is pointless since we should not test auto generated code.
The solution I'm looking for is to exclude files based on a custom annotation.
But so far, anything I attempt to exclude does not get excluded.
Any help would be greatly appreciated.
There is currently no easy way to exclude issues raised by the SonarQube rules from the SonarQube Java Analyzer, except from using approaches described in the "Narrowing the focus" documentation you quote.
Now, we introduced recently the concept of issue filters in the SonarQube Java Analyzer. This mechanism is at the moment only used internally to exclude issues raised by rules at analysis time, based on specific criteria.
We plan to extends this mechanism in order to allow users to implements their own custom issue filters, the same way custom rules can be implemented. This approach would cover your case and allow you to filter any rules on code annotated with your custom annotation. This new feature will be handled in the following JIRA ticket: SONARJAVA-1761
Another option you have is to run Sonar over delomboked source. There are various ways to delombok depending on your build system see:
Delombok Overview.
For maven there's an example of running analysis on delomboked code: Delombok test pom
In each case you would make sure you ran the checks over generated source.

How to force team members to comment using eclipse plugin or something else

Currently, I am working in a new project and it was difficult for me to understand since there is no comment. I wonder if it is possible to force team members(including me) to add more comments. I would like to automate this ject in jenkins later if possible.
You can run static code checks and their corresponding eclipse plug-ins to enforce comments being made in code.
For e.g. in CheckStyle javadoc can be enforced http://checkstyle.sourceforge.net/config_javadoc.html
Also checkstyle can be easily integrated with Jenkins.
You can also use eclipse java compiler settings for javadoc check.
Go to preferences->java->compiler->javadoc to enforce errors and warnings.
Compiler errors and warnings can be easily reported through continuous build
cheers,
Saurav
I can only recommend to be very, very careful with that. Of course, you may use tools like SONAR, Eclipse Settings and the like to enforce comments.
Buuuuuuuut:
You can easily generate comments (/w Eclipse) and -as you probably
know- generated comment is not use/helpful at all.
In case you add a useful comment and it relies too much on the actual implementation, you also have to maintain it. Whenever the code changes you need to validate if the comment does too. This is often overlooked and creates more confusion then by not having any comment at all. Even though you had a good intention in the first place.
"The Truth Lies In The Code"(tm): You can achieve good to understand and easy maintainable code by working very hard on it. This might help to avoid to need any comment at all. Its not easy (and not always possible), I admit that.
At least "public API" must be documented. That could be a rule of thumb and it seems managable in a large code base.
I would rather spend more time in having good understandable code instead of "forced comments". You may achieve the complete opposite by enforcing it.
Using Sonar/Eclipse Settings to enforce documentation of public API makes sense to me though.
This needs to be implemented at the source control level, not the IDE level.
If you're using git, you can look into git hooks http://git-scm.com/docs/githooks
This will let you write little scripts that will be run when you commit code. You can write a script to check if the commit includes a valid comment. You can also perhaps allow skipping of comments with a "-force" option or something like that.

Does Redmine provide any graph report options

Does Redmine tool provide any plugin to generate graphs for the issues?
Like, i need to generate a pie or bar graph for no. of issues raised for current week/month etc. Can someone please help me with this?
There are indeed some Redmine plugins that provide graphical reports. Some of them (more or less) usable also for issues. The free one's are listed on Redmine.org in the plugin directory, the others are commercial plugins.
Like the following one's:
Redmine Reporting Plugin
Plugin for the Redmine issue tracker
Best thing would be:
Make your custom queries
In every of these queries export the csv file
Take it from excel

How can I do "Version control" of a entire site in Liferay?

I am a member of a team who try to build several sites using Liferay. We have difficulty sharing updates between us using LAR files and we have the same problem building the test and QA version of the site. We like to use something like traditional version control where each one download a version of the site, do some changes and update the repository. Is there a way to do something like this? We suspect that we are using the LARs in the wrong way or maybe it is not meant to be used like this. Any solution? Thanks in advance.
Back up your database, check that in to your version control, The restore the database.
All the information required for a Liferay site is in the database (and the custom plugins if you're using them).
So I'd use backing up and restoring the database as your solution.