sonarqube

how can resolve dodgy:unchecked/unconfirmed cast in sonar?

别来无恙 提交于 2019-12-24 06:27:57
问题 iam getting the exception through sonar in this following code.How can I resolve this.Suggest me. @Override public boolean validate(BaseInfo infoObject) { boolean isValid = true; AckTransferPaymentInfo ackTransferPaymentInfo = (AckTransferPaymentInfo) infoObject; Dodgy - Unchecked/unconfirmed cast Unchecked/unconfirmed cast from com.vocalink.acsw.common.validation.info.BaseInfo to com.vocalink.acsw.common.validation.info.AckTransferPaymentInfo in com.vocalink.acsw.validation.rule.T170Rule

Programmatic coverage exclusions in SonarQube MSBuild runner

天大地大妈咪最大 提交于 2019-12-24 06:23:16
问题 Is there a way to programatically exclude artifacts from Sonar analysis using the MSBuild Scanner? We have a number of different Visual Studio solutions in our git repository. Almost all of these solutions make use of projects containing shared code. I am wishing to exclude code coverage from these common projects - but only for certain Sonar projects. Always excluding a project is straightforward and documented via adding a <PropertyGroup> section in the .csproj . Adding the /d:sonar

How to set stylecop.json creating Stylecop Anayzers plugin for Sonarqube?

帅比萌擦擦* 提交于 2019-12-24 05:49:22
问题 I want to use the rules of the StyleCop analyzer for Roslyn in SonarQube, In order to do that and following the documentation founded, I downloaded the SonarQube Roslyn SDK, and I generate the plugin. In my development environment I have a JSON file (stylecop.json) that add configuration: { "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", "settings": { "documentationRules": {

SonarQube scanner can't connect to server

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 04:55:06
问题 I faced the issue with the sonar-scanner-cli which can't connect to the SonarQube server. Scan is run from within the docker container. Docker connects to SonarQube server through proxy so I thought that it was the issue but I tried to set proxy environment variables and also pass proxy parameters to the scanner. That didn't help. Also other binaries like yum or gradle can connect to external repos without problem from the same container. SonarQube server version: 6.7.0.33306. 13:12:28.858

SonarQube error while analyzing code with binary literals

 ̄綄美尐妖づ 提交于 2019-12-24 04:14:06
问题 I want to use SonarQube to analyse my project which is built on Jenkins. In my project I have some literals written in binary system (e.g. 0b00001111). When I'm trying to do an analysis, I am obtaining fallowing error : [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project org: SonarQube is unable to analyze file : 'whatever': For input string: "b00001111" -> [Help 1] [...] Caused by: java.lang.NumberFormatException: For input string:

PMD plugin fails after upgrading Sonarqube to 4.5.4

守給你的承諾、 提交于 2019-12-24 04:08:33
问题 I am upgrading my existing SonarQube 3.7.4 installation to the new LTS release 4.5.4 . I'd like to reuse my ruleset and I am using the sonarqube ant task (as before) to analyze my projects. After upgrading the sonar installation and the ant task to 2.2 without changing anything else I'm getting a NoClassDefFoundError while executing the ant task: build.xml:1659: org.sonar.runner.impl.RunnerException: Unable to execute Sonar at org.sonar.runner.impl.BatchLauncher$1.delegateExecution

SonarQube: Cannot deactivate rule with missing quality profile

帅比萌擦擦* 提交于 2019-12-24 03:54:14
问题 I have a rule in my SonarQube that has no Quality Profile associated with it in the search list (The red box here). When I try to change it I get this 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? 回答1: The best way to fix these kinds

Unknown packaging: sonar-plugin

人盡茶涼 提交于 2019-12-24 03:24:18
问题 I need to build a sonar plugin. I am using maven to create project but I am getting error. Project build error: Unknown packaging: sonar-plugin my pom.xml is as below: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.phtpl</groupId> <artifactId>sonar

Does Sonar have computational complexity measuring capabilities?

点点圈 提交于 2019-12-24 03:23:41
问题 There is a question asking how to measure computational complexity of Java code similar to what trend-prof does for C/C++. The accepted answer to that question says it is commonly done using Sonar. I know that Sonar has good cyclomatic complexity capabilities built in, but that is not what the question was asking for. Does Sonar in fact have computational complexity measuring capabilities? If so any pointers to details on setting it up would be great. 回答1: No there aren't any similar tools

When run “sonar-runer” throw exception :“Caused by: Unknown database status: FRESH_INSTALL”

孤街醉人 提交于 2019-12-24 02:43:00
问题 I need help First , it throw exception cannot load class 'com.mysql.xxx.JDBC'",so I copy the sonarqube-4.0/extensions/jdbc-driver/mysql/mysql-connector-java-5.1.26.jar to the /usr/lib/jvm/java-7-sun/jre/lib/ext/ Then I run sonar-runner again, it throws this exception: Unknown database status: FRESH_INSTALL My heart is broken , plz help me 回答1: I saw this error when the database is empty (no tables are created). Usually tables are created during first start of sonar. Can you reach sonar by web