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

refactor: move fields logic to concern #915

Merged
merged 4 commits into from May 23, 2022
Merged

Conversation

adrianthedev
Copy link
Collaborator

@adrianthedev adrianthedev commented May 23, 2022

Description

Some house-cleaning. We're moving some things to concerns.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

return matched_field[:class] if matched_field.present? && matched_field[:class].present?
end

def parse_symbol(field_name, as:, **args, &block)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method parse_symbol has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.

@codeclimate
Copy link

codeclimate bot commented May 23, 2022

Code Climate has analyzed commit a1f1b61 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

return matched_field[:class] if matched_field.present? && matched_field[:class].present?
end

def parse_symbol(field_name, as:, **args, &block)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method parse_symbol has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.

@codecov
Copy link

codecov bot commented May 23, 2022

Codecov Report

Merging #915 (a1f1b61) into main (ea16361) will decrease coverage by 0.01%.
The diff coverage is 94.33%.

@@            Coverage Diff             @@
##             main     #915      +/-   ##
==========================================
- Coverage   93.88%   93.86%   -0.02%     
==========================================
  Files         483      483              
  Lines        9038     9050      +12     
==========================================
+ Hits         8485     8495      +10     
- Misses        553      555       +2     
Impacted Files Coverage Δ
lib/avo/concerns/has_fields.rb 93.33% <93.33%> (ø)
lib/avo/base_action.rb 91.26% <100.00%> (-0.09%) ⬇️
lib/avo/base_resource.rb 94.65% <100.00%> (-0.03%) ⬇️
lib/avo/grid_collector.rb 100.00% <100.00%> (ø)
spec/features/avo/belongs_to_polymorphic_spec.rb 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea16361...a1f1b61. Read the comment docs.

@adrianthedev adrianthedev merged commit 0fc1f95 into main May 23, 2022
@adrianthedev adrianthedev deleted the refactor/has-fields branch May 23, 2022 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant