Skip to content
This repository was archived by the owner on Dec 3, 2020. It is now read-only.

Commit f435bd4

Browse files
author
Daniel Reigada
committed
Fix division by 0
1 parent 16f8b06 commit f435bd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scala/com/codacy/parsers/implementation/JacocoParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class JacocoParser(val language: Language.Value, val rootProject: File, val cove
4444
((covered / (covered + missed)) * 100).toInt
4545
}
4646

47-
val fileHit = classHit.sum / classHit.length
47+
val fileHit = if (classHit.sum > 0) classHit.sum / classHit.length else 0
4848

4949
val lineHitMap = (file \\ "line").map {
5050
line =>

0 commit comments

Comments
 (0)