Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/main/scala/com/codacy/duplication/jscpd/Jscpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ object Jscpd extends DuplicationTool {
val filePath = o("name").as[String]
val startLine = o("start").as[Int]
val endLine = o("end").as[Int]
// We found a bug in jscpd where the startLine is, sometimes, bigger than the endLine
// so we need to normalize that
val normalizedStartLine = math.min(startLine, endLine)
val normalizedEndLine = math.max(startLine, endLine)
DuplicationCloneFile(
filePath = filePath,
startLine = startLine,
endLine = endLine
startLine = normalizedStartLine,
endLine = normalizedEndLine
)
})
)
Expand All @@ -89,4 +93,4 @@ object Jscpd extends DuplicationTool {
}
}

object Main extends DockerDuplication(Jscpd)()
object Main extends DockerDuplication(Jscpd)()