sbt-cpd
sbt-cpd copied to clipboard
It thinks whole file is duplicated
When I integrate the cpd4sbt 1.2.0, I got the result like
<?xml version="1.0" encoding="utf-8"?>
<pmd-cpd>
<duplication lines="408" tokens="2626">
<file line="1" path="D:\program\rrx\app\services\WechatService.scala"/>
<file line="1" path="D:\program\rrx\app\services\WechatService.scala"/>
<codefragment><,
buildInfoPackage := "tool"
)
plugins.sbt
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.6.1")
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
addSbtPlugin("de.johoop" % "cpd4sbt" % "1.2.0")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")
Same problem here
+1
I am seeing this problem in sbt-cpd 2.0.0 as well. Files are being compared with themselves. This is what I added to plugins.sbt:
addSbtPlugin("com.github.sbt" % "sbt-cpd" % "2.0.0")
while #19 is not merged and release, you can add to your settings as a workaround
CpdKeys.cpdSourceDirectories in Compile := (CpdKeys.cpdSourceDirectories in Compile).value.distinct
@jtjeferreira add to settings where?
@jtjeferreira add to settings where?
you must add that line to your project settings. For example if you use build.sbt add that line to the file...
@jtjeferreira adding that line to build.sbt gives an error
error: not found: value CpdKeys
CpdKeys.cpdSourceDirectories in Compile := (CpdKeys.cpdSourceDirectories in Compile).value.distinct
^
[error] Type error in expression
@keith-coursera you have to import com.github.sbt.cpd.CpdKeys