Sonar : Replace this lambda with a method reference

You can’t replace the lambda input -> getValueProvider().apply(input).getValue() with a method reference without changing the semantics. A method reference replace a single method invocation, so it can’t simply replace a lambda expression consisting of more than one method invocation. A lambda expression of the form input -> getValueProvider().apply(input) could be replaced by getValueProvider()::apply if, and … Read more

Sonarqube is not showing code coverage after running

I found the solution – The maven plugin I have included has configuration of Jacoco’s destfile and datafile as ${basedir}/target/coverage-reports/jacoco-unit.exec but by default sonar reads at ${basedir}/target/jacoco.exec. I changed the default at http://localhost:9000/settings?category=java Ref: Sonar Code Coverage Couldn’t find the working reference link. Here is aux link: Baeldung Sonar and jacoco

Disable rule in sonar

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 characters should not be used sonar.issue.ignore.multicriteria.e1.ruleKey=squid:S00105 sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.java # right curly braces should be on a new line sonar.issue.ignore.multicriteria.e2.ruleKey=squid:RightCurlyBraceStartLineCheck sonar.issue.ignore.multicriteria.e2.resourceKey=**/*.java There are docs here on how to ignore specific rules for specific files, which links to an … Read more

How to recover admin password for SonarQube

Just an update to this the new link is here: https://docs.sonarqube.org/latest/instance-administration/security/#header-3 As it says on the link you can do this: In case you lost the admin password of your SonarQube instance, you can reset it by executing the following query: PostgreSQL and Microsoft SQL Server update users set crypted_password=’100000$t2h8AtNs1AlCHuLobDjHQTn9XppwTIx88UjqUm4s8RsfTuXQHSd/fpFexAnewwPsO6jGFQUv/24DnO55hY6Xew==’, salt=”k9x9eN127/3e/hf38iNiKwVfaVk=”, hash_method=’PBKDF2′, reset_password=’true’, user_local=”true” where … Read more

Error in sonar startup, Unable to start JVM: No such file or directory (2)

Issue was in the wrapper.conf where the java wrapper command was not getting resolved. It worked if I give the absolute path – ‘wrapper.java.command=/path/to/my/jdk/bin/java’ This could be an issue with an environment on a host.. not sure. Few things that helped me in troubleshooting this – log level changed to DEBUG in wrapper.conf comments given … Read more

How to make Sonarqube exclude a .NET (C#) project from coverage measures

Summing up the above mentioned answers and also adding one point to it. To exclude a project from SonarQube Analysis from csproj we can achieve by adding the below code in .csproj of that project <PropertyGroup> <!– Exclude the project from analysis –> <SonarQubeExclude>true</SonarQubeExclude> </PropertyGroup> To exclude a file from a project <ItemGroup> <SonarQubeSetting Include=”sonar.coverage.exclusions”> … Read more

The following projects do not have a valid ProjectGuid and were not built using a valid solution (.sln) thus will be skipped from analysis

As dotnet core projects (.csproj) will not have <ProjectGuid>…</ProjectGuid> tag specified in the default template this needs to be manually added. So you need to edit the .csproj file like this: <PropertyGroup> <!– other properties here –> <!– SonarQube needs this –> <ProjectGuid>{E2CEBBAF-6DF7-41E9-815D-9AD4CF90C844}</ProjectGuid> Make sure to place your own GUID inside the <ProjectGuid>…</ProjectGuid> Tag

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)