Is it possible for a rule in SonarQube to be active only for files which were created after specific date?
I have a rule which checks for particular suffix in classes' name but I want it to work only for classes which were created as an extension to the existing system not for classes present there out of the box.
Is there any known approach to do it? Maybe a plugin for Sonar which allows such thing?
You don't need such complex feature, all you need is to use SonarQube the right way, by focusing on fixing the leak !
You'll find more details in the documentation, and also in this blog entry.
Related
I'm wresting with SonarQube reporting errors on C# files which I didn't write. For example, I might import a particular piece of code from an open source library where I didn't want to take the entire library as a dependency.
This usually raises a lot of SQ warnings.
Instead of dealing with these one by one, is there a way to just mark the entire file to be ignored? I'n thinking something similar to the new #nullable disable directive.
Thanks very much.
Yes, there is way to remove or better to say exclude the particular files from being analysed by sonarqube.
You can use the sonar.exclusionswhich is a sonar analysis parameter, using this parameter you can exclude files or folders.
Here is the article from sonarqube on this https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/
Is there a way to rename a Variable or Variable Group without breaking the references it already have in Tibco Business Works 5.x. Thanks.
A way you could do this is by editing the complete source code that is in XML. After taking a proper backup.
You could identify the variable or variable group XML tags to be renamed and rename them by using an advanced text editor with Regular expressions if is the case.
Once you rename everything you would have to open TIBCO Designer and go to the root location of the project and validate All. Validate the complete project.
A manual cleanup and re-built, testing would be required.
Avoiding changes in a massive scale is advised. Less Risk.
I have all my scenarios properly tagged and working.
I am trying to set it up so that depending on the goal that is set, only specific tags or feature files (whatever is possible) run.
I've looked at other related questions but didn't find one that seem to work for me.
I don't need to put anything conditional in as I've seen in a previous question that's not easily doable.
I did see in another question they found a way of doing it my making a Cucumber.Run super class and passing in the needed options then but there weren't further details.
And recommendations would be great.
I tried using various profiles/builds to exclude all but the desired feature file but Cucumber.Run seems to ignore that after my research.
To make it clear, basically I have:
File1.feature
#scenarioForFile1
----------------
File2.feature
#scenarioForFile2
----------------
File3.feature
#scenarioForFile3
And I need to control which set of tests is kicked of either by scenario or file name.
After another day of research I was able to find the answer and feel stupid because I've looked at the usage docs several times but thought I couldn't do what the example showed in my use case.
Now I just have various build set up that run the project using different tags in the command line argument. I thought it was necessary to use the pom but it was not.
Used the below two links:
https://github.com/cucumber/cucumber/wiki/Tags
Maven running cucumber specific feature files or folders
Is there a way to get SonarQube to raise a violation if certain files/folders are found in source?
For example, specifically-named configuration files which contain sensitive data (e.g. passwords) should not be included in version control, and neither should IDE-specific configuration directories like IntelliJ's ".idea" and Eclipse's ".settings" folders.
(Side-note: I'm aware these can/should be part of a global ignore in version control - but that's not what I'm asking about)
I'd like SonarQube to raise a violation during analysis if any of a set of files/folders exist, preferably using a regex-or-similar pattern to do the checking.
I've read up on the fact that SonarQube plugins can be written in Java, but this seems such a simple concept (and one I'm sure isn't unique) that I'm a little surprised I haven't been able to find any existing rules or plugins. The closest I've found is sonar-text-plugin, though that focuses on file contents rather than whether files exist at all.
Before I go reinventing the wheel, is there something pre-existing which could offer this?
SonarQube version 4.5.7 - upgrading is an option if there's no other route.
I do confirm that there is no such built-in feature in SonarQube.
You may be want to write a custom rule for the java plugin.
I have many bundles (let's say hundreds) and it is quite difficult to specify relation between bundles+features-distrubutions in UI. Image, at first I define all relations between bundles, features and distribution. Than I want to update some bundles... it is almost impossible to find them in current implementation of UI. They are not groupped and one list of all bundles without any search bar is really hard to work with.
Is there any support for a file based solution. For example Apache ACE would watch a certain folder containing distribnution's bundles. When ever I make a change there, it would be propagate it to all targets.
There is currently no file based solution that matches what you describe, however, I think there are still a couple of solutions that might help you:
There are two types of associations between artifacts and features in ACE: static and dynamic ones. The latter can be of help to you, as they always automatically bind to the highest version of a bundle. So, once you've made all your associations, you can simply upload a set of newer bundles and the associations will adapt.
There is also a REST API you can use to programmatically talk to ACE. You can use that to further automate your process.
That said, you have a valid point that it is difficult to keep an overview when there are a lot of artifacts in the first column. I would advise you to watch, or even contribute to the following issues that were all created to improve this situation:
https://issues.apache.org/jira/browse/ACE-319
https://issues.apache.org/jira/browse/ACE-320
https://issues.apache.org/jira/browse/ACE-321