Where can I find a bug collection to import into FindBugs? - intellij-idea

I'm using the FindBugs-IDEA plugin for IntelliJ.
It finds much less bugs than our SonarQube (SonarQube uses FindBugs under the hood).
The plugin says I can Import/Export a bug collection from xml or html. Where can I find these collections?

If you want to import the same list of rules than what is configured in your SonarQube instance, you can go to "Quality Profiles > Your_Quality_Profile > Permalinks": you will find a link that you can use to download the list of Findbugs rules configured in your quality profile.
For instance, take a look at this page on Nemo: http://nemo.sonarqube.org/profiles/permalinks/169
Then, you just need to import this downloaded file in IntelliJ.

Here is a list of all the things you can check for: http://findbugs.sourceforge.net/bugDescriptions.html
You can find more info on how to use this info here: http://findbugs.sourceforge.net/manual/filter.html

Related

Cucumber with IntelliJ not finding step definitions

I encountered the following issue. I have four Cucumber feature files in IntelliJ. I added the Cucumber support via the IntelliJ plugin. After creating my features I edited my configuration like followed so i can execute the feature files.
Glue should be the name of the package the step definitions reside in. In my case the package is called stepdefinitions.
The following image shows what my project structure looks like. The feature files reside in /src/test/resource/features while the stepdefinitions are stored in /src/test/java/stepdefinitions.
Sadly when I try to run the cucumber features with the step definitions I get prompted "You can implement missing steps with the snippets below:" But I already did this. I already copied those snippets to the step definition files. When I hover a scenario IntelliJ tells me *Unimplemented Substep Definition".
Those two things lead me to the conclusion that IntelliJ does not find my step definitions. Maybe one of you knows what I am doing wrong.
I finally found the solution to my question. The error was caused by a plugin called Substep IntelliJ Plugin. You need to search for it in the IntelliJ Plugin Section and disable or deinstall it.
Try 'Invalidate cache and restart'. It worked for me - something the plugin gets stuck.
Disable the Cucumber plugin to avoid collisions over feature file association, install the Substeps plugin. See http://substeps.github.io/ for more docs on how to use the Substeps BDD framework alongside downloading a sample starter project from here: https://github.com/Substeps/substeps-example/archive/1.1.zip

IntelliJ PMDPlugin custom ruleset

I want to use custom rulesets with the PMDPlugin in IntelliJ 2016.1 (on Windows).
The Plugin page tells me
PMD supports custom ruleset file, to configure goto settings -> PMD and add the rule set files that are required.
but i can't find any setting to configure the PMDPlugin (I'm using version 1.7.7). In fact when i'm searching for PMD the only item listed in the search results of the settings menu is the Plugin itself. And under Tools -> Run PMD the Custom Rules are greyed out.
I found on this page a possible solution but it doesn't worked for me. And if it would i would like to change the rulesets for different projects and i don't want to modify the IDEA rules for each.
Also i found a solution to set PMD as an external tool, but i like how other plugins (e.g. Checkstyle-IDEA) integrate into the IDE.
I also checked the QA-Plug with the PMD extension but there you can just select the settings and don't specify a custom ruleset.
I think you are looking in the wrong place. Go to File > Settings > Other Settings > PMD and there should be a + sign like below:
From there you can add your own custom rulesets (*.XML files).
PMD Plugin Version 1.8
Support Idea 2016.1
As it was touched on by #dambros: The PMD plug within the QAPlug plugin is configurable by clicking
Tools->QAPlug->Analyze Code...->Run with chosen profile
The above answers assume you are using the PMD plugin and NOT the PMDplug plugin that resides within the QAplug suite.

How to import COM4j as Eclipse Plugin?

I am following the guide shown in https://molteni.wordpress.com/2012/10/16/connect-hp-quality-center-with-java-using-com4j-tutorial/ to generate resources of COM4J.
This is how the COM4J folder looks like
I tried to create an Eclipse plugin based on it and show as below
However when I added the plugin as one of the dependencies of my application I am unable to import the file.
I get the following error when I tried to search it through "Open Type" in Eclipse as follow
What steps am I missing here ?
Usually it is done like this: in Eclipse go to File ->
New -> Plugin Development -> Plugin From Existing Jar Files
Though it might not help in this case: please see this issue: https://java.net/jira/browse/COM4J-57
It sounds like you have not specified which classes are exported by the plugin.
Open the MANIFEST.MF editor for the plugin and select the Runtime tab. In the 'Exported Packages' section click Add and select all the packages which should be available to other plugins.

IntelliJ plugin : How to import settings

In IntelliJ 12 (possibly earlier versions too) it is possible to import a jar with settings, previously exported.
I would like two write a plugin to specify a location where this settings jar can automatically be imported from. That would allow you to put a jar in your repository and in that way share it with your team.
With the lack of online javadocs for the open-api, I've had a hard time working out how to do this.
What class in the plugin framework will allow me to import settings?
The ImportSettingsAction is the class that provides the import action in the File menu. I bastardized it for my own purposes.

Differenct Findbugs behavior with QAPlug-findbugs and gradle configuration

I am working on a Java project. I am using IntelliJ Idea 12.1.4 as IDE.
I verify the quality of code two ways,
I have installed QAPlug-FindBugs plugin in IntelliJ idea and I analyze the code using
a custom analysis profile. This profile has only one findbugs rule activated.
I have applied findbugs plugin in build.gradle file of the project. I
run gradlew check command.
These two approaches result into different number of findbugs warnings/errors. Actually, gradlew check results into lot more errors/warnings than QAPlug -> Analyze Code.
I understand that when I mention apply plugin : 'findbugs' the effort level is set to Default value.
I tried to figure out the relation between gradle plugin and Intellij Idea plugin. I am not able to figure out what coding rules should be activated in my custom profile (for QAPlug -> Analyze Code action) to match the behavior of 'gradle check'.
Can anybody give me a pointer as to what's going on?
Vijay,
I am not sure if you are looking for information about QAPlug or Gradle.
In case of QAPlug please check following tutorial:
Creating your own analysis profile
Regarding the Gradle, I found the following information:
"By default, all detectors which are not disabled by default are run."
Gradle FindBugsExtension
To have the same number of Findbugs warnings/errors you should do the following:
deactivate all rules in you custom QAPlug analysis profile
using search box find those "Powered by Findbugs" and activate them
I hope that it helps.