So we use Jenkins in conjunction with MS Build to build our projects. We also have a warnings plugin and a large number of warnings in our projects. I am trying to fight with these warnings. One of the steps which I would like to take is to mark build as unstable when number of warnings in the last build is greater than in the previous one. Maybe I should go even further and mark such build as a failure but I guess the mechanizm will be the same for both of marks.
An example screenshot:
I could not find any info on the web how to do this. I know that some plugins for scanning log files exist, but those plugins would have to also scan logs from previous build and allow me to calculate difference in warnings.
Thanks for any help.
The warnings plugin does have some capability to do some of this. Under the "Advanced..." settings, there are two configuration options to look at:
Health Thresholds - "Configure the thresholds for build health"
Status Thresholds - "If the number of total warnings is greater than one of these thresholds then a build is considered as unstable or failed."
If you then check the "Compute new warnings" checkbox, you will get an option to set the status thresholds based on new warnings.
Related
Coverage is a plugin for IntellijIDEA (going back many releases). It captures code coverage statistics for a given run configuration.
According to the documentation we should be able to append the results for multiple runs either by selecting it as the default behavior or by having Intellij prompt for the settings before applying coverage to the editor.
But the settings never seem to get applied. If I choose to be prompted; I'm never prompted. If I choose to append them; they're never appended. One member on my team says they are prompted but the results do not reflect their choice.
I've tried everything I can think of:
Manually changed settings for Coverage in my workspace.xml file
Deactivated and reactivated Coverage
Uninstalled and reinstalled Coverage
Tried using the other runners for Coverage (Emma and JaCoCo)
Even uninstalled and reinstalled Intellij with hopes I was carrying around faulty settings from a previous install.
Nothing works.
Am I missing something obvious; how do I configure Coverage to append coverage suites? I'm thinking it's a bug but is there perhaps some workaround possible?
There's a workaround but it doesn't involve appending the suites and it's a bit ugly.
I can't find a way to fix appending suites but coverage is applied to run configurations. So, what you can do if you have an existing suite you want to add to, you can add another run configuration and run with coverage to generate a suite for that run.
What you end up with is a number of suites you then have to merge; the merging functionality in Coverage works. Note that no coverage suites are appended; no new files are generated. It simply merges the results into the coverage view allowing a total report to be generated.
To view merged coverage data:
Press Ctrl+Alt+F6
Choose one or more coverage suites to merge
Click "Show selected"
A view of the merged suite data should appear in the editor.
Is there any way to run inspections in real time in intellij, rather than just having to select Analyze > Inspect Code. In particular, I'd like to do real time codenarc analysis (similar to how Eclipse does with checkstyle) so when I save a file it tells me if there are violations. I downloaded the codenarc plugin, but it doesn't seem to support that explicitly.
If you go to settings -> inspections, you will see there is a bunch of CodeNarc entries that you can tick.
I recommend creating a separate inspection profile if you use CodeNarc in a Continuous Integration tool, so you can focus on violations that would break the build.
Now it is true that you have to analyze the code explicitly the first time, but then it happens on the fly, and by right clicking you can also disable a given inspection or re-run it on other parts of your code.
Maybe it is a stupid question, but I cannot find out where can I config the minimal lines of code for duplication check in SONAR. In project settings there is only a switch to turn on cross project check. Any ideas?
B.R.
We have an open ticket on this: http://jira.codehaus.org/browse/SONARJAVA-91
As a background: Sonar has been using its own duplication detection mechanism since end of 2011 (from Sonar 2.11 IIRC). At that time, a decision was made that the number of lines or the number of tokens should not be configurable, in order to prevent the possibility to fool the engine. However, as the detection mechanism has not reached perfection yet ;-), we will allow to set "sonar.cpd.java.minimumLines" property in the mean time.
this feature is only available for languages other than Java ( http://docs.codehaus.org/display/SONAR/Analysis+Parameters#AnalysisParameters-Duplications )
Is there a way to configure which types of problems the XCode 4 static Analyzer tool reports and doesn't report?
I'm am dealing with some legacy code that "works" but has tons of static analysis issues, and am trying to list certain potentially more critical issues first.
I don't have a lot of experience customizing Clang (the static analyzer Xcode uses) myself, but this blog post seems to point to two different change you can make:
Turning off some individual warning types in the Build Settings
Using pragma to ignore specific warnings once you're aware of the right argument
While these options don't really provide any method of "prioritizing" the warnings, you can at least temporarily ignore the ones that you know to be less critical.
In Xcode 4, under project or target Build Settings, near the bottom, are the settings for the Apple LLVM compiler x.0 - Warnings and Static Analyzer - Checkers. In those build settings, one can turn off or on various warnings that the Product Analyze menu generates, such as report Dead Stores, etc.
I am having a CI setup with incremental build. As part of the static checking, I am planning to configure a incremental PC Lint report - This report ignoring all other previous Lint report should provide the errors induced in the new code only. Is there any tool which would do this?
Any hint on the relative area to explore would help us.
I tried report diff'ing. But since the line number would vary from last check-in, would not get the actual incremental error introduced.
I am using Linux for my project build, and using Windows for PC Lint report generation.
Regards,
Wouldn't it be easier to just fix all the reported errors, and have a strict policy against creating new ones? That way you don't need to worry about diffs which by the nature of the problem is going to be hard to impossible.
You could write a script that takes the warnings from lint, removes the line numbers and adds a few lines from the source code around where the warning occurs. Diffing this would show all new lint warnings. One flaw in this, is that it would also show any warnings where source was modified near an existing warning without fixing the warning. On the other hand, this might actually be useful.
Years ago, I saw a utility on BDS Unix that would take your compiler errors and stuff them into your source code as comments. Which might be useful for this exercise. Unfortunately I can't remember what it was called.