Imports needs to be excluded from Duplications

Hello :wave:

I realised that imports in files are considered as duplications. I experienced it in Kotlin classes since my project is written in Kotlin but I am sure other files has same issues too.

To give example

package com.github.mustafaozhan.ccc.backend.routes

import com.github.mustafaozhan.ccc.backend.util.getResourceByName
import com.github.mustafaozhan.ccc.common.log.kermit
import io.ktor.http.ContentType
import io.ktor.response.respondText
import io.ktor.routing.Route
import io.ktor.routing.get

this part of file marked as duplication since another file in same direction has same imports

Imports should be excluded from duplications :slight_smile:

Hello @mustafaozhan, and welcome to the Codacy community!

The tool that Codacy uses to calculate code duplication for Kotlin is jscpd.

I found this open issue on the jscpd GitHub repository where a few people are also providing this feedback about the possibility of ignoring import statements from the code duplication:

Perhaps you can also provide your feedback there and follow the issue to see if there are new developments?


Hello @paulo.ribeiro :wave:
Thank you for sharing this I just did it :slightly_smiling_face:

1 Like