Hello,
I have two classes, XClientSettings
and YClientSettings
, both implementing an abstract class ClientSettings
. They only define constructors, however the code in both classes is marked as duplicate. It’s worth noting that the Strings in the @Value annotations differ inside the reported duplicate block (e.g. "\${XXX.circuitBreaker.maximumAttempts:10}"
in XClientSettings
class vs "\${YYY.circuitBreaker.maximumAttempts:10}"
in YClientSettings
class - which in my opinion should disallow them from being considered duplicate.
@Singleton
open class XClientSettings(
@Value("\${XXX.circuitBreaker.maximumAttempts:10}")
override val maxAttempts: Int = 10,
@Value("\${XXX.circuitBreaker.timeout:30}")
override val timeout: Int = 30,
@Value("\${XXX.circuitBreaker.expirationTime:300}")
override val expirationTime: Int = 300,
@Value("\${XXX.retry.enabled:true}")
override var retry: Boolean = true
) : ClientSettings() {
override val serviceName = "X"
}
Is it expected behavior? I’ve disposed of this issue by setting sonar.cpd.exclusions
in build.gradle
of my project, however I’m not sure whether such examples should be really considered as duplicates. Any suggestions on this issue?