Response
stringlengths 8
2k
| Instruction
stringlengths 18
2k
| Prompt
stringlengths 14
160
|
---|---|---|
You can install all the community language plugins you like under the Community Edition. What this page is saying is that you're more likely to be successful running without support in small, simple environments, such as a mono-site, mono-language development environment.
|
I need some clarifications about Sonarqube community edition licensing.Editions comparison web page "http://www.sonarsource.com/products/editions/" say that the community edition is "Single Technology".I'm not sure to really understand this. Does it means that on community edition I will not have right to install Java and C# plugin on a same instance of SonarQube server ?Or perhaps I can do this, but will have restricted features in comparison of Enterprise Edition ?Regards,
Laurent.
|
SonarQube community edition licensing
|
This is really straightforward:Make sure that your build server runs SQ analyses with non-emptysonar.loginandsonar.passwordpropertiesUsually, the user corresponding to thissonar.loginis atechnical userIn the SQ Web Administration console, go to "Security > Global Permissions" and make sure that only the user corresponding tosonar.loginhas the "Execute Analysis" permissionNote that this can (or I'd even say "should") be done even on versions older than 5.2.
|
TheRelease notes for SonarQube 5.2indicate that scanners no longer access the database directly.With SonarQube 5.1, it's possible to ensures that the dashboard only ever shows reports on code in version control by configuring the database to only accept connections from the build server.With SonarQube 5.2, I wouldn't expect this approach to work, because scanners aren't connecting directly to the database.How can SonarQube 5.2 be secured so that only the build server can update the results shown on the dashboard?
|
How to secure SonarQube 5.2?
|
The property you referred is used to define the working directory within the project being analysed.The problem you are having is related to the sonar home directory, which is usually global per user and located in~/.sonar.Try withsonar.userHome.The path is defined here:https://github.com/SonarSource/sonarqube/blob/master/sonar-batch/src/main/java/org/sonar/batch/bootstrap/GlobalTempFolderProvider.java#L95
|
With sonarqube 5.2, it uses Files.createDirectories which does not like if the last part is a sym link.https://bugs.openjdk.java.net/browse/JDK-8130464Caused by: java.nio.file.FileAlreadyExistsException: /home/bamboo/.sonar
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:88)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:383)
at java.nio.file.Files.createDirectory(Files.java:630)
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:734)
at java.nio.file.Files.createDirectories(Files.java:683)
at org.sonar.batch.bootstrap.GlobalTempFolderProvider.createTempFolder(GlobalTempFolderProvider.java:83)
... 92 moreHow are you supposed to specify the working directory? I've tried sonar.properties using the key sonar.working.directory but that did not seem to work.https://github.com/SonarSource/sonarqube/blob/master/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java#L457Thanks in advance for your help.
|
Sonarqube 5.2 doesn't like working directory as a sym link. How to specify the working dir?
|
No, in Eclipse there is no refactoring therefore. And hence no Hotkey either.The only thing that comes close to this is the 'invert equals' quick fix. If you have a line of code like thisfoo.equals( bar );You can position the cursor on theequalsmethod and useCtrl + 1>Invert equalsto swap foo and bar tobar.equals( foo );But again, this refactoring is restricted toequals. If you think this is a generally useful feature, I recommend to open an enhancement request.
|
I would like to know if a hot key exists which switch members of method:property.compareTo(BigDecimal.ZERO)Use hot key:BigDecimal.ZERO.compareTo(property)It would be great to quickly revolve sonar alerts.
|
Hotkey in Eclipse to switch member of method
|
This type of projects are not yet supported by the SonarQube Scanner for MSBuild, but there is a ticket to add its support:https://jira.sonarsource.com/browse/SONARMSBRU-167
|
I am using dot net 4.6.1 and dnx Rc1 Update 1 so i have project extension as webapplication1.xproj.When I am trying to execute sonar runner, I am getting this project as Skipped one. At end step, getting this information:MSBuild SonarQube Runner Bootstrapper 1.0.2.0
Default properties file was found at C:\adid\MSBuild.SonarQube.Runner- 1.0.2\Sona
rQube.Analysis.xml
Loading analysis properties from C:\adid\MSBuild.SonarQube.Runner- 1.0.2\SonarQub
e.Analysis.xml
Post-processing started.
MSBuild SonarQube Runner Post-processor 1.0.2.0
No analysable projects were found. SonarQube analysis will not be performed. Check the build summary report for details.Generation of the sonar-properties file failed. Unable to complete Sonar Qube analysis.
20:35:04.487 Creating a summary markdown file...
Post-processing failed. Exit code: 1Details of the build logs given below:
|
Sonar Qube Analysis for DNX Projects
|
I changed the sonar.tests property to point to the .java files, problem is now resolved.
|
I am trying to associate junit test results with SonarQube.Here is what I have for Sonar Properties:sonar.projectKey=FXX
sonar.projectName=FUTURE_Jason
sonar.projectVersion=12.9.0
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.tests=test-build/junit/classes/
sonar.junit.reportsPath=test-build/junit/reportsWhen executing a Jenkins job associated with SonarQube, I am receiving the following warnings:13:52:12.923 INFO - Sensor SurefireSensor
13:52:12.924 INFO - parsing /var/lib/jenkins/jobs/FUTURE_SONAR_Jason/workspace/test-build/junit/reports
13:52:13.472 WARN - Resource not found: msc.rc.model.AbstractTrackingUpdateTestIn the Jenkins workspace I have the directory test-build and it includes both the reports and classes.$ ll /var/lib/jenkins/jobs/FUTURE_SONAR_Jason/workspace/test-build/junit/classes/msc/rc/model/AbstractTrackingUpdateTest.class
-rwxr-xr-x 1 build build 9590 Dec 14 14:39 /var/lib/jenkins/jobs/FUTURE_SONAR_Jason/workspace/test-build/junit/classes/msc/rc/model/AbstractTrackingUpdateTest.classAny idea what I am missing?
|
"Resource not found" trying to add junit tests into sonarqube
|
The property issonar.updatecenter.url. Default value is indeedhttp://update.sonarsource.org/update-center.properties.
|
Our security team does not allow the machine hosting SQ to access the web be it directly or through a proxy. Instead they decided to retrieve on a daily basis theupdate-center.propertiesfile found athttp://update.sonarsource.org/update-center.propertiesand make it available on an internal web server on an URL such as http:///sonarqube/update-center.properties (I have to follow this decision... so please do not tell me that it's not the way you would have achieved security as it is out of my reach.)Is there a way to configure SonarQube's update-center URL / host (version 4.5.4 LTS) ? If yes please explain how this can be achieved.Thanks in advance.
|
Is there a way to configure SonarQube updatecenter url
|
This feature was dropped with 5.2Drop the Design related services and metrics
|
In the older version of Sonar, there was a Dependencies or 'Library cartography' page, but I can't seem to find it in 5.2 - anyone know where it might be?http://www.sonarqube.org/sonar-2-1-in-screenshots/http://docs.sonarqube.org/display/SONARQUBE45/Managing+LibrariesThe reason/usecase was to have a single location when there may be a library (commons logging like the example, or commons collections when there is a vulnerability for example) to find all projects that contain that dependency.
|
SonarQube 5.2 - where is Libraries / dependencies page?
|
Issue is resolved . 2 things fixed the issue.Creating a user with the required permissions.Installing "Issues Report" plugin
|
I am trying to run SonarQube using Sonar runner in local dev box for pre-commit check. We have a central SonarQube server where a analysis is done every day and published to the dashboard. When we are running on local dev box everytime the the issue report contains all the issues asnewhence incremental data is not available. I have also tried both incremental and preview mode but the result is some.Please find below the version of the tools used.And also configuration files. Please let me know if some other data is required.SonarQube version : 5.1
Sonar Runner version : 2.4sonar-runner.propertiessonar.host.url=http://[centralsonar server]:9000/sonar.issuesReport.html.enable=truesonar.login=adminsonar.password=adminsonar-project.propertiessonar.projectKey=myProj:myProj-mastersonar.projectName=MASTER_PROJECTsonar.projectVersion=21.0sonar.sources=./srcsonar.binaries=./bin/sonar.issuesReport.html.enable=truesonar.exclusions=com/**/test/*.javasonar.skipPackageDesign=truesonar.profile=SonarWaysonar.preview.excludePlugins=devcockpit,buildstability,pdfreport,report,buildbreaker,views,jira,issueassign,scmstatsCommand Used :c:\sonar-runner-dist-2.4\sonar-runner-2.4\bin\sonar-runner -e -Dsonar.analysis.mode=preview -Dsonar.issuesReport.console.enable=true -Dsonar.issuesReport.html.enable=trueUpdated with additional properties tried as well. in sonar-runner.properties
|
Sonar preview mode all new issues
|
I'm not sure what typeinput.get()returns so I'll assume that the first cast is necessary. You don't need to instantiate newDoubleobjects on every line, you can just call its methods to return the correctly-typed values you need.Double value = (Double) input.get();
int integerPart = value.intValue();
double decimalPart = Math.abs(value - integer.doubleValue());It looks like you're just trying to extract the integer and decimal parts of a double, in which case this code expresses the intent a bit more clearly:Double value = (Double) input.get();
int integerPart = value.intValue();
double decimalPart = Math.abs(value - Math.floor(value));
|
How can I avoid using all that casts in my code in order not to have my value boxed/unboxed by sonar ?Here's my code :Double value = (Double) input.get(0);
int integer = new Double(value).intValue();
Double dec = Math.abs(value - (new Double(integer ).doubleValue()));I would like to avoid casting as much as I do, but I am not sure I can keep it boxed this way.Any ideas ?Thank you.
|
Double value is boxed and then immediately unboxed in Java
|
Sonar does not execute any tests itself. Therefore setting up Sonar to do what you want to achieve is probably not the thing you want to do.Instead the maven surefire plugin executes your tests. The surefire results are then pushed to sonar.Assuming you are using junit: as documentedheresimply say:@Test(timeout=1000)If you want a specific test to fail if it runs for more than 1000 milliseconds.If you want to define a timeout for all tests in a class, you must define a test Rule:@Rule
public Timeout globalTimeout = Timeout.seconds(10); // 10 seconds max per method tested
|
I'm using Maven to build a Java project. I'd like to fail the build if there are slow tests. How can I do this?
|
How can I set-up Sonar to identify slow tests and fail the build?
|
I would say you have to rethink your package structure. I thinkAis in another package thanBandC. SoCcan't access the protected method inAbut if you override it inB,Ccan access it.You could makeexecuteImpl()public inA.MoveA,BandCall to the same package orjust ignore this issue or mark it as false
positive with an explanation.
|
Approach one: Issue isDescription Assignee Resource New issue
- Useless Overriding Method : Overriding method merely calls super
- overrides
A.executeImplclass A {
protected void executeImpl(){
// blah blah
}}
class B extends A{
protected void executeImpl(){
super.executeImpl();
}}
class C{
@Inject B b;
protected void executeCall(){
b.executeImpl();
}
}if i remove overriden method:
Java Error:
The method executeImpl() from the type B is not
visibleclass A {
protected void executeImpl(){
// blah blah
}}
class B extends A{
}
class C{
@Inject B b;
protected void executeCall(){
b.executeImpl();
}
}What shall be my approach to remove the sonar minor issue .
|
Minor Issue when doing method overriding in SONAR
|
I have found some information in theSonar .NET documentation, which states, among other things, states that:"Certain types of project will automatically be excluded from analysis. For example, Microsoft Fakes generates additional projects during build. These auto-generated projects will not be analysed."and"Files that are generated by custom tools within Visual Studio are automatically excluded from analysis, such as the xxx.Designer.cs file generated from a .resx file:"I assume that our internal ORM tool falls into the latter category. Thus, that explains why those files are being excluded from the analysis.
|
I have set up a local SonarQube 5.1.1 server. I have also installed the C# plugin (version 4.1), as well as the MSBuild runner (version 1.0). I then performed two separate runs on the .NET codebase for the project I am currently working on:Using sonar-runner and the C# pluginUsing the MSBuild runnerBoth runs were made through the CLI. However, the runs yielded very different results. Here is an example: In the first run SonarQube calculated the number of code lines to be roughly 956 000, while in the second run it was calculated to be "only" about 434 000. I then did some digging, and it seems like the latter skips some auto-generated files. These files/classes were generated by an old, internally developed ORM tool.I thought that unless specified otherwise - by using include/exclude patterns - the MSBuild SonarQube runner would analyseeverysingle .cs file in a given project, but apparently that is not the case.Has anyone experienced the same "problem", and does anyone know what kind of auto-generated files that will be automatically excluded from an analysis?
|
MSBuild SonarQube runner skipping auto-generated files?
|
My problem was that coverage reports were generated on server different from wheresonar-scannerwas run, and the absolute paths inclover.xmldiffered.Solution was to fix the paths:replace="s|/home/bamboo/project/|`pwd`/|g"
sed -i -- $replace report/*.xml
|
I have been struggling with importing unit test results and code coverage from Jenkins into SonarQube. At this point, I have verified the results are being generated as they are displayed in the project's page in Jenkins.The sonar.properties file is shown below. The php results were created with phpunit and the code coverage was created with phpunit and clover. As an effort in troubleshooting, I included both sonar.php.coverage.reportPath and sonar.clover.reportPath.sonar.projectKey=projectKey
sonar.projectName=projectKey
sonar.projectVersion=1.0
sonar.language=php
sonar.sourceEncoding=UTF-8
sonar.php.tests.reportPath=report/phpunitresults.xml
sonar.php.coverage.reportPath=report/clover_code_coverage.xml
sonar.clover.reportPath=report/clover_code_coverage.xml
sonar.sources=./src/
sonar.exclusions=./src/tests/**
sonar.tests=./src/tests/
sonar.coverage.exclusions=./src/tests/**/*.phpAll of the results
Unit Tests Coverage
0.0%
Line Coverage
0.0%The Jenkins builds do not produce any errors or helpful information in identifying a problem as to why the results are not being imported.Can anyone help in troubleshooting the issue?Thanks.Ben
|
Jenkins PHP Unit Test and Code Coverage unable to import in SonarQube
|
Try forcing an older version (e.g. 0.7.3) of the jacoco-plugin to see if it makes any difference. This has helped for me with a similar problem. I think that there is a known issue in some version(s).
|
While trying to get a Sonar execution to import a jacoco-it.exec file that was produced on a server with the jacocoagent.jar, I get the following message:[INFO] [09:54:32.420] Sensor JaCoCoItSensor...
[INFO] [09:54:32.462] Analysing /../jenkins/jobs/../jacoco-it.exec
[INFO] [09:54:51.385]No information about coverage per test.I have verified that the jacococ-it.exec file itself does in fact have data in it (385 MB) so it definitely is capturing information, but sonar is not able to reconcile it and I need help fixing it.I am using:a multi-module maven projectSonarqube 4.5.1Jenkins Sonar Plugin 2.1Oracle 11gjacoco 0.7.4junit 4.11Sonar creates and uses the UT file jacoco.exec just fine, but I get 0% when it displays the IT results.[EDIT] - To further clarify1. we have the jacocoagent.jar monitoring a jvm on an application server2. a Jenkins job runs a group of selenium tests against the application server in #13. the jacoco-it.exec file is copied from the application server to a location that sonar can read. For this I am overriding the sonar it path for the jacoco plugin.4. I get the above messages that say that sonar can't find the coverage informationThe selenium tests are running as integration tests from mvn with:mvn org.jacoco:jacoco-maven-plugin:prepare-agent-integration clean package install
|
“No information about coverage per test.” from Sonar with Jacoco Maven build
|
+50This is a bug in the Sonar-Groovy plugin introduced with thiscommitMigrating the API to rules definition and using the latest version of SonarQube lead to ignore the sqale mapping alltogether.A ticket has been created to fix the issue :http://jira.sonarsource.com/browse/SONARGROOV-35
|
Upfront: I know there is already the same question on SO, but refereing to different version. (Sonar with Groovy project always reports technical debt of 0.0 days)I am trying to get SonarCube 5.1.1 up and running together with the groovy 1.1.1 plugin. Unfortunately, I always the technical debt of 0.0 days.The Sqale information is included in the groovy plugin, so it seems that this isn't the problem.Any other idea?
|
Sonar 5.1.1 with Groovy Plugin 1.1.1 project always reports technical debt of 0.0 days
|
The SonarQube CSS plugin now supports Less. Seehttps://github.com/racodond/sonar-css-plugin/releases/tag/2.2
|
I have been talking to less/css developers and they would like to do static code analysis on there less code. I was wondering if there is a plugin for sonar that can do this analysis on the less code instead of the generated css code?
|
Does a sonar less/css plugin exsit?
|
For Scanning phtml files, Please install PHP plugin, PHP plugin within SonarQube supports scanning of phtml files.Please find below the screenshot for the same.Please go to settings->PHP where you can see this settings.if you want to specify the same in project properties file, you have to add following the keysonar.php.file.suffixes= file extensionsAnswering you other question of embedded code analysis. This is not supported by SonarQube. It identifies the file extension and then scan for the same.
|
I did sonarqube analysis on DemoProject.
I am having phtml and embedded files in it.How to scan PHTML files?PHTML files contains some Javascript code.
Can we scan this javascript code?Can anyone suggest a solution for this?Is there any plugins available for the same?Note:- I already installed javascript plugin and web plugin
|
How to scan phtml and embedded javascript files in SonarQube?
|
For our own tests we are using a "secret" property that will dump all SQ properties in a file so that you can write assertions on it.-DsonarRunner.dumpToFile=out.propertiesSee for example how I wrote integration tests for the new Gradle SonarQube plugin:https://github.com/SonarCommunity/sonar-gradle/blob/master/integrationTests/src/test/java/org/sonarqube/gradle/GradleTest.java#L22
|
I am writing a custom Gradle plugin that applies the Gradle sonar runner plugin and defaults some of the parameters. I want to write a test to confirm that the properties are set correctly, but I cannot figure out how to access the data after it is set.I triedproject.getExtensions().sonarRunner.sonarProperties.getProperties()and a few variants, but this either throws a null pointer or returns something other than the sonar properties.Is it possible to read the sonar properties after they are set? How?
|
How can I read the gradle sonar runner properties from a gradle plugin?
|
Since there is a legit justification, I would suppress the warning:Either using the annotation:@SuppressWarnings("squid:S1109")
private DateUtils() {}or the comment:private DateUtils() {} // NOSONAR
|
I've formatted my empty private constructor for utility class as follows:private DateUtils() {}This triggered Sonarqube violation ofsquid:RightCurlyBraceStartLineChecksaying thatA close curly brace should be located at the beginning of a lineI do not entirely agree, as I just followed the convention from the most well-known utility classjava.lang.Math:private Math() {}Should I treat it as false-positive and bring Sonarqube team attention to this issue or Java sources violate the good practices and I should rather put this brace to new line?private DateUtils() {
}
|
Location of close brace in empty private constructor
|
You need to execute the coverage engine of your choice and provide the report to SonarQube via the appropriate property.If you are using JaCoCo, the report importer is embeded in the java plugin, for other coverage engine (clover, cobertura...) you have to install the dedicated plugin.For more information see thededicated page of documentation.
|
I am currently using jenkins to build a list of different modules for my project. I trigger the builds using Maven. I have sonarqube installed on the server and have set it up correctly so that when a module builds it is displayed on sonarqube and includes all of the basic details such as lines of code, technical debt etc. The modules all have Junit tests that run against them, and sonarqube displays this by saying that the Unit Test Sucess is 100% and it also says the number of tests that have been run in that module. However I cannot get the Unit tests coverage field to display anything and it is blank for all of the modules.Here is an exert (one module) from my pom.xmlcustomer.sonar.projectBaseDir=.
customer.sonar.sources=D:/TFS/WorkSpace/DEV_2_HYBRID/APP_FO/application/customer/src/main/java
customer.sonar.Hybrid=Customer
customer.sonar.tests=D:/TFS/WorkSpace/DEV_2_HYBRID/APP_FO/application/customer/target/surefire-reports
customer.sonar.junit.reportsPath=D:/TFS/WorkSpace/DEV_2_HYBRID/APP_FO/application/customer/target/surefire-reportsThe versions of the software I am using are as follows:
Sonarqube v.5.0,
Jenkins Sonarqube plugin v.2.1,
Maven v3.2.5As I said at the beginning the unit test success rate does show successfully, so I believe it is only a small change needed that will get the unit test coverage field working.Any help would be really appreciated!
|
Unit Test Coverage not displaying on Sonarqube - Running through Jenkins Sonar plugin - Test Success displays correctly
|
The best way to answer your question is to look directly at the source code of this rule :https://github.com/SonarSource/sonar-java/blob/c1f15b81bcd9d643ab403aeea6e1606040f84eac/java-checks/src/main/java/org/sonar/java/checks/ClassCouplingCheck.javaSo it counts every declared type. And so indeed if you use java.lang.Integer it will count as one type so 1/20 of the this rule's limit.The good news is that you can configure this '20' magical number in your quality profile.
|
How does the SonarQube rulesquid:S1200: Classes should not be coupled to too many other classes
(Single Responsibility Principle)count the coupling number towards its limit of 20?It seems like it counts classes from the standard Java packages likejava.lang.*,java.text.*andjava.util.*in this rule's limit of 20. So If I use the JavaIntegerclass, I've used up 1/20 of this rule's limit.Additional Info:
SonarQube Version: 4.5.1
|
SonarQube rule squid:S1200 counts java.* classes in its limit of 20?
|
it was due to the query. this is the right querySELECT metrics.description, root.name, COUNT(project_measures.metric_id) AS AmountOfFiles,
SUM(CASE WHEN project_measures.value < 200 THEN 1 ELSE 0 END) Less200,
SUM(CASE WHEN ((project_measures.value >= 200) AND (project_measures.value <= 1000)) THEN 1 ELSE 0 END) Between200And1000,
SUM(CASE WHEN project_measures.value > 1000 THEN 1 ELSE 0 END) More1000
FROM project_measures
INNER JOIN metrics on project_measures.metric_id = metrics.id
INNER JOIN snapshots on project_measures.snapshot_id = snapshots.id
INNER JOIN projects root on snapshots.root_project_id = root.id
WHERE metrics.id = '1' /*Line: code lines + comments + blanc lines*/
and root.scope = 'PRJ' /*projects*/
and snapshots.scope = 'FIL'
and root.name like '%' /* '%' to show all projects*/
GROUP BY root.name
|
I am aware I should not use the database directly from SonarQube, but this is a one-shot complex thing, and saves me days if I can do it directly from the database.I need to know the amount of classes per project, where the amount of lines is less than 200. So far no problem creating this in SQL.Only problem I have: for 2 projects, this information isn't stored at all in the database! In the GUI from SonarQube I can see this measure for each file, but than in the database these files have only 1 measures stored (technical debt).My guess is that for some strange reasons these measures are calculated on the fly for this project? Could that be? And is there a way to force SonarQube to store proejct measures for each file in the database? I tried with the sonar.analysis.mode=analysis parameter but that didn't work?Thanks a lot and regards,Pieter
|
SonarQube doesn't store all results in the database?
|
The Web Service does not allow to query this information.
|
For my release automation i'm creating a document generator that includes the current measurements from sonarqube. In this document i would like to report the differences between several versions of the code.
I managed to get the list of versions without any problem usinghttp://nemo.sonarqube.org/api/events?resource=org.codehaus.sonar:sonar&categories=VersionAnd i also managed to get a measurement of the current code state usinghttp://nemo.sonarqube.org/api/resources?resource=org.codehaus.sonar:sonar&metrics=nclocCan anybody help me in how to get thenclocof an older version, say version '4.0'?
|
How can i get a metric from a specific version in sonarqube using the webservice api
|
I could fix the issue by deleting the java file and create a new file with the same contents.
|
I am facing an issue when trying to run the sonar analysis. It is failing with the following exceptionCaused by: org.sonar.api.utils.SonarException: Fail to decorate 'org.sonar.api.resources.File@4959e9b7[key=src/main/java/com/mycompany/myproject/common/entities/beans/CountryBean.java,deprecatedKey=com.mycompany.myproject.common.entities.beans.CountryBean,path=src/main/java/com/mycompany/myproject/common/entities/beans/CountryBean.java,dir=com/mycompany/myproject/common/entities/beans,filename=CountryBean.java,language=Java]' at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:103)The complete error stack trace ishttp://pastebin.com/zuTH61q9How do I fix this issue? I have another project which is working fine without any error with the same configuration.My sonarqube version is 5.0
|
Fail to decorate - Sonar Analysis
|
I think I may have figured it out.I just had to manually insert a new row into the rules_profiles database table with a key that matched the one in the error. Then go back into the online interface and delete that profile.
|
I have a rule in my SonarQube that has no Quality Profile associated with it in the search list (The red boxhere). When I try to change it I getthis error, and when i try to click the Deactivate button, nothing happens.I tried adding a Quality Profile with that name and then changing it, but I think that name might refer to the ID instead of the readable name so that didn't work.How would I go about removing a rule that has a missing Quality Profile?
|
SonarQube: Cannot deactivate rule with missing quality profile
|
There is a know issue with PowerMockito and code coverage computation. PowerMockito should be used sparsely anyway. The reason Mockito doesn't offer the functionality PowerMockito does offer, is mostly that Mockito tries to make you focus on good, testable code (which static and final is not).
In the few places where I used PowerMockito and the code coverage was not calculated correctly, I have programmed a little Reflection Util class that would allow me to remove static and final from attributes. After having done that, I can mock the attributes just like regular instance attributes and the code coverage is calculated correctly. I do this for static final Logger log attributes, for instance, like this:[...]@Mock
private Logger logMock;[...]@Before
public void initMocks() throws Exception {
MockitoAnnotations.initMocks(this);[...]ReflectionUtils.setFinalStatic(MyClass.class.getDeclaredField("LOG"), logMock);The Code of the ReflectionUtils class I cannot post here, but examples can be easily found online.P.s. On a side note, if you have a gap of 80% to 35%, meaning you have 45% code that is static and or final, it seems to me personally you have a big design flaw with your code, that you should fix before tweaking your code coverage measurements in Sonar...
|
I have write multiple JUnit test classes for my project.The code covergae is 80% when I see it in Eclipse using cobertura plugin.But when I try to see my code coverage in Sonar it show only 35%.The reason behind this is that multiple classes have 0% coverage and some classes shows coverage.What is the main reason I don't know.Is it problem of sonar or there is some problem im my code beacuse somewhere I am using PowerMockito somewhere EasyMock and somewhere Mockito.I am attaching the snapshots of both the coverage one shown by cobertura and one shown by Sonar.
Kindly help me.Thanks
|
Cobertura Showing proper coverage but In sonar many files showing 0% coverage
|
The only way to achieve what you want to do will be to use theSonarQube Web Service APIwith curl.But:Only thequality profiles can currently be managed with the WS API, not the dashboards.You will have to explicitly pass admin credentials to the curl command - which might be a security issue for you
|
I'm running SonarQube 4.5.1 on Debian and I'd like to configure dashboards and rule profiles viaAnsible.To do this, I can't use SonarQube's GUI but I have to use the command line to edit configuration files or call a CLI (like the one Jenkins has).I couldn't find a file in/opt/sonaror below that defines the dashboards or rule profiles.Is there a way to configure SonarQube using only the command line?Thanks!
|
Configure SonarQube using command line
|
This is not possible for the moment: a ticket has been created to support it:http://jira.codehaus.org/browse/SONARCHKST-22
|
I want to enable the usage of@SuppressWarningsin sonar like described in this answer:How to disable a particular checkstyle rule for a particular line of code?But the only part where I can configure checkstyle specific behaviour in sonar is under Project Configuration -> Settings -> Java -> CheckstyleWhen I add this configuration to the Filters Textbox:<module name="TreeWalker">
<module name="SuppressWarningsHolder" />
</module>
<module name="SuppressWarningsFilter" />Then it doesn't accept the@SuppressWarnings. Is there a way how to configure this in sonar?
|
Use @SuppressWarnings with the sonar checkstyle plugin
|
I found an old bug in the SonarQube issue tracker (http://jira.sonarsource.com/browse/SONAR-3579) that describes the same problem, it is indeed a compatibility issue. It is suggested as a workaround to unset GEM_PATH and GEM_HOME variables before launching Sonar.I put the following two lines into the sonar startup script:unset GEM_PATH
unset GEM_HOMEA restart of the sonar service solved the problem for me in SonarQube Version 5.1.1 and SonarQube Runner 2.4.
|
When I try to run sonar-runner from the command line for a project, I get a 500 error:INFO - Install plugins
INFO - Install JDBC driver
INFO - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 12.320s
Final Memory: 7M/152M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Fail to download [http://localhost:9000/api/server]. Response code: 500UpDateI think this is caused by conflit with local ruby version as I have in sonar.log this description:ERROR web[o.s.s.ui.JRubyFacade] Fail to render: http://localhost:9000/api/server/index?format=json
undefined method `generate' for #<JSON::Ext::Generator::State:0x10b4e1f2>
/Users/me/.rvm/gems/ruby-1.9.3-p448/gems/json-1.8.1/lib/json/common.rb:223:in `generate'
/Users/me/.rvm/gems/ruby-1.9.3-p448/gems/json-1.8.1/lib/json/common.rb:470:in `JSON'How can I fix this? Thanks
|
sonar unable to create JDBC datasource
|
In yoursonar.properties, you have:#--------------------------------------------------------------------------------------------------
# SEARCH INDEX
# Elasticsearch is used to facilitate fast and accurate information retrieval.
# It is executed in a dedicated Java process.
# JVM options. Note that enabling the HotSpot Server VM mode (-server) is recommended.
#sonar.search.javaOpts=-Xmx256m -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true \
# -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 \
# -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError \
# -Djava.awt.headless=true
# Elasticsearch port. Default is 9001. Use 0 to get a free port.
# This port must be private and must not be exposed to the Internet.
#sonar.search.port=9001Uncommentsonar.search.portand set it to 0.
|
I am facing the below error when i try to start the sonar by using a mysql. Do i need to modify any details in the sonar.properties file with respect to the elastic configurations ?Has anyone face a similar error before ?014.12.15 21:38:49 WARN sea[o.e.transport.netty] [sonar-1418659692862] exception caught on transport layer [[id: ,9001]], closing connection
java.io.StreamCorruptedException: invalid internal transport message format
at org. elasticsearch.transport.netty.SizeHeaderFrameDecoder.decode(SizeHeaderFrameDecoder.java:46) ~[elasticsearch-1.1.2.jar:na]
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425) ~[elasticsearch-1.1.2.jar:na]
|
Sonar launch error
|
I had the same problem while using SonarQube 3.7.4 (LTS) on Windows. I solved it by using Oracle's JRE 7 instead of JRE 8.When looking into the SonarQube documentation, it says that SonarQube analysis and SonarQube server require some specific versions of the JVM to be executed. Version 8 is only supported since SonarQube 4.3. (Source:http://docs.sonarqube.org/display/SONAR/Requirements)
The following page reports of the issue:https://jira.codehaus.org/browse/SONAR-5191To change the JVM which SonarQube uses, you can modify the wrapper.conf file in the conf folder of the sonar package. More specifically, change the line wrapper.java.command=java to point to the path on your machine where an version older than 8 is installed.
|
Whenever I try to click the "Configure widgets" button, SonarQube displays the "We're sorry, but something went wrong." page. Everything else works fine.Has anyone had the same problem and found a solution? Or should I reinstall?Thanks in advance.
|
Configure widgets on Sonar does not work
|
The documentation is not up to date. Since SonarQube 4.4, custom rules are managed from the "Rules" space (directly accessible through the top navigation bar).
|
I am logged in as an administrator but I can't seem to find the menu to add new custom XPATH rules.I'm following the steps from the link below :http://docs.sonarqube.org/display/SONAR/Extending+Coding+Rules"Once your new rule is written, you can add it SonarQube:
Login as an Quality profile administrator
Go to Quality Profile
Select one of the quality profiles for the language you wish to add the rule to
Look for the XPath rule template:"I'm using sonarqube server 4.4.1This is my Rules Tab:Where is it located in that version?
|
Custom rules menu doesn't seem to be present
|
The SonarQube Eclipse plugin lets you associate (and locally analyze) projects that have already been analyzed by other means (maven target, ant task, SonarQube runner). It is not meant as a way to launch persisted (shared) analyses.So if you want to use the SonarQube Eclipse integration, please do a first analysis of your project, then try to associate it from Eclipse. This will allow you to synchronize the issues and perform local (preview) analyses.[EDIT]
On recent (4.x) versions of SonarQube, you also have the option to provision your project on the server. This will allow you to associate your Eclipse project and perform preview analyses.
|
I am trying to integrate sonarqube with eclipse to analyse simple java project.
But it is not happing. When we right click on simple java project and hit Configure-> Associate SonarQube, the window appear where field appear like Project and SonarQube project.
Project field is autopopulated with the java project you right clicked and What we need to enter in SonarQube project is not clear to me. Also no tab is appearing where we can do something like SonarQube -> Analyse.
(I have added sonaqqube plugin in eclipse and also set sonarqube server path to localhost:9000)
Please suggest.
|
SonarQube Integration with Eclipse: Associate with SonarQube option not working for simple java project
|
With version 2.4 of the java plugin you have to generate the coverage report before running the SonarQube analysis. You can see this pagehttps://github.com/SonarSource/sonar-jacocoabout how to do this.
|
I have a multimodule project with a parent pom.xml and two modules in it. Project.jar and Project.war. All the test cases are under Project.jar. When I run mvn sonar.sonar goal on the Parent pom, jacoco.exec is not getting generated and code coverage is blank. I have the following properties in the parent pom.<properties>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPath>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportPath>
</properties>Please help. I am using Sonarqube 4.2.
|
Sonar maven jacoco code coverage for Multimodule project
|
There are several ways. SeeFrequentlyAskedQuestions-NOSONARand further down that page to see both a comment (//NOSONAR) and annotation (@SuppressWarnings) options, as well as some other ways to disable checking.
|
Some lines of codes don't need to be checked by Sonar (Sonarqube.org). How can I just disable checking on these lines? Is there any way like just addding annotation "@" to make these lines invisible for Sonar? Thank you!
|
How to disable Sonar-Check in codes
|
Quality Gate conditions can actually be created based on manual metrics, but some metric types are not available: DATA, RATING and (obviously) Quality Gate status.
|
I am using some manual metrics on my SonarQube Project. I want to use my own manual metrics as a condition on a Quality Gate. I searched through documentation and internet. I could not find anything about the topic. The SonarQube allows to use only system metrics. Are there any way to use Manual Metrics on a condition in QualityGate ?
|
SonarQube Quality Gates for Manual Measures
|
Since the error message isRule not found: [repository=c-cppcheck, key=selfAssignment]Rule not found: [repository=c-cppcheck, key=returnTempPointer] ....I assume that you try to check c++ code.Are your c++ plugins of the same version?
Are your sonarqube-servers of the same version?Compare server´s and plugins´ version of your export and import installation.
|
I am trying to import a quality profile that is in xml-format. My SonarQube runs fine with the quality profile that is in jar-format, but it does not import the xml whatsoever.It is not just one xml that is causing the problem. When I back up a working quality profile (originated in jar-format) and restore it, it causes a similar problem.SonarQube version: 4.3.1DB: psqlOS: red hatSteps taken:Downloaded xml created from other computer (I believe it was made in red hat linux as well)Log in as admin. Go to Quality Profiles -> Restore Profile -> selected xml back up profile.Error message show up:Rule not found: [repository=c-cppcheck, key=selfAssignment]Rule not found: [repository=c-cppcheck, key=returnTempPointer] ....Other things I tried:Download opensource quality profile. Back them up and it create xml. Using xml backup file to restore. result is same "Rule not found" messageEven tried using curl to upload profile but it gave me a similar errors.
It actually gave more than just 4 error message. They were all about Rule not found.Tried to remove SonarQube and install. Same.Dropped db and recreated to see if that makes any change. Same.SonarQube Doc. says it is possible. I am not sure what I am doing it wrong.http://docs.codehaus.org/display/SONAR/Profile+Existence+Edits#ProfileExistenceEdits-Backingup/RestoringaProfile
|
SonarQube - cannot do Restore Profile
|
The c++ community plugin will by default import any c files found under project dir, the parsing will be done using a compatibility mode (so it might not be complete). Default properties and values for this to work are:sonar.cxx.cFilesPatterns -.c,.Csonar.cxx.suffixes.sources - .cxx,.cpp,.cc,.csonar.cxx.suffixes.headers - .hxx,.hpp,.hh,.hSee details in documentationwiki
|
I want to get a clarification that this plug-in only works for C++ and won't work for C. I tried to run with C code in the src directory and it doesnt return anything unlike the C++ projects.Anyway for me to run C code for free (Community versions), my cppcheck
|
Sonar C++ Community plug-in
|
@Tim, with Sonar Runner you can't drive the way SonarQube generate the keys for each module so you won't be able to have the same keys used by the Maven SonarQube Runner. And so you will lose your false-positives, historical data, configuration ...
|
I currently analyze a multi-module java project with sonarqube 4.3 using maven. The structure of the analysis´ configuration is:root-pom.xml
-module1
--module1-pom.xml
-module2
--module2-pom.xmlSo what I did was rebuilding the whole configuration in 1 sonar-project.properties following themulti-module ProjectSection ofthis documentationIt is most important to me, that I can continue with my historical data, false-positives etc.Currently, I am experimenting with a test system. It seems to be possible to just switch the analyzer, keeping the old data.What I ask for, is some reassurance or a link to a documentation how to switch between analyzers. Thanks.UPDATE concerning controlling the keys:My root-pom.xml defines the key as<groupId>de.company</groupId>
<artifactId>product</artifactId>The module-pom.xmls define the modules´s key as:<groupId>de.company</groupId>
<artifactId>module1</artifactId>My new sonar-project.properties for switching to sonar-runner looks loke this:sonar.projectKey=de.company:product
sonar.modules=module1, module2
module1.sonar.projectKey=de.company:module1
module2.sonar.projectKey=de.company:module2With that configuration, it seems to be possible to continue the analysis of the maven analysis with sonar-runner.
|
Possible to switch SonarQube Analyzer from Maven to Sonar-Runner?
|
A very simple solution existed. It is required to start sonar manually. Apart from the Eclipse plugin, I also had sonarqube installed on my mac. Just cd to the sonar installation directory and start the server.
And then test the connection in Eclipse. It works.
|
I installed the Sonarqube plugin in Eclipse by following the instructionshereFollowed all the steps, restarted Eclispe. Was able to have Sonarqube in Preferences. But when I go to the servers tab to configure the server (default athttp://localhost:9000) the test connection fails with the following error:Unable to get version of server http://localhost:9000: Query: http://localhost:9000/api/server/indexI read almost all troubleshooting questions. Any suggestions?
|
Sonarqube eclipse plugin server does not start
|
If you have administrator permissions, you can turn any rule on or off (or sometimes reconfigure it) in the quality profile. Navigate to your quality profile, find the rule you want to disable, and turn it off.Seehttp://docs.codehaus.org/display/SONAR/Configuring+Rulesfor full details.
|
In my current project we have used a lot of comments explaining what the code does and so on. While running sonar for this these comments are causing lot of issues, I wanted to know if there is a way to disable comments check in sonarqube.
|
Disabling sonarqube rules on comments
|
Ok, that's it. Set "Coverage, Delta since last analysis, less than, 0". The "0" goes in the error field, if this should cause an error.
Thanks Disco 3
|
I'm using SonarQube 4.3 and try to get a quality gate (formerly known as alerts) working which fails when the integration tests coverage has decreased since last analysis.Does anyone know how to get to this?
|
Fail SonarQube quality gate when coverage decreases
|
You should probably change your java version. Sonar 3.4.7 (which is the latest stable version) runs correctly with java 7.
|
I've downloaded a SonarQube 4.2 and analyzed a project locally. After that, everytime I clicked "Quality Profiles" I got "We're sorry, but something went wrong.", even though the settings on the project itself show three profiles to be present already. Because I always pick the version with the bugs when downloading, I tried the same thing with a fresh SonarQube 4.2, 4.1.2, 4.0 and Sonar 3.7.4. Out of the box all of them presented the same page, so I guess this meaningless error message is by default. I already searched the doc and Google but couldn't find anyone explaining what I need to do to get the profiles to show correctly. So what did I miss?
|
SonarQube Quality Profiles leads to "We're sorry, but something went wrong."
|
Add this line to yoursonar-project.properties:sonar.binaries=bin/classesIt solves the problem.
|
I am executing sonar-runner on my Android project, and get this error:Android Lint needs sources to be compiled. Please build project before executing SonarQube and check the location of compiled classes.My project is already built, classes are inbin/classes.How to solve this?Mysonar-project.properties:sonar.projectKey=anki:AnkiDroid
sonar.projectName=AnkiDroid
sonar.projectVersion=1.0
sonar.sources=src
sonar.language=java
sonar.sourceEncoding=UTF-8
sonar.profile=Android Lint
|
Please build project before executing SonarQube and check the location of compiled classes
|
Once again I set the path in the sonar-project.properties file within the project. This error is not showing
|
I have installed sonar and sonar runner in my machine trying to analyze a dotnet project in the sonar-runner.properties I have set the fxcop path as#sonar.fxcop.installDirectory=C:/Program Files (x86)/Microsoft FxCop 1.36 in sonar-runner/confbut when I run the sonar-runner I get the following errorjava.io.io exception: Cannot run program "c:\Program Files\Microsoft FxCop 10.0\FxCopCmd.exe" CreateProcess error=2,The system cannot find the file specified. Caused By: cannot run program "c:\Program Files\Microsoft FxCop 10.0\FxCopCmd.exe"As you can see the path where fx cop is installed is not taken correctly by sonar runner. Please help me on which place I need to configure the path for sonar
|
How to set fxcop path for sonar
|
It is not possible. The only way is to start from your database backup.
|
During an upgrade, Sonar decided to deactivate all the rules in my quality profile A. I now have version 5 of it (with all my rules) and version 6 (with no rules). I can see the difference in the changelog, but I do not know how to restore v5 of the profile. Any ideas? Thanks!
|
Restore an old version of a quality profile in Sonar
|
(1) If one adds&resolved=falseto the query, the numbers get equal.(2) It seems that there is no way to avoid the cap. Nevertheless the /timemachine does not have this cap but provides the whole numbers..../sonar/api/timemachine?resource=HEAD:diverse&metrics=major_violations&fromDateTime=2013-12-05T00:00:00+0100
|
I'm writing a regular SONAR mail report as suggested in different posts and while playing around found a difference in number between the issues shown in the regular SONAR dashboard and the number produced by the REST API, e.g..../sonar/api/issues/search?severities=CRITICAL&componentRoots=HEAD:diverseIt does not occur on every query and seems so be more often at large numbers. The REST API number is also always larger than the one from the dashboard.(1) Has anybody experienced similar results or are there known bugs (couldn't find any on google or the mailing lists)?(2) If there is a hidden command to bypass the 10.000 issue max cap, I'd also appreciate that. :-)SONARQUBE version is 3.6.2.Greetings and thanks,
LastFreeNickname
|
Differences in issue numbers between SONAR dashboard and its REST API
|
Thanks to @psqita we got the CAS plugin for Sonar up and running with Saml 1.1. Business requirements said that no anonymous access shall be allowed. Sadly, settingforceAuthenticationtotruesent us into an endless loop of painful redirecting between CAS and Sonar. So we figured out that Sonar alters its behavior drastically in a way that it ignores all authentication plugins.Our solution: As of business requirement we could not allow anonymous access. So we implemented anotherFilterthat redirects conditionally to CAS. Authentication and stuff is still done by the plugin. Sadly, we still do not know why there was this endless loop in the first place but now it doesn't happen anymore. Well that's IT I think...Thank you for your support and happy holidays.
|
we want to integrate CAS authentication into Sonar 3.7 LTS. We want to start working with the deprecated CAS plugin, which of course doesn't work. We already compared it with the LDAP plugin fromherewhose Authenticator interestingly implements the deprecated interfaceLoginPasswordAuthenticator. One of the main differences is that the CAS Authenticator plugin implementsAuthenticator. So we altered the CAS Plugin that it implementsLoginPasswordAuthenticatorinstead.Now comes the clue:In both cases, the authenticator implementingAuthenticatororLoginPasswordAuthenticator, the username passed to it isnull. The authentication against the CAS server works like a charm, the plugin knows the username, but Sonar asks the plugin, if it knows the user with the namenull. The effect is that when we click on login we get redirected to CAS, fill in the login form and get redirected back to Sonar, still not authenticated to Sonar itself.We also considered using container authentication but are not sure if that works with Sonar.Now the question(s):Has someone got the CAS plugin working with Sonar 3.7? If yes, how and can you provide the sources/solution/plugin?Is there another way besides the suggested ones above?One additional note: We want to use Sonar in our existing Tomcat 7, so using Sonar 4 is a way we do not really want to go because the Sonar team decided to stop war support. If anything else fails though, using it is a pain-in-the-ass-but-acceptable solution.Thanks for your help.
|
How to integrate CAS authentification in SonarQube
|
I got a similar issue. paths in the coverage.xml file where wrong and I just run a sed command to replace all the files path to add the module directory.
|
Sonar is unable to display code coverage for a Python module generated by Cobertura. I am currently using Jenkins for build and integration with Sonar. My sonar properties are:# Info required for Sonar
sonar.sources=module
sonar.language=py
# Additional Configuration
sonar.python.xunit.reportPath=**/nosetests.xml
sonar.python.coverage.reportPath=**/coverage.xmland the console output says:12:03:26.458 INFO - Sensor PythonXunitSensor...
12:03:27.305 INFO - Processing report 'nosetests.xml'
12:03:27.305 INFO - Parsing report 'nosetests.xml'
12:03:27.460 INFO - Sensor PythonXunitSensor done: 1002 ms
12:03:27.460 INFO - Sensor PythonCoverageSensor...
12:03:28.216 INFO - Parsing report 'coverage.xml'
12:03:28.269 INFO - Sensor PythonCoverageSensor done: 809 ms
12:03:28.269 INFO - Sensor CpdSensor...
12:03:28.270 INFO - SonarBridgeEngine is used
12:03:28.426 INFO - Cross-project analysis disabled
12:03:29.181 INFO - Sensor CpdSensor done: 912 msBut in Sonar I only see unit test results but no coverage data, and when I ran with debug option it says:16:51:23.124 DEBUG - Cannot find the file , ignoring coverage measures
16:51:23.125 DEBUG - Cannot find the file , ignoring coverage measures
16:51:23.125 DEBUG - Cannot find the file , ignoring coverage measures
16:51:23.126 DEBUG - Cannot find the file , ignoring coverage measures
16:51:23.126 DEBUG - Cannot find the file , ignoring coverage measuresI checked cases and paths too but didn't find the issue. Can anyone help me?
|
Sonar Python coverage report issue
|
You can use NOPMD comment to avoid Sonar analysis.public int getId(){ // NOPMD
return this.id;
}
public int getComplexId(){
int result = 0;
// some complex calculation there
return result;
}Also you can use //NOSONAR or //CHECKSTYLE:OFF comment. More info inhttp://www.sonarqube.org/sonar-1-12-in-screenshots/
|
There is thewayto exclude getter and setters from sonar report. Suppose I have 2 "getters":public int getId(){
return this.id;
}
public int getComplexId(){
int result = 0;
// some complex calculation there
return result;
}It is possible toexcludegetId() andincludegetComplexId() simultaneously? Can Sonar analyze simple return this.id from complex code?
|
How exclude simple getter and setter from sonar?
|
Create a secondProblemsview configured to show only those from FindBugs using the view's context menu (downward triangle next to the minimize button pictured in the first screenshot below).Bring up theProblemsview.SelectNew Problems Viewfrom the context menu.In the new tab, selectConfigure Contents...from the context menu.This will bring up a dialog containing the filtering options (second screenshot below).UncheckShow all itemsto enable the other options.Click theDeselect Allbutton next to theTypeslist in the lower right.Check each of theFindBugstypes in that same list.ClickOKto save the configuration.Problems View Context MenuConfigure Contents Dialog
|
i don't quite know how to phrase it, but my problem is this - I want a separate error list for FindBugs aside from "regular" errors in my projects.Right now, i've moved FindBugs' errors to Info category, so it is kinda separate. But I can't differentiate between warning levels of FindBugs' problems.Is there a way to have a separate hierarchy of errors found by FindBugs?If there is not, please, recommend some other tool with similar capabilities of "sonaring" my code.UPD: I know of Bug Explorer view, but stuff is displayed there AND in the Problems view...
|
Get FindBugs to report errors separately
|
No. Practically everything in Sonar is stored in a database, so you must have one. PDF isn't any kind of reasonable way to store something for later use. If you're looking for reports in PDF format, there'sa PDF plugin, but I've never used it.
|
We are setting up sonar with maven build using what is describedhere.
However I am interested in finding out if it is possible to set up sonar without having a database. Is it possible for sonar to generate a PDF with all metrix in memory and save it to some directory for later use than saving in to database?
|
Installing Sonar without database in Spring Boot
|
Unfortunately, this is not currently possible with the Sonar .NET & C# plugins ecosystem - nor with any existing plugin in Sonar for the moment.
|
I have a C# sonar project that is used to analyse and review code. But I would like to included the aspx pages. I believe there is no plugin that is capable of analysis aspx but I would be happy for the file just to appear in the project, so that I can take advantage of the review capability in Sonar.Does anyone have any ideas how I could achieve this?
|
Included .aspx files in Sonar Project
|
You can click on the "Refresh" icon of the "Violations" view to force the update:http://docs.codehaus.org/display/SONAR/Browsing+SonarQube+in+Eclipse+-+Prior+to+version+3.2#BrowsingSonarQubeinEclipse-Priortoversion32-ViolationsViewdisplayslocalorremoteinformationdependingontheselectedmode
|
I have a multi-module maven project I code on using Eclipse, with the Sonar plugin installed. When I do a commit, Jenkins starts a build that invokes Sonar. The Sonar server is then up to date. However, the violations in Eclipse are not up to date. I know about local analysis, but that be cumbersome to do for each module, plus the server already ran an update, I just need to find a way to have Eclipse refresh the violations from the server. The modules are associated with Sonar and the server just fine. Is this possible to refresh the violations or should I be doing something differently (to work around this)?
|
Refreshing Sonar violations in Eclipse
|
You can find our sample plugins here:https://github.com/SonarSource/sonar-examples/tree/master/plugins. "sonar-reference-plugin" should give you lots of information.This should help you to better understand how things work.
|
I'm working on a Sonar project and I have to make a plugin in order to get metrics and to compute them.In order to understand how it works, I'd like to try to do the following examples:Get the value (complexity) and to compute it as a double or a float value.Take the complexity value (MetricsCore.COMPLEXITY) and if it's more than 200, write a message to say that it's too complex.Take the number of comments lines and multiply it by 10.I know that in these examples what I want to do is useless, but it's just to understand how to get the Metrics Core value and take their value, and to create new Metrics.
I don't find a lot of documentation....Thank you very muchFor information, I will use Sonar-reference-plugin.
|
sonar plugin : how to get sonar's metric
|
It is not currently possible to achieve what you want, unless you write a small Java program that usesSonar Web Service Java clientand that does the job.
|
I am using sonar false-positive feature in my project deployed on sonar server and i have marked some violation instances(lets 50 instances) as false positive.Now i create a new project in sonar having the same code base and deploy it on sonar. As code base is same for both of my projects this is obvious that those "50" violation instances will occurs here also, which i have marked as false-positive in my previous project.
Now i dont want to spend time to mark these instances as false-positive again so i want to ask is there any way to mark these "5o" violation instances as false-positive by refering my first project without doing manually??Can i make a template/profile type feature to copy false-positive marks from one project and apply it on other project having same code base so that i can save my time??Kindly revert if anyone know any way to execute this.
Your response will be appreciable..
Thankks in advance!
|
Sonar False-Positive Feature
|
Here are some other things you can try:Remove all the following addionnal plugins: PDF, build-breaker, quality-index, technical debt. And try a new analysis.Increase again the Java heap size (-Xms512m -Xmx1024m)Use "sonar.exclusions" to exclude parts of your code, and see the max amount of source code that you can analyse at once without failingSplit your big project into small modules and usethe multi-module feature of Sonar
|
I am using jenkins for making build by using Ant. I am also configuring sonar on this jenkins job via 'Invoke Standalone Sonar Analysis". Everything is going fine till build making process and build successfully created. Now sonar execution is started and after some time i got an error"Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: java.lang.OutOfMemoryError: Java heap spaceBuild step 'Invoke Standalone Sonar Analysis' marked build as failure
"...What all i have done to fix this issue are:Increasing java heap size viaReplaced %SONAR_RUNNER_OPTS% with -Xms256m -Xmx1024m in sonar-runner.bat file of sonar.Modify Sonar_Way quality profile and put only one or two rules active in this so that to avoid rule voilation.then run build but still getting same java heap error. One more thing i would add on this is my project source folder size is around 40mb means its a big project comparatively.Can anyboby help me out on this??
What else should i do to get this done.
Your revert will be appreciable..
Thanks in Advance..
|
Sonar - OutOfMemoryError Java Heap Space while running sonar through jenkins
|
We have an open ticket on this:http://jira.codehaus.org/browse/SONARJAVA-91As 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.
|
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.
|
SONAR: config duplicate line for java project
|
I had a simular question that I posed on theSonar User foruma couple of days ago.In short, your approach is correct and was also proposed by a Sonar consultant (as can be seen on the post).Perform a Sonar analyze on each Maven project.For each analysis, reuse the report and pass your JaCoCo report (using -Dsonar.jacoco.itReportPath)Sonar will retrieve from this JaCoCo report
the coverage data related to the Maven project being analyzed. (one of your core projects)Thus, for each Maven project, you'll get the coverage by your integration tests.Finally, to get the coverage of your webservice by your integration
tests, you will have to use the Views plugin:http://www.sonarsource.com/products/plugins/governance/portfolio-management/Create a view that is an aggregation of all the Maven
projects composing the webservice.Run a Sonar analysis of one of its
Maven projects in order for Sonar to compute the view.On the view dashboard, you'll be able to get the code coverage
of the webservice by your integration tests.
|
I'm trying to use JaCoCo agent for collecting FT code coverage of a web-site by adding"-javaagent..."to Jetty and running external Selenium tests (or, for example, manual testing).At the end of testing I have results only for web-module, that was actually run in Jetty, but not for "core" modules (in the same project) being used in web-module. So, is there any ability to collect calls forallmodules of the project?Indeed, I now tried to start all project webservices (it has 5) with the same JaCoCo report destination (i.e./tmp/jacoco-res.exec),append=trueand ran:mvn sonar:sonar -Dsonar.jacoco.itReportPath=/tmp/jacoco-res.execSo, sonar now used thesameJaCoCo report file for every module in project and sonar shows tests coverage both for jetty-run and core modules.Is this approach applicable and coverage results correct?
|
Sonar + jacoco agent code coverage for non-webservice modules
|
I don't see any other option than creating a dedicated Checkstyle rule (http://checkstyle.sourceforge.net/writingchecks.html) which would be embedded into your own Sonar plugin.Here is an example of such Sonar plugin defining a simple Checkstyle rule :https://github.com/SonarSource/sonar-examples/tree/master/plugins/sonar-checkstyle-extension-plugin
|
I have a java project with a couple of layers. I want to define a rules for file naming convention in Sonar server, e.g. each file in packageapp.name.daoto have name likeClassNameDAO.java.Is this possible with some of the tools which Sonar is using?
|
File naming convention definition in Sonar
|
sonar::Treemap is not part of our Ruby API (which is api::*), so I would not advise you to use it as it can change without notice.
|
I am using sonar 3.1.1.I cant accesssonar::Treemap.size_metric and sonar::Treemap.color_metricto display a treemap.please help me to solve this problem. Or some one suggest an alternative for this.
Thanks in advance.
|
Cannot access Sonar TreeMap
|
I know I'm late to the party here but this could help others.import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;The above does not break the rule as it is well sorted alphabetically, you get the "Wrong order for 'java.util.' import." when any of these imports are in between other imports without the proper sort order. For instance:import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;The above break the rule as the imports are not well sorted. To fix this, just move the "java.util" imports above the "org.slf4j" imports. Kind of like:import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;Also, there seems to be an order to how imports should be arranged apart from alphabetical sorting.Static importsimports from other packages in the same projectImports from javaImports from the frameworkAll other imports
|
In my java class there are multiple imports are there like showen below.import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;my question is sonar report is telling minor violation under category ofImport Order.Wrong order for 'java.util.ArrayList' import.what exactly it means and how to resolve this sonar violations.Thanks in advance.
|
what is Imports Order in java class and how to resolve it
|
No such plugin currently exists, and actually I'm not sure that this could be achieved with a plugin - as plugins can only contribute to the current Sonar UI.Maybe you could send a mail on our mailing-list ([email protected]) to tell your interest in such a feature for a future release of Sonar? Basically, this would be something like the possibility to ask the UI to show a Sonar dashboard outside of the standard layout and with a specific refresh rate.FYI, we have planned a work on the UI for the next version of Sonar - 3.3, so this could be the opportunity to see if your need can be addressed within this sprint.
|
My employer has installed two large LCD panels to display build health and statistics.I'd like to display Sonar graphs which update intra-day. How's the best way of going about this? I've had a look through the available plugins and haven't found a "wall display" facility yet
|
Sonar Wall Display?
|
What version of Sonar are you running? I was having this problem when running Sonar 4.1.1 because I was using the sameGradle Sonar pluginthat you are. I switched to theGradle Sonar Runner plugin, and the problem was resolved.
|
I have this error when running sonar with my gradle build script.gradle sonarAnalyze15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter]
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
15:41:02.931 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':sonarAnalyze'.
15:41:02.934 [ERROR] [org.gradle.BuildExceptionReporter] > java.util.ArrayList cannot be cast to java.lang.String
My sonar
sonar {
server {
url = "http://server.com:9000"
}
database {
url="jdbc:mysql://server:3306/sonar?useUnicode=true&characterEncoding=utf8"
driverClassName="com.mysql.jdbc.Driver"
username="sonar"
password="sonar"
}
project {
coberturaReportPath=file("$buildDir/reports/cobertura/coverage.xml")
language = "java"
}
}What could be the problem?
|
Gradle - Execution failed for task 'sonarAnalyze' - java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
|
Then Sonar won't produce any test related data, such as code coverage and test success statistics. This will also affect the calculation of the overall technical debt and total quality metrics.
|
What happens if I run following command :mvn clean install sonar:sonar -Dmaven.test.skip=trueI have set Up sonar locally and its running on port 9000.What would be impact of skipping test on sonar report?
|
Skip test for sonar analysis
|
There is no rule that matches your needs but you can write your own rule with XPath. You can find a tutorialhereIf you don't know how to extend the coding rules of sonar you can find a tutorialhere
|
Is there a way to configure Sonar to ignore single-line if-statements likeif (value == true) return;while marking multi-line if-statements witout braces such asif (value == true)
return;as violations?
|
Configure Sonar to ignore single-line if-statements
|
you just have to activate one of the following rules on your Java quality profile, and the files w/o a header will have a violation after the next analysis:"Header" (Checkstyle: com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck)"Regexp Header" (Checkstyle: com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck)Seethem on Nemofor instance.
|
Is there a Sonar plugin available, which is able to identify Java files without a license/copyright header?
|
Sonar violation to show Java files without license/copyright information?
|
The Sonar extension uses the underlying ant task and passes parameters from buildr to ant. The parameters that you can use will be documented in the next release of Buildr. But to get you started here is a simple example that uses all the configuration parameters. The only property that must be set is "enabled", while the remainder attempt to have sensible defaults.require 'buildr/sonar'
define "foo" do
project.version = "1.0.0"
define "bar" do ... end
sonar.enabled = true
sonar.project_name = 'Foo-Project'
sonar.key = 'foo:project'
sonar.jdbc_url = 'jdbc:jtds:sqlserver://example.org/SONAR;instance=MyInstance;SelectMethod=Cursor'
sonar.jdbc_driver_class_name = 'net.sourceforge.jtds.jdbc.Driver'
sonar.jdbc_username = 'sonar'
sonar.jdbc_password = 'secret'
sonar.host_url = 'http://127.0.0.1:9000'
sonar.sources << project('foo:bar')._(:source, :main, :java)
sonar.binaries << project('foo:bar').compile.target
sonar.libraries << project('foo:bar').compile.dependencies
end
|
can anyone tell me how to integrate Sonar and Apache Buildr?I downloaded sonar.rb fromhttps://github.com/apache/buildrand placed it in /var/lib/gems/1.8/gems/buildr-1.4.6/addon/buildrBut I don't know how to call this task from my project.
I have already added arequire 'buildr/sonar'
include Buildr::SonarI don't know where I have to configure the sonar properties.Thank you,
Soccertrash
|
Sonar and Apache Buildr
|
Can you connect to the same JDBC URL, using a standard SQL navigator product likesquirrel?Perhaps it's something obvious like the database is shutdown.UpdateThe following thread describes the same problem:http://ubuntuforums.org/showthread.php?t=991141In that case it was a permissions issue on the MySQL server. The client IP addresses were restricted.
|
am running sonar from Jenkins.
Sonar version is 2.13
I got this exceptionplease help me[ERROR] [21:49:15.205] JDBC begin failed
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 7,028,219 milliseconds ago. The last packet sent successfully to the server was 16 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.6.0_18]
atThe Jenkins job of sonar almost ran for 1:30 mins is the reason for jdbc connection loose
|
Sonar: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
|
You should put this properties file in the same folder as your SLN file ("d:\dossier-source"), and with the following properties only:sonar.projectKey=key.myproject
sonar.projectName=myproject
sonar.projectVersion=1.0
sources=.
sonar.language=csAnd then run "sonar-runner" from "d:\dossier-source".This should work.
|
I am trying to use Sonar with my .NET project (I have installed thec# plugin), but When I launch sonar-runner with this .properties file :# identifiants du projet
sonar.projectKey=key.myproject
sonar.projectName=myproject
sonar.projectVersion=1.0
# fichier .sln
sonar.dotnet.visualstudio.solution.file="d:\dossier-source\myproject.sln"
# répertoires de sources
sources="d:\dossier-source"
# Tests
tests="d:\dossier-source\myproject.Tests"
# langage
sonar.language=csI have this exception :Exception in thread "main"
org.sonar.batch.bootstrapper.BootstrapException: org.
picocontainer.PicoLifecycleException: PicoLifecycleException: method
'public fin al void
org.sonar.api.batch.bootstrap.ProjectBuilder.start()', instance
'org.son ar.plugins.csharp.core.VisualStudioProjectBuilder@11ecab56,
java.lang.RuntimeExc eption: wrapper
|
Sonar-runner Exception with .NET Project
|
Hudson will do the trick.We use the HudsonRake pluginandRuby metrics plugin.
|
In my day work, I work on your classic Java aplication. We use as "software factory" : Maven, Hudson and Sonar.In my night work, I work on personnal ruby on rails stuff. I have a certain number of applications, not much known but that's not my question. My question is :Is there tool like Hudson - Sonar for ruby on rails ? Bundle and gemfiles do the maven job, but is there anything out there to do the hudson and sonar job ? For me, it's summed up to this 2 :
- build and run tests on commit
- build quality metrics and code statistics on demandRegards to you.
|
Quality metrics and continuous integration for ruby on rails
|
There's currently no plugin for HP Quality Center, but it shouldn't be too hard to develop one.You can have a look at the source code of the JIRA plugin to see how this could be achieved:https://github.com/SonarCommunity/sonar-jira
|
Does anyone have any idea about a plugin for Hudson or Sonar that connects to HP Quality Center and retrieves a status about the opened DEFECTS in a project?
|
HP Quality Center Status plugin Hudson or Sonar
|
Try this:/**
* @deprecated (when, why, refactoring advice...)
*/
@Deprecated
@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
public class SomeClass {
}For more information:https://rules.sonarsource.com/java/RSPEC-1123
|
I use Java 8 and the existing code just had @Deprecated and it was tagged by SonarQube. I tried adding @deprecated Javadoc tag to fix this issue. But, it still throws the same error. Here's what I have added:@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
/**
* @deprecated (Not using this now)
*/
@Deprecated
public class SomeClass {Can someone please point out what the mistake is in the above code? Or, provide me the correct way to solve this issue.
|
SonarQube throws CodeSmell "Add the missing @deprecated Javadoc tag."
|
You might need to apt-get install a Java run time/JDK.referencinghttps://community.sonarsource.com/t/net-gitlab-setup/40134/3
|
I am trying to run sonarqube from docker on linux agent.install dotnet scannerdotnet tool install --global dotnet-sonarscanner --version 5.6.0dotnet sonarscanner begin and dotnet build commands are running fine.
but fordotnet sonarscanner end /d:sonar.login=$Tokencommand, it gives error as "**Calling the SonarScanner CLI...
16:09:31 Could not find 'java' executable in JAVA_HOME or PATH.
16:09:32 Process exited with code 1**I tried setting JAVA_HOME also ( with and without bin in path), but it didn't work.export JAVA_HOME=/usr/lib/jvm/jre-openjdk
export PATH="$JAVA_HOME/bin:${PATH}"
export PATH="$PATH:/root/.dotnet/tools"
echo $PATH
ls -lrt /root/.dotnet/tools/
-rwxr-xr-x 1 root root 142840 Jun 14 11:27 /root/.dotnet/tools/dotnet-sonarscannerI read in posts to change the permission of jre in sonar, but I used "dotnet tool install --global dotnet-sonarscanner --version 5.6.0" to install sonarscanner, so don't know which location I should go and change the permissions.
|
Calling the SonarScanner CLI., Could not find 'java' executable in JAVA_HOME or PATH. for DotNet
|
What is your SonarQube Server version? You should be using 9.1 as you have Java 17 and sonar-maven-plugin 3.9.1 according to this post:https://community.sonarsource.com/t/support-java-17-in-the-sonar-maven-plugin/51931
|
I'm trying to scan a project with sonar scanner but getting this call & error:mvn verify sonar:sonar "-Dsonar.login=<login>" -DskipTests[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project test: Unable to load component class org.sonar.plugins.javascript.JavaScriptSensor: ExceptionInInitializerError: java.lang.reflect.Inaccessible
ObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @1bfbbc53I'm using following mvn plugin<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.9.1.2184</version>
</plugin>and Java 17 with a amazon corretto 17 jdk<properties>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>My IDE is an IntelliJ IDEA with Project JDK set to amazon corretto 17I tried downgrading the maven plugin and the jdk as I read about so before but it did not solve my Problem.
Are there any other ideas?
|
sonar scanner throws java.lang.ClassFormatError accessible
|
You can solve this problem using a customFormatter.import logging
import re
class SensitiveFormatter(logging.Formatter):
"""Formatter that removes sensitive information in logs."""
@staticmethod
def _filter(s):
# Filter out the password with regex
# or replace etc.
# Replace here with your own regex..
return re.sub(r"ABCDEF", r"<MASKED>", s)
def format(self, record):
original = logging.Formatter.format(self, record) # call parent method
return self._filter(original)Then, use it inside your handlers:# Create the specific logger
mylogger = logging.getLogger("foobar")
mylogger.setLevel(logging.DEBUG)
mylogger.propagate = False
# Create the handler
streamhandler = logging.StreamHandler()
streamhandler.setLevel(logging.INFO)
# Create the specific formatter
sensitive_formatter = SensitiveFormatter(
fmt="[pid:%(process)d] - %(asctime)s - %(levelname)-8s - %(message).1000s"
)
streamhandler.setFormatter(sensitive_formatter)
mylogger.addHandler(streamhandler)
mylogger.info("This is a password: ABCDEF")[pid:453381] - 2023-02-07 14:47:56,075 - INFO - This is a password: <MASKED>
|
I am using a librarypython-sonarqube-api, which shows a password in debug logs using a logger which I consider abug.Until it can be fixed I need to hide the password in the logs. I am considering using a filter but I am not sure how to use it without breaking current structure of all loggers in the software.Could you suggest me some solution please?
|
How to mask password in Python logs?
|
Shallow clones are faster and smaller because they're skipping a part of the Git history.Without a full history, it is (in general) impossible to determine who authored a specific part/line of the code.Bottom line:if you depend on "blame" information, then you cannot use shallow clones.The checkout per-se will work fine, but you're apparently using plugins that depend on this blame information, thus giving the warnings that you see.
|
I want to use git shallow clone while checking out my repo. My objective is to reduce the Jenkins build time slightly. But the problem is I am getting thousands of warnings on the Jenkins build log. like following[WARNING] Shallow clone detected, no blame information will be provided. You can convert to non-shallow with 'git fetch --unshallow'.
[INFO] 0/4496 files analyzed
[WARNING] Missing blame information for the following files:I also get a warning on my SonarQube like thishow I can get rid of this warning message.
|
Git Shallow clone creates lots of warning
|
Enterprise EditionVersion 8.9.6
The comma-separated path names didn't work. I had to proceed with individual ruleKey and resourceKeys for the same rule exclusion.
|
SonaQube 9.1. Community Editionsonar.issue.ignore.multicriteria=e1,e2,e3
sonar.issue.ignore.multicriteria.e1.ruleKey=java:S115
sonar.issue.ignore.multicriteria.e1.resourceKey=**/*Type.java
sonar.issue.ignore.multicriteria.e2.ruleKey=java:S115
sonar.issue.ignore.multicriteria.e2.resourceKey=**/*Enum.java
sonar.issue.ignore.multicriteria.e3.ruleKey=java:S115
sonar.issue.ignore.multicriteria.e3.resourceKey=**/NEStatus.javaNice. This work fine.But to much lines.Is it possible smt like this?sonar.issue.ignore.multicriteria=e1
sonar.issue.ignore.multicriteria.e1.ruleKey=java:S115
sonar.issue.ignore.multicriteria.e1.resourceKey=**/*Type.java,**/*Enum.java,**/NEStatus.java
|
Sonar.issue.ignore.multicriteria many files in one line?
|
OK it turns out sonar-scanner cannot parse "vanilla" Pylint output.
As statedhere, Pylint output should be formatted using the--output-format=parseableoption.
|
I'm trying to feed a Pylint analysis report into sonarQube.Call to sonar-scanner is:sonar-scanner -X -Dsonar.python.pylint.reportPath=report.txt ...wherereport.txtis Pylint "vanilla" output formatting and looks like:************* Module src.module.file
src/module/file.py:200:13: W0511: TODO fix it
src/module/file.py:49:0: W0622: Redefining built-in 'ConnectionError' (redefined-builtin)And all I get is sonar complaining:17:27:39.330 DEBUG: Cannot parse the line: ************* Module src.module.file
17:27:39.330 DEBUG: Cannot parse the line: src/module/file.py:200:13: W0511: TODO fix it
17:27:39.330 DEBUG: Cannot parse the line: src/module/file.py:49:0: W0622: Redefining built-in 'ConnectionError' (redefined-builtin)I'm using sonar-scanner 4.4.0 and Pylint 2.11.1.Any clue?
|
SonarQube cannot parse Pylint output
|
You aren't doing anything with the return value ofreduce.
You could store the return value of reduce:const foo = filtersArray.reduce((acc, {field, operator, value}) => {
value = btoa(value);
value = value.toString();
if (columnList.length > 0) {
columnList = [];
}
filterObject['attributeName'] = field;
filterObject['FilterValue'] = value;
filterObject['FilterOperator'] = operator;
columnList.push(filterObject);
return acc;
}, {});
|
below is my reduce codefiltersArray.reduce((acc, {field, operator, value}) => {
value = btoa(value);
value = value.toString();
if (columnList.length > 0) {
columnList = [];
}
filterObject['attributeName'] = field;
filterObject['FilterValue'] = value;
filterObject['FilterOperator'] = operator;
columnList.push(filterObject);
return acc;
}, {});I am getting an issue in sonarqube saying that the retun value of reduce must be used. What changes do I need to make to this script to bypass the issue? Please suggest. Thanks
|
The return value of "reduce" must be used
|
I found the solution within FluentAssertions.My new code wraps the old call to the _sut in an action and uses Fluent Assertions Should Not Throw mechanism.This is an elegant solution because we were using FluentAssertions already anyway. I was just never aware of the Should Not Throw assertion it offers. I only ever knew about Should Throw until now.
|
I am running into a little trouble with my unit testing code and SonarQube.I have the following simple test:[TestMethod]
public void TestFormat_Null()
{
_sut.Format(null);
}
public void Format(IPhone phoneNumber)
{
if (phoneNumber == null) return;
FormatNumber(phoneNumber);
FormatAreaCode(phoneNumber);
FormatCountryCode(phoneNumber);
}The requirement here is, that if null is passed in, the method will simply do nothing, since there is nothing to format and also not crash with an exception.Now the problem we are getting is that our SonarQube complains, that this is a test without any Assertions.Is there any better way to declare a test that tests for a method not doing anything or is this a case where the SonarQube warning should simply be ignored?
|
Correctly testing that a method does nothing under certain cicrumstances
|
As I personal! know there is no Linter which provide that. (I am curious about it.) But just some thoughts about the need of following that 'rule':Indeed: writing SASS/CSS the way Selectors with lower specifity comes first is a good practicse. The CSS structure becomes more readable and it is easier to build up your code structure as there is a clearer systematic in your head (and the code).But just up from the mechanic CSS worksthere is REALLY NO NEED to do it this way. The code simply doesn't become safer doing so or less safe and the pages don't load slower not doing it. That is what the mechanic of specifity has been done for: as of the specifity not the order of the selectors counts and you are able to write your code in the order you need it. Only if the specifity is the same the order counts.So, maybe this rule leads to 'better' code. But:NOT ALL RULES NEEDS TO BE FULLFILLED. Not all rules Google tries to establish with their best practice rules they offer in their browser, nor all rules other analysis tools provide needs to be followed.And if not in this project as it needs resources to correct it ... it maybe could but has not be a target for next project ;-)
|
We use SonarQube against our application. One of the SonarQube rules says:Selectors of lower specificity should come before overriding selectors of higher specificityThe details arehere. As my application has many violations, changing the order by hand isn't really feasible. I'm wondering if there's a way to use scss-lint, stylelint or something else in a "fix" mode that could change the order of the selectors. I looked but couldn't find anything in stylelint. Maybe it can't safely be done automatically, as changing the order could affect specificity and therefore change the application behaviour...
|
Autofix order of selectors
|
I am not sure if community edition allows but it works on enterprise edition. You just need to reference Stylecops in your project and when SonarQube scans the project it will import
|
i want to integrate StyleCops with SonarQube and display the results in SonarQube dashboard. Started working on a POC. Now im stuck due to lack resources and domain experts.I have some doubts.1)Is it possible to achieve this with Community EDITION or do i need to request for a Developer or Enterprise edition.2)Can we integrate gitlab .net project to SonarQube and analyze using StyleCop rules (C#)Can someone guide me to achieve this. Thank you in Advance.
|
Integrate StyleCops with SonarQube and display the results in SonarQube dashboard
|
I have applied the solution mentionedhereand configured the XMLInputFactory object this way:XMLInputFactory inputFactory = XMLInputFactory.newInstance();
inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
inputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);OWASP XML External Entity Prevention
|
Environment: Java 8 / SpringBoot v1.3.3.RELEASEThis is an old Java code base. Recently sonar was introduced and my task is to fix Critical/Blocker level security vulnerabilities.At this code sonar recommends to "Disable access to external entities in XML parsing".XMLInputFactory factory = XMLInputFactory.newInstance();As per the sonar recommendation I added following properties to the factory,factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");However, when I run the unit tests it gives my following error,java.lang.IllegalArgumentException: Unrecognized property 'http://javax.xml.XMLConstants/property/accessExternalDTD'But it doesn't give me the any such error when I set the same properties for the DocumentBuilderFactory as follows,DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
docBuilderFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
docBuilderFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");I did a bit of a research and foundThisJava bug. But it's fixed and also it's related to TransformerFactory. Couldn't find any such bug related to XmlInputFactory though.Any workaround or fix is much appreciated
|
XMLInputFactory setProperty(XMLConstants.ACCESS_EXTERNAL_DTD,"") gives Unrecognized property
|
It looks like it's possible with Eclipse, but currently unimplemented for IntelliJ (and VSCode) and "Module-level services have recently been deprecated on Jetbrains plugin API side."Here's the feature ticketThe community pluginSonarQube Analyzerseems to have this ability. See the wiki:https://github.com/sonar-intellij-plugin/sonar-intellij-plugin#module-configurationThe user gaynaper specifically createda fork of the official app to allow binding by vcsroots. I haven't inspected nor tried it.
|
I have opened different Java projects as modules in IntelliJ, and I'd like to bind different SonarQube projects for each one of them. But apparently, only one is applied to all modules. How could I change that?
|
SonarLint different bindings per module
|
Maybe the best solution is to flag the SonarQube warning.In order to convince a logger to print only the "interesting bits" of a stacktrace, you will most likely need to write a custom log message formatter or appender. Reliably working out what the interesting bits are (across all exceptions that your application may throw, etc) is likely to be a challenge.Note that logging the exception message (as suggested) won't shut up SonarQube. At least, not if this testcase is to be believed:https://github.com/SonarSource/sonar-java/blob/master/java-checks/src/test/files/checks/CatchUsesExceptionWithContextCheck.javaOn the other hand, it looks like:} catch (Exception e) { // Compliant
String message = "Some context for exception" + e.getMessage();
JAVA_LOGGER.info(message);
}is acceptable to SonarQube, though it doesn't log any stackframes.
|
private static InputStream getFileFromClassPathOrFileSystem(String path) {
try {
//try to get from something like file:///some/path, and if missing Scheme exception, go to catch clause
return Files.newInputStream(Paths.get(URI.create(path)));
} catch (IllegalArgumentException | IOException e) {
LOGGER.info("Could not retrieve from file system, trying classpath. If the exception is 'Missing scheme' this can be ignored");
return Thread.currentThread().getContextClassLoader().getResourceAsStream(path);
}
}SonarQube flags this withEither log or rethrow this exception. That makes sense to us so we addedeto the logger line:LOGGER.info("Could not retrieve from file system, trying classpath. If the exception is 'Missing scheme' this can be ignored", e);While this fixed the sonar issue, and indeed gives us a bit more useful information, we are now flooded with a 40 line stack trace. (and the method is called a LOT 😛 )Is it possible to have the best of both worlds? Like having the error logged, but only part of it (actually, just the first two lines is fine), and without being flagged by SonarQube?
|
How to log only part of an exception?
|
As it is written inSonar Qube forumPull Request support requires at least the developer edition of SonarQube. If you don’t want to analyze your pull requests and keep using the community edition, then simply create a second build definition without any SonarQube task, and use it in your branch strategy to build pull requests.And alsoherePull Request analysis is available as part of Developer Edition and higher.So you can't do this with community edition.
|
We are trying to integrate SONAR QUBE checks when the developers tries to merge to MAIN branch.When we try to incorporate the sonar checks as part of check in policy , we get the below errorERROR: Error during SonarScanner execution
ERROR: Validation of project reactor failed:
o To use the property "sonar.pullrequest.key" and analyze pull requests, Developer Edition or above is required. See https://redirect.sonarsource.com/doc/branches.html for more information.
o To use the property "sonar.pullrequest.branch" and analyze pull requests, Developer Edition or above is required. See https://redirect.sonarsource.com/doc/branches.html for more information.
o To use the property "sonar.pullrequest.base" and analyze pull requests, Developer Edition or above is required. See https://redirect.sonarsource.com/doc/branches.html for more information.
ERROR:
The SonarQube Scanner did not complete successfully
15:41:50.483 Post-processing failed. Exit code: 1
The process 'C:\GITGSROOT\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.11.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1We are using SONAR community edition. Is this integration not supported by community edition of SONAR QUBE ?
|
sonar qube error while integrating with Azure DevOps
|
resultmay beemptybut it will not benullandObjects.isNull()will therefore never returntrue.If no mathing data is found in the database,hasNext()returnsfalsefor everyIteratorreturned byiterator().While you are technically able to create your own implementation, it would likely not make sense to returnnull.If you really want to do it and have a reason to, you can add a//NOSONARcomment explaining it in the same line and the warning will disappear.
|
For some reason sonar reports(Client reports) that the below Objects.isNull always evaluates false disabling the production upgrade. can someone help me understand why does that happen from the client sonarqube and how to fix?Iterable<Sim> result = repository.findAllById(list);
if (Objects.isNull(result)) { // Sonar thinks it always evaluates to false
|
Sonar Qube says Objects.inNull always evaluates to false resulting code build fail in production
|
To perform sonar scan onAngular Project, you need to installtypescriptfirst. So, we need nodejs >=8 and npm installed. Check this post onHow to install nodejs and npm in Jenkins.and also,How to integrate sonarqube in JenkinsSample Pipeline:pipeline {
agent any
tools {nodejs "node_v10"}
stages {
stage('Git Pull') {
steps {
echo 'Code Checkout'
}
}
stage('Install Typescript') {
steps {
sh 'npm install typescript'
}
}
stage('Code scan Sonarqube') {
steps {
script {
def scannerHome = tool 'sonarqube';
withSonarQubeEnv("sonarqube-container") {
sh """${tool("sonarqube")}/bin/sonar-scanner \
-Dsonar.projectKey=test-node-js \
-Dsonar.sources=. \
-Dsonar.projectName=test-node-js \
-Dsonar.projectVersion=1.0 """
}
}
}
}
}Please change or include some other sonar analysis parameters if needed.Visit to know more abouthow to analyse typescript code
|
I'm trying to integrate Jenkins and Sonarqube. I'm using the Sonarqube-Scanner plugin in jenkins. When I build the job, I get the following errors:-Failed to get Node.js version. No CSS files will be analyzed.Failed to get Node.js version. No TypeScript files will be analyzed. You can exclude TypeScript files from analysis with 'sonar.exclusions' property.Any idea as to why this happens? I tried running the same job with a simple NodeJs project and it works fine.Any help would be greatly appreciated, Thanks!
|
Error while to integrating Jenkins and Sonarqube for analysing my Angular project
|
Notice that your error is “use try-with-resources or close thisstatementin a "finally" clause.”The problem isn’t how you close your Connection. The problem is that you aren’t closing your Statement.Connection connection = null;
Statement statement = null;
try {
connection = createConnection();
String sql = String.format(STRING_FOR_PROCEDURE, name);
statement = connection.createStatement();
statement.execute(sql);
connection.commit();
} catch (Exception e) {
throw new DatabaseServiceException(e.getMessage(), e);
} finally {
if (statement != null) {
try {
statement.close();
} catch (SQLException e) {
Logger.log(Level.SEVERE, "Could not close Statement.", e);
}
}
closeConnection(connection);
}Remember that the statement needs to be closed before the Connection is closed.
|
Here's the code:Connection connection = null;
try {
connection = createConnection();
String sql = String.format(STRING_FOR_PROCEDURE, name);
connection.createStatement().execute(sql);
connection.commit();
} catch (Exception e) {
throw new DatabaseServiceException(e.getMessage(), e);
} finally {
closeConnection(connection);
}I suppose sonar wants me to close connection in block "finally" with something like this:connection.close();But I use custom method for this which is:protected void closeConnection(Connection connection) {
try {
if (connection != null) {
connection.close();
}
} catch (SQLException ex) {
LOGGER.log(Level.SEVERE, null, ex);
}
}This method needs to be used in current class. But I receive sonar blocker "use try-with-resources or close this statement in a "finally" clause".
Any ideas how to fix it?
|
How to avoid sonar error "use try-with-resources or close this ... in a "finally" clause" if custom close method is used (java 6)?
|
call gradle from java. I've got the code from this answerHow to run a gradle task from a java code?use dependecies task.I recommend you to go this way so you do not have to handle the harsh task of keeping your code maintained with any version file change in gradle.import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class Main
{
private static String PATH_TO_GRADLE_PROJECT = "./";
private static String GRADLEW_EXECUTABLE = "gradlew.bat";
private static String BALNK = " ";
private static String GRADLE_TASK = "dependencies";
public static void main(String[] args)
{
String command = PATH_TO_GRADLE_PROJECT + GRADLEW_EXECUTABLE + BALNK + GRADLE_TASK;
try
{
Runtime.getRuntime().exec(command);
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
|
Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed3 years ago.Improve this questionI want to analyze the build.gradle of my organization projects, primarily to create a sonarqube plugin that report the use of a dependency or the absence of a dependency.The sonarqube plugin will be writed in Java and the input will be the .gradle files.For example:sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile "joda-time:joda-time:2.2"
testCompile "junit:junit:4.12"
}I want to get the dependency list for example in an List.classAny idea?, how can I interpretate a .gradle file in Java?
|
Read a build.gradle file from Java [closed]
|
It's not a connection issue, it's a permission issue (Authorization).The posted message indicatedERROR: You're not authorized to run analysis.Check if your user hasExecute Analysis permission(see Global or Project permissions).If this is a new project (does not yet exist SonarQube), then users will also need"Create Projects"to create the initial project inside SonarQube. This can be done in advance via the UI (or by an Admin) or on first run, depending on permission model.Review theSonarQube Securitypage and provide only what's needed.See special note onCreators permissionunderPermission Templates for Default Permissions | Creators permissions.
|
I am getting this error after running SONAR analysis in Jenkins with SonarQube.
After the build is running a while and analysing I am getting the error.
I have to mention that I've created the token in Sonar and put it in Jenkins configuration.Somehow, I think it's due to the missing rights on Sonar to create a project or something.Can you please help me with a solution?Here are the latest logs from the Jenkins build.WARN: This may lead to missing/broken features in SonarQube
INFO: 328 files had no CPD blocks
INFO: Calculating CPD for 868 files
INFO: CPD calculation finished
INFO: Analysis report generated in 818ms, dir size=42 MB
INFO: Analysis report compressed in 2897ms, zip size=6 MB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 2:36.346s
INFO: Final Memory: 30M/313M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: You're not authorized to run analysis. Please contact the project administrator.
|
SONAR integration with Jenkins. ERROR: You're not authorized to run analysis. Please contact the project administrator
|
Use SonarLint in connected mode with a SonarQube server. This way, all the rule configurations will be shared with everyone connected to the same server.
|
I want to disable some of the sonarlint rules on my Intellij for my team. I know one way to do it isFile -> Settings -> Other Settings -> SonarLint General Settings, and then checking/un-checking each rule one by one, but I want to do it in one shot. I don't want my entire team to do this check un-check individually. Is there a way to modify local sonarlint file for Intellij ? If I can do that, I can share the same rule file across team.
|
How to modify sonarlint rules in Intellij configuration
|
Make sure you have the SonarQube Server URL set to HTTPs in the SonarQube settings.Check also for the group name in both Azure AD and SonarQube.
|
I tried to configure my SonarQube with active directory and once its done. It is showing this message. When i put the debug mode on , it is showing me these logs. Kindly share what i am missing.You’re not authorized to access this page. Please contact the administratorHere are Logs:2019.12.10 14:33:21 ERROR web[AW7v2dtC1TkW09XXAAFy][o.a.a.a.AadIdentityProvider] Exception:java.lang.IllegalArgumentException: Group name cannot be empty2019.12.10 14:33:21 DEBUG web[AW7v2dtC1TkW09XXAAFy][auth.event]login failure [cause|Plugin did not call authenticate][method|OAUTH2][provider|EXTERNAL|Microsoft][IP|fe80:0:0:0:7d51:23e6:bd8f:3644%2|195.145.101.4][login|]2019.12.10 14:33:21 DEBUG web[AW7v2dtC1TkW09XXAAF0][auth.event] login failure [cause|User must be authenticated][method|BASIC][provider|LOCAL|local][IP|fe80:0:0:0:7d51:23e6:bd8f:3644%2|195.145.101.4][login|]Details:Community Edition
Version 8.0 (build 29455)Azure Active Directory (ADD)Sonar Qube plugin verison - 1.1Please help me.
|
You’re not authorized to access this page. Please contact the administrator. After Integrating with SAML Active directory
|
I Figured it out.It was the request filtering feature. I had to up theMaximum allowed content length (Bytes)SeeLarge File Upload in IIS
|
I'm setting up a fresh installation of SonarQube Version 7.9.1 (build 27448)It's running behind a reverse-proxy in IIS using URL Rewrite.I can login just fine into SonarQube.It is failing when running analysis for my .Net solution (a big one) using sonar-scanner-msbuild-4.7.1.2311-net46. It failes at the end, after compilation and analysis happened.INFO: Analysis report generated in 33994ms, dir size=196 MB
INFO: Analysis report compressed in 191901ms, zip size=71 MB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:46:46.636s
INFO: Final Memory: 20M/746M
ERROR: Error during SonarQube Scanner execution
INFO: ------------------------------------------------------------------------
ERROR: Failed to upload report - HTTP code 413: The page was not displayed because the request entity is too large.
ERROR:
The SonarQube Scanner did not complete successfully
00:52:36.207 Post-processing failed. Exit code: 1Googling HTTP 413 found some solutions to enable<serverRuntime>and setuploadReadAheadSizeto it's max (see below).This did not fix my problem.
|
Failed to upload report - HTTP code 413: The page was not displayed because the request entity is too large
|
Why are there 4 conditions? I think it should be 3 conditions.(A, B, C)No, there are4branches: A, B, C, and the other value which is not A, B, C. Yes, I don't care your enum has only 3 constants, that thing I care is that your switch statement has 4 valid branches to go, no matter you definedefaultor not.What should I do to fully cover 4 conditions?Ignore the warning, it should be redundant. If you want fully coverage, you have to add 1 more case to your test. Since you are switching an enum, you have to add another constant to your enum, too. Like:DEFAULT,UNKNOWN, etc.
|
I have a enum with 3 values(A, B, C).A switch expression is used in afoomethod to do some stuff according to the enum value.I also have a test case with different values as parameter to insure all conditions are covered.However, The results on SonarQube shows"partially covered by tests (3 of 4 conditions)."My questions:Why are there 4 conditions? I think it should be 3 conditions.(A, B, C)What should I do to fully cover 4 conditions?public enum FooType
{
A, B, C
}
public class TestCondition
{
public int foo (FooType type)
{
int ans = 0;
switch (type) {
case A:
ans = 10;
break;
case B:
ans = 20;
break;
case C:
ans = 30;
break;
}
return ans;
}
}
@Test
public void testFoo ()
{
TestCondition testCondition = new TestCondition();
testCondition.foo(FooType.A);
testCondition.foo(FooType.B);
testCondition.foo(FooType.C);
}[UPDATE]Try adding default case and the result is the same.It seems the fourth condition is thedefaultcase.What should I do to coverdefaultcase?Why did SonarQube count indefaultsince I didn't adddefaultin my switch statement?
|
Miscounting switch conditions with enum in SonarQube
|
Try Lombok:https://projectlombok.org/setup/maven, a simple annotation @Datafor your class definition will remove your code boilerplate (getter/setter/constructor/etc.).
|
For example:class a {
int field1;
int field2;
public a(int field1, int field2){ this.field1 = field1; this.field2 = field2;}
void setField1(int field1) {this.field1 = field1;}
void setField2(int field2) {this.field2 = field2;}
}Sometimes when i create an instance, i need to set both parameters, and sometimes i need to change some values, so i need both setters and constructor. Why does SONAR marks this as duplicate?
Is there only option is to tell sonar not to scan enitity files or there is a better way to solve this?
|
Why does sonar shows duplication error on a class with a constructor and a setter?
|
You can do:// Code refactor
function look(country) {
const countries = {
sa: 'South Africa',
uk: 'United-Kingdom',
northkorea: 'North-Korea',
au: 'Australia',
hongkong: 'Hong-Kong'
};
const toUpperCaseFirstLetter = c => c.replace(new RegExp(/\w/), s => s.charAt(0).toUpperCase());
return countries[country] || toUpperCaseFirstLetter(country);
}
// Testing:
[
'sa',
'uk',
'hongkong',
'spain', // <-- not in the function's `countries` object
].forEach(c => console.log(look(c)));
|
I have this function which has complexity greater than 12. I am trying to bring down it's complexity. I searched around but couldn't find anything too useful is it possible to reduce this complexity? - if so, how would I go about doing so?Here is the functionfunction sea(name) { +1
if (name === 'sa') { +1
return 'SA'; +1
} else if (name === 'uk') { +1
return 'UK'; +1
} else if (name === 'northkorea') { +1
return 'NK'; +1
} else if (name === 'hongkong') { +1
return 'HK'; +1
} else {
var rs = new RegExp(/\w);
return name.replace(rs, function(up) { +1
return up.charAt(0);
});
}
}```
|
How can I reduce cyclomatic complexity for the function
|
You could create an empty quality profile for Swift, and select that as the active quality profile for your project. Then, I believe theswiftLintissues will be imported, but you will no longer see issues from SonarSwift.
|
I'm importing swiftLint issues to Sonar using thissonar.swift.swiftLint.reportPaths=swiftlint.json.
This doesn't stop Sonar from analysing swift files using SonarSwift. Thus, issues from both the tools get uploaded to SonarCloud. I want Sonar to stop analysing by SonarSwift and only import SonarLint issues.
|
How to import external issues only on SonarCloud
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.