sonarqube

How to use FxCop analysis with the new MsBuild Sonar runner?

拟墨画扇 提交于 2019-12-13 13:52:55
问题 I am trying to migrate from the old Sonar runner to the new MsBuild Sonar runner in a .NET project. The last problem I have is doing the FxCop analysis. If the quality profile in Sonar contains any FxCop rules, I get the following build error: ERROR: Caused by: The property "sonar.cs.fxcop.assembly" must be set and the project must have been built to execute FxCop rules. This property can be automatically set by the Analysis Bootstrapper for Visual Studio Projects plugin, see: http://docs

Grant group global permissions similar to sonar-administrators

大兔子大兔子 提交于 2019-12-13 13:16:02
问题 I create a SonarQube group sonar-administrators-ldap and mapped to LDAP sonar-administrators-ldap . Users under sonar-administrators-ldap are able to login successfully. When navigate to http://localhost:9000/roles/global , it only shows two default groups: Anyone and sonar-administrators , but not the new sonar-administrators-ldap group. How do I grant/revoke global permissions for groups other the default groups? 回答1: To create additional groups(similar to "sonar-administrators") with admin

Test coverage for if statement with logical or (||) - with Java's short circuiting, what's the forth condition JaCoCo wants me to cover?

坚强是说给别人听的谎言 提交于 2019-12-13 13:12:41
问题 This is probably a rather simple question, but I'm at a loss... I have an if statement like the following: if(TheEnum.A.equals(myEnum) || TheEnum.B.equals(myEnum)) TheEnum can be A , B , C , ... G (more than just 4 options). JaCoCo (SONAR) tells me that there are four conditions I can cover here. Which ones are those? Isn't the entire set I can test for in this instance essentially if(true || not_evaluated) => true if(false || true) => true if(false || false) => false I'm pretty sure I can't

How to define time/efforts in sonarqube quality gates

只愿长相守 提交于 2019-12-13 08:45:25
问题 I am using Sonar server 5.6 version. I want to set a quality gates such that efforts required to resolve all major issue should be less than or equal to 5 days (say). How can I specify such criteria as quality gates? I can see similar condition for "Reliability Remediation Effort" 回答1: Remediation costs, which are stored in minutes, are available only as totals per issue type (bug, vulnerability, code smell), not per severity. So you would set conditions on Technical Debt , Reliability

SonarQube says critical bug : provide an 'AssemblyVersion' attribute for this assembly 36 times

有些话、适合烂在心里 提交于 2019-12-13 08:45:07
问题 I am using SonarQube for the first time and a scan of my project revealed 38 bugs. 36 are the same bug: Provide an 'AssemblyVersion' attribute for this assembly. SonarQube says to resolve this bug I need to add [assembly: AssemblyTitle("MyAssembly")] [assembly: AssemblyVersionAttribute("1.2.125.0")] before the namespace in each of the 36 files... However, when I add it to even one file (With the correct title and version number) I get these errors in Visual Studio: I read this questions and

max_allowed_packet, I don't have MySQL

倖福魔咒の 提交于 2019-12-13 08:18:53
问题 I'm trying to run sonar-runner.bat, when it almost finished analyzing, it's written max_allowed_packet more than something something. So it fails. Through deep search, everyone said that i should configer my.ini file inside MySQL folder. But, I don't have MySQL Installed. Log: Error: unable to execute sonar error: caused by: unable to save file sources error: caused by: Error updating database. cause: com.mysql.jdbc.packettoobigexception: packet for query is too large (3215747 >1048576). you

Can we run the SonarQube for Multiple Project?

拥有回忆 提交于 2019-12-13 08:06:32
问题 Am able to run the SonarQube for the One Project and am getting the Report in the Dashboard. But i have 50 Source projects to run at a time to get a Global Result. Is it Possible to run the sonar for multiple projects at a time. If yes what are the configurations need to be done. 回答1: You have to run SonarQube analysis one by one on each project, there's no other way. 来源: https://stackoverflow.com/questions/29145067/can-we-run-the-sonarqube-for-multiple-project

IT code coverage with sonar

不羁的心 提交于 2019-12-13 08:05:51
问题 I have the following task at hand: -- find IT code coverage for a project Given situation: -- IT code resides in a repository separate to the actual production code -- Production code that the tests were created for reside in more than one git repository. -- all of the above uses maven and are written in Java. I have tried following different tutorial and blogs but couldnt find a simpler answer. Can anyone either point me towards the right resource or give me hints for a kick start? 回答1: I

SonarQube doesn't show any issues with Maven project

你。 提交于 2019-12-13 07:05:48
问题 I was using Sonar two weeks ago and It worked fine. Now, when I run sonar, without having changed the project, it shows me 0 issues, 0% technical debt, etc .. ( 20-30 issues were found two weeks ago and the project didn't have changed) This is the result of mvn sonar:sonar mvn sonar:sonar [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Golzio-Maumert-Rebouh-SillaPellicer 1.0 [INFO] -------------------------

Possible null pointer dereference in SONAR

这一生的挚爱 提交于 2019-12-13 06:45:52
问题 I have tried to point critical issues in Sonar with the following code: if (candidate.isDirectory() && candidate.canRead() && TEMPLATE.equalsIgnoreCase(candidate.getName())) { List<String> fileContentList = Arrays.asList(candidate.list()); I have also done the change below, but it still didn't work if(null != Arrays.asList(candidate.list())){ List<String> fileContentList = Arrays.asList(candidate.list());} Please help. 回答1: The error occures because candidate can be null. See https://www