sonarqube

Check Style Indentation violation - 'public' have incorrect indentation level 4, expected level should be 8

喜夏-厌秋 提交于 2019-12-11 02:57:58
问题 I am getting an checkstyle sonar violation on indendation rule (com.puppycrawl.tools.checkstyle.checks.indentation) 'public' have incorrect indentation level 4, expected level should be 8. at this line public Response getItem(@PathParam(CODE) final ProgramCode programCode, In Intelliji, Kindly suggest on how to change the indentation level to 8 回答1: Open up preferences (cmd + , on the Mac, ctrl + alt + s on Windows), and go to Editor -> Code Style -> Java. On the tabs and indents spaces you

Jenkins: how to run two different Sonar analysis in a Maven build?

北城以北 提交于 2019-12-11 02:48:00
问题 Hope someone can help. We have a Jenkins server We have 2 Sonar servers with different configurations Our projects use Maven We need to configure a Maven build in Jenkins that analyzes our project with the 2 Sonar server. We've configured the two Sonar installations in Jenkins but we can add only one Sonar analysis in the post-build actions. Is it possible to add multiple Sonar analysis in the post-build actions? Is there any workaround? 来源: https://stackoverflow.com/questions/19159785

SonarQube Java plugin custom rule

为君一笑 提交于 2019-12-11 02:42:42
问题 We have implemented a custom rule based on the BaseTreeVisitor in https://github.com/SonarSource/sonar-java/tree/master/java-checks/src/main/java/org/sonar/java/checks as described in http://docs.sonarqube.org/display/SONAR/Extending+Coding+Rules. We are able to deploy it and it appears as a new plugin in Sonar, but we couldn't find a way to add it to any of the quality profiles. Is this the correct way to implement a custom rule? If yes, how to deploy & use it in a profile properly? 回答1: It

Is the SonarQube Java analyser supposed to be able to analyse semantically incorrect Java source code?

左心房为你撑大大i 提交于 2019-12-11 02:38:36
问题 Given the following java source code, public class Test { private static int a; private static int a; } you will run into an error while analyzing, is it expected? I think it should be log as a parser failure, not to stop the analysis, right? ERROR: Error during Sonar runner execution org.sonar.runner.impl.RunnerException: Unable to execute Sonar at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91) at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75

Sonar Checkstyle import: Rule template can't be activated on a Quality profile

此生再无相见时 提交于 2019-12-11 02:36:25
问题 I'm trying to create a new quality profile with existing checkstyle ruleset but get the error message: Rule template can't be activated on a Quality profile: checkstyle:com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck I use the simplest ruleset example from the checkstyle officail site: <module name="Checker"> <module name="JavadocPackage"/> <module name="TreeWalker"> <module name="AvoidStarImport"/> <module name="ConstantName"/> <module name="EmptyBlock"/> </module> </module>

How can SonarQube be used to view results for specific directories (packages) of a project?

只谈情不闲聊 提交于 2019-12-11 02:27:26
问题 I want to investigate how certain rules and issues have been violated in a certain package, however, from what I have seen in the Components-interface in SonarQube, it is only possible to view leaf node-directories and I am interested in viewing the entire folder, including sub-folders and files in that folder. E.g. Project src package1 subdirectoryone done code-a.java dtwo code-x.java dthree code-i.java code-1.java code-2.java subdirectorytwo package2 subdirone subdirtwo In this example I

sonarQube Not excluding test files

不羁岁月 提交于 2019-12-11 02:05:28
问题 I have added sonar.exclusion=src/test/java/**/*.* sonar.test.exclusions=**/test/**/*.* properties into the sonar-project.properties file. But it is not excluding the test files when creating sonarQube code coverage document. I am using jenkins as building tool 回答1: According to the manual it should be sonar.exclusions , not sonar.exclusion . 来源: https://stackoverflow.com/questions/42111757/sonarqube-not-excluding-test-files

Connected Mode on SonarLint v2.0 on IntelliJ not working?

心已入冬 提交于 2019-12-11 02:03:55
问题 SonarLint v2.0 for IntelliJ is out now, and has this "connect to sonar server" feature, but even so, it seems it isn't in sync with my server rules. http://www.sonarlint.org/intellij/#Connected Is it working for someone? I'm I missing a step? Or could it be a bug? Thanks! IntelliJ Idea Version: 2016.1 SonarLint Version: 2.0.1 SonarQube Version: 5.4 回答1: SonarLint, as of now, won't work with third party analyzers like PMD or FindBug, if you are using those, they will simple be ignored. You can

Setting sonar profile together with sonar preview mode on maven command line

你说的曾经没有我的故事 提交于 2019-12-11 02:02:50
问题 I want to use a specific sonar profile with analysis mode preview for generating comments that go into our github pull requests. The default quality profile for the project includes minor and info level rules which will cause hundreds of extra comments (and literally thousands of github notification emails). So it has to be a quality profile specific to this purpose. Running the build like this: mvn sonar:sonar -Dsonar.profile.java=PRComments -Dsonar.analysis.mode=preview Fails with the

Own Sonar Plugin - How to set the Language?

旧巷老猫 提交于 2019-12-11 01:54:58
问题 I'm relative new to Sonar - especially to writing my own Sonar Plugin. After some successful trials, I got stuck now. I have written a simple Plugin which only should transfer source files (*.abap -Files) to the sonar server. and in my plugin I have an AbapLangauge (extended from AbstractLangauge) package sonarplugin; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.api.resources.AbstractLanguage; public class AbapLanguage