Scss files and duplication detection

Hello , I’m using sonarcloud with azure pipeline.

I found duplication code detection would not perform on any scss file , it will indicates 0 duplicated lines. But css is one of the analyzed languages, and scss files are recognized in css language ( Administration > General Settings > Languages > CSS)


Example :
src/cssfiles/css3.scss

.ComponentSection {
    flex-direction: column;
    flex-basis: 100%;
    display: flex;
    max-width: 64.5%;
    height: fit-content;
    padding-bottom: 50px;
    &__fieldset {
        padding:0;
        margin:0;
        border:none;
    }
}

src/cssfiles/test.scss

.ComponentSection {
    flex-direction: column;
    flex-basis: 100%;
    display: flex;
    max-width: 64.5%;
    height: fit-content;
    padding-bottom: 50px;
    &__fieldset {
        padding:0;
        margin:0;
        border:none;
    }
}

sonar-project.properties

sonar.projectKey=we****
sonar.sources=./src
sonar.sourceEncoding=UTF-8
sonar.tests=./test
sonar.cpd.css.minimumtokens=7
sonar.cpd.css.minimumLines=2
sonar.cpd.js.minimumtokens=7
sonar.cpd.js.minimumLines=2

found on overal code: Duplication : 0 %

Hi Tristan,

Thanks for raising this!
We currently don’t support duplication detection for CSS (nor SCSS).

This is definitely something that we can consider, I’ll add your +1 to our internal tracking for interest in this feature.

I’ll also see we update our documentation to be clear about this limitation.

1 Like

Thanks for the details ! It’s clear now

1 Like