Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 423 - Add coverage data to compare view #474

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ Lint/StructNewOverride:
Metrics/AbcSize:
Exclude:
- 'lib/rubycritic/configuration.rb'

Metrics/MethodLength:
Exclude:
- 'lib/rubycritic/core/analysed_modules_collection.rb'
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# main [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.9.0...main)

* [BUGFIX] Pass coverage data for compare branch mode (by [@rishijain][])

# v4.9.0 / 2023-10-18 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.8.1...v4.9.0)

* [CHANGE] Bump aruba, cucumber, fakefs, flog, mdl, minitest, and rubocop dependencies (by [@faisal][])
Expand Down
2 changes: 1 addition & 1 deletion lib/rubycritic/core/analysed_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def to_h
name: name, path: path, smells: smells,
churn: churn, committed_at: committed_at, complexity: complexity,
duplication: duplication, methods_count: methods_count, cost: cost,
rating: rating
rating: rating, coverage: coverage
}
end

Expand Down
3 changes: 2 additions & 1 deletion lib/rubycritic/core/analysed_modules_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def build_analysed_module(analysed_module)
committed_at: analysed_module.committed_at,
complexity: analysed_module.complexity,
duplication: analysed_module.duplication,
methods_count: analysed_module.methods_count
methods_count: analysed_module.methods_count,
coverage: analysed_module.coverage
)
end
end
Expand Down
3 changes: 2 additions & 1 deletion test/lib/rubycritic/core/analysed_modules_collection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
let(:analysed_modules) do
[RubyCritic::AnalysedModule.new(pathname: Pathname.new('test/samples/empty.rb'), name: 'Name', smells: [],
churn: 2, committed_at: Time.now, complexity: 2, duplication: 0,
methods_count: 2)]
methods_count: 2, coverage: 70.0)]
end

it 'registers one AnalysedModule element per existent file' do
Expand All @@ -61,6 +61,7 @@
_(analysed_module.complexity).must_equal 2
_(analysed_module.duplication).must_equal 0
_(analysed_module.methods_count).must_equal 2
_(analysed_module.coverage).must_equal 70.0
end
end
end
Expand Down
Loading