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

feat: handle rename when parent module is imported #347

Merged
merged 8 commits into from
Mar 2, 2021

Conversation

browniebroke
Copy link
Owner

fixes #63

@codecov
Copy link

codecov bot commented Feb 24, 2021

Codecov Report

Merging #347 (86cb14f) into main (beb3c23) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              main      #347    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           23        26     +3     
  Lines          742       900   +158     
==========================================
+ Hits           742       900   +158     
Impacted Files Coverage Δ
django_codemod/visitors/base.py 100.00% <100.00%> (ø)
django_codemod/visitors/core.py 100.00% <100.00%> (ø)
django_codemod/visitors/decorators.py 100.00% <100.00%> (ø)
django_codemod/visitors/urls.py 100.00% <100.00%> (ø)
django_codemod/visitors/__init__.py 100.00% <0.00%> (ø)
django_codemod/__init__.py 100.00% <0.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 beb3c23...86cb14f. Read the comment docs.

@browniebroke browniebroke changed the title feat: basic rename when parent module is imported feat: handle rename when parent module is imported Feb 24, 2021
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 1, 2021

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 6.42%.

Quality metrics Before After Change
Complexity 0.95 ⭐ 2.81 ⭐ 1.86 👎
Method Length 26.64 ⭐ 28.97 ⭐ 2.33 👎
Working memory 5.88 ⭐ 7.39 🙂 1.51 👎
Quality 88.41% 81.99% -6.42% 👎
Other metrics Before After Change
Lines 567 762 195
Changed files Quality Before Quality After Quality Change
django_codemod/visitors/base.py 85.01% ⭐ 68.85% 🙂 -16.16% 👎
django_codemod/visitors/core.py 98.17% ⭐ 98.17% ⭐ 0.00%
django_codemod/visitors/decorators.py 87.33% ⭐ 88.82% ⭐ 1.49% 👍
django_codemod/visitors/urls.py 81.65% ⭐ 79.80% ⭐ -1.85% 👎
tests/visitors/test_base.py 95.20% ⭐ 95.46% ⭐ 0.26% 👍
tests/visitors/test_core.py 96.34% ⭐ 96.34% ⭐ 0.00%

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
django_codemod/visitors/base.py import_from_matches.BaseRenameTransformer._check_import_from_exact 22 😞 133 😞 17 ⛔ 35.55% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
django_codemod/visitors/base.py import_from_matches.BaseRenameTransformer._check_import_from_parent 11 🙂 142 😞 15 😞 45.29% 😞 Try splitting into smaller methods. Extract out complex expressions
django_codemod/visitors/base.py import_from_matches.BaseRenameTransformer.leave_Attribute 2 ⭐ 48 ⭐ 12 😞 71.18% 🙂 Extract out complex expressions
tests/visitors/test_base.py test_module_matcher 0 ⭐ 78 🙂 10 😞 72.15% 🙂 Extract out complex expressions
django_codemod/visitors/base.py import_from_matches.BaseRenameTransformer._check_import_from_child 3 ⭐ 49 ⭐ 10 😞 73.66% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support renames when parent module is imported
1 participant