Sonar

Analyzing Android Project with Lint and SonarQube

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I really got an 'overflow' trying to make these things to work together. I followed instruction from here: http://docs.sonarqube.org/display/PLUG/Android+Lint+Plugin and finally got a SonarQube 5.1.1 server with Android Lint plugin 1.1 installed. Then I configured my multi-module Gradle build to work with SonarQube plugin: see code fragment from root config below. plugins { id 'org.sonarqube' version '1.0' } sonarqube { properties { property 'sonar.host.url', 'sonarqube-server:9000' property 'sonar.jdbc.url', 'jdbc:mysql://sonarqube-db:3306

The Sonar way to define a constant

匿名 (未验证) 提交于 2019-12-03 03:02:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use Sonarqube 5.1 and experiment with the “Sonar way” Java quality profile. The job is simple: I want to define a global String constant for a missing media type: public interface Utf8MediaType { String APPLICATION_JSON = "application/json;charset=UTF-8"; } However, Sonarqube tells me this is bad practice in rule . The long text talks about implementing this interface, which I didn’t intend to, but I give in and create a class instead: public class Utf8MediaType { public static final String APPLICATION_JSON = "application/json;charset=UTF

Disable rule in sonar

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to disable a rule from Sonar so it doesn't show the results in the web page. In my case I want to hide (or not capture) the results about trailing comments. Is it posible to configure it somewhere? Thanks. 回答1: You have to remove this rule in the quality profile that you are using to analyse your project. Please refer to the documentation that describes all this: Quality Profiles in Sonar . 回答2: The right way to do is to put something like this on sonar-project.properties file per project: sonar.issue.ignore.multicriteria=e1,e2 # tab

How to configure multi-module Maven + Sonar + JaCoCo to give merged coverage report?

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've searched up and down the internet for this one. There's lots of half-answers out there, to do with Maven properties such as ${sonar.jacoco.reportPath} , or org.jacoco:jacoco-maven-plugin:prepare-agent or setting maven-surefire-plugin argLine with -javaagent . Some how, none of these answers, either on their own, or in combination, are producing what I'm after: A coverage report which shows a class as covered if it is used in tests higher up the stack, such as entities being used by DAOs, even though it was not fully covered by tests in

Sonar violation: “Method may fail to close stream on exception”

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have this method: private void unZipElementsTo(String inputZipFileName, String destPath) throws FileNotFoundException, IOException { OutputStream out = null; InputStream in = null; ZipFile zf = null; try { zf = new ZipFile(inputZipFileName); for (Enumeration<? extends ZipEntry> em = zf.entries(); em.hasMoreElements();) { ZipEntry entry = em.nextElement(); String targetFile = destPath + FILE_SEPARATOR + entry.toString().replace("/", FILE_SEPARATOR); File temp = new File(targetFile); if (!temp.getParentFile().exists()) { temp.getParentFile()

Sonarcloud failure with Travis, Maven &amp; github [duplicate]

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: How do I get Sonarcloud to run on pull requests from forks with Travis, Maven & github 2 answers A project I work on ( eclipse/scanning ) uses Travis and Sonar for continuous integration and code analysis. Last week, I noticed that builds were failing at the sonar step with: ERROR: Error during SonarQube Scanner execution org.sonar.squidbridge.api.AnalysisException: Please provide compiled classes of your project with sonar.java.binaries property After some research, I thought I'd fixed this by

Sonar Lint not in sync with server rules

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Sonar Lint 2.0, It's connected to my own Sonar Qube server with no issues reported by the plugin. The issue is that it is not in sync with my server rules. Found those mentioned in the doc for Java but they also seemed not to be all. I wonder if these java rule list are used only when it's not connected to any server only. Does it have a restriction of what rules to use or synchronize when using a remote server? What exactly we can do to make it synch if it is possible. Plateform: Java SonarQube Server: Version 5.6+ Sonar Lint: Version 2.0

SonarRunner with gradle: Fail to download libraries from server

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have updated Sonar to the 4.5.1 LTS version, and now in my gradle task i have got the following error and can't fix it: Fail to download libraries from server build.gradle with sonar runner sonarRunner { sonarProperties { property "sonar.host.url", "http://sonar:9000" property "sonar.login", "" property "sonar.password", "" property "sonar.jdbc.url", "jdbc:mysql://sonar" property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver" property "sonar.jdbc.username", "sonar" property "sonar.jdbc.password", "sonar" property "sonar.profile",

Error 500 during Sonar runner execution on Jenkins

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting the below error when running sonarqube standalone analysis on Jenkins. The sonarqube scanner is able to identify the files to be analyzed and is able to analyze them fine, but the issue is when it is trying to publish the project to dashboard. When I open the URL http://vv123456:9000/api/ce/submit?projectKey=pkey&projectName=pname in browser, it says "{"errors":[{"msg":"HTTP method POST is required"}]}" , which means the sonarqube webservice is fine. Error on Jenkins build: ERROR: Error during Sonar runner execution org.sonar

sonar maven plugin build error, SonarQube version: null

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My jenkins builds just started to fail with this message: [INFO] --- sonar-maven-plugin:2.7:sonar (default-cli) @ cividas-core-web --- [INFO] artifact com.ontimize:ontimize-core: checking for updates from central [INFO] artifact com.ontimize:ontimize-core: checking for updates from imatia-local [INFO] artifact com.ontimize:ontimize-core: checking for updates from snapshots [INFO] User cache: /var/lib/jenkins/.sonar/cache [INFO] SonarQube version: null [INFO] ------------------------------------------------------------------------ [INFO]