Autoscan only selecting one line in one file

Hi there,

Today I’ve been trying to get the Autoscan feature working on our repository for pull requests: https://github.com/UKHO/spark-ais-to-raster

The .sonar.properties file contains:

sonar.sources=.

I understand from the documentation that Kotlin & Scala are supported, which should cover some of our sources, however the analysis only comes back with this:

Does anyone have a suggestion on how to get it to pick up the Scala code within the repository?

If this proves difficult, we’d approach this problem with our CircleCI chain, but we’ve also had issues with failing builds on Quality Gate failures.

Many thanks for any help!

Ciaran

Hi there,

A PR analysis on SonarCloud will show issues on the files changed in the pull request. Looking at your PR:

$ git diff --name-only origin/master
.sonarcloud.properties
build.gradle.kts
buildSrc/src/main/kotlin/Versions.kt
settings.gradle.kts

Only the buildSrc/src/main/kotlin/Versions.kt is analyzable, and so that’s the only file you see on SonarCloud.

If you make a change to a .scala file, then that should show up too.

I hope this helps!

Cheers,
Janos

Ah!

That would make sense.

Should I make a new post regarding our difficulties getting full SonarCloud runs to fail our builds if the scan isn’t successful?

Thanks for the help!

That sounds like a different topic, so yes, a new thread makes sense.