To help you get started with SonarQube, a list of sample projects is available here: https://github.com/SonarSource/sonar-scanning-examples

Various use cases are covered in those samples: