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

Commit 4eb83af

Browse files
committed
division by zero
1 parent 439405e commit 4eb83af

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed
File renamed without changes.

lib/codacy/parser.rb

Lines changed: 1 addition & 1 deletion
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 = ((coverage_lines.length.to_f / v.compact.length) * 100).round
19+
lines_covered = v.compact.length == 0 ? 0 : ((coverage_lines.length.to_f / v.compact.length) * 100).round
2020
Hash[
2121
[['filename', file_dir],
2222
['total', lines_covered],

lib/codacy/reporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module Codacy
44
module Reporter
5-
def start
5+
def self.start
66
SimpleCov.formatter = Codacy::Formatter
77
SimpleCov.start
88
end

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ def format(result)
99
SimpleCov.formatter = InceptionFormatter
1010
SimpleCov.start
1111

12-
require 'codacy'
12+
require 'codacy-coverage'

0 commit comments

Comments
 (0)