Skip to content
Open
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
11 changes: 6 additions & 5 deletions lib/ruby/file_revision.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ def complexity_report
end
end

if report.nil?
puts "WARNING: Could not parse #{@path}"
if report.nil? | report.empty?
STDOUT.write "WARNING: Could not parse #{@path}"
else
e = 1 + report[:num_dependencies]
b = 1 + report[:num_branches]
s = 1 + report[:num_superclasses]
print '.' # prints '.' to indicate something is happening
e = 1 + report.fetch(:num_dependencies, 1)
b = 1 + report.fetch(:num_branches, 1)
s = 1 + report.fetch(:num_superclasses, 1)
report['weight'] = b * e * s
report[:churn] = @repo.num_commits_involving(@path)
report[:filename] = @path
Expand Down