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

Commit 20d07b8

Browse files
authored
Merge pull request #32 from codacy/FAC-36
Fix line count
2 parents 899e6f7 + 5dd281c commit 20d07b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/codacy/parser.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def self.parse_file(simplecov_result)
1616
nil
1717
end
1818
end.compact
19-
lines_covered = v.compact.length == 0 ? 0 : ((coverage_lines.length.to_f / v.compact.length) * 100).round
19+
lines_covered = v.compact.length == 0 ? 0 : ((coverage_lines.count { |x| x[1] > 0 }.to_f / v.compact.length) * 100).round
2020
Hash[
2121
[['filename', file_dir],
2222
['total', lines_covered],

0 commit comments

Comments
 (0)