Generating dummy data for SonarQube

433 views Asked by At

I'd like to generate a dummy data for SonarQube to develop further Qualinsight SVN Badges.

Does SonarQube have the capability of generating "sandbox data" for developers? Or are there already features available for this kind of use-case?

The things I need to generate for are data for LOCs, Coverage, New Coverage, and Vulnerabilities with their respective periods.

1

There are 1 answers

1
slartidan On BEST ANSWER

No, SonarQube does not provide sample data.

However it is not difficult to get some data analyzed.

Either create minimal contents like this:

cd /tmp
cd $(mktemp -d)
pwd
echo "public class MyClass1 {}" > MyClass1.java
~/SonarSource/sonar-scanner-2.8/bin/sonar-scanner -Dsonar.projectKey=my_project -Dsonar.sources=. -Dsonar.login=admin -Dsonar.password=admin -Dsonar.version=1

Or check-out any pre-configured maven project (like for example "SonarSource/sonarqube" from github) and run mvn sonar:sonar.

Another solution might be to analyse your plugin's own source code. You will probably have it already configured. This might have the additional benefit, that you know your own code well, which will make it easier for you to understand and verify SonarQube's findings and statistics.