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

Sourcery refactored main branch #201

Merged
merged 3 commits into from
Feb 21, 2022
Merged

Sourcery refactored main branch #201

merged 3 commits into from
Feb 21, 2022

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Feb 21, 2022

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from s-weigand February 21, 2022 09:00
flake8_nb/__main__.py Show resolved Hide resolved
flake8_nb/flake8_integration/cli.py Outdated Show resolved Hide resolved
flake8_nb/flake8_integration/formatter.py Outdated Show resolved Hide resolved
flake8_nb/parsers/notebook_parsers.py Outdated Show resolved Hide resolved
flake8_nb/parsers/notebook_parsers.py Outdated Show resolved Hide resolved
@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch s-weigand/flake8-nb/sourcery/main

@codecov
Copy link

codecov bot commented Feb 21, 2022

Codecov Report

Merging #201 (bd1eff0) into main (bac52ee) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #201   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          393       387    -6     
  Branches        69        70    +1     
=========================================
- Hits           393       387    -6     
Impacted Files Coverage Δ
flake8_nb/__main__.py 100.00% <100.00%> (ø)
flake8_nb/flake8_integration/cli.py 100.00% <100.00%> (ø)
flake8_nb/flake8_integration/formatter.py 100.00% <100.00%> (ø)
flake8_nb/parsers/cell_parsers.py 100.00% <100.00%> (ø)
flake8_nb/parsers/notebook_parsers.py 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 bac52ee...bd1eff0. Read the comment docs.

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Feb 21, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.02%.

Quality metrics Before After Change
Complexity 4.66 ⭐ 4.70 ⭐ 0.04 👎
Method Length 51.22 ⭐ 50.91 ⭐ -0.31 👍
Working memory 7.10 🙂 7.05 🙂 -0.05 👍
Quality 75.83% 75.85% 0.02% 👍
Other metrics Before After Change
Lines 1231 1223 -8
Changed files Quality Before Quality After Quality Change
flake8_nb/main.py 80.25% ⭐ 81.57% ⭐ 1.32% 👍
flake8_nb/flake8_integration/cli.py 74.31% 🙂 74.44% 🙂 0.13% 👍
flake8_nb/flake8_integration/formatter.py 72.89% 🙂 73.87% 🙂 0.98% 👍
flake8_nb/parsers/cell_parsers.py 78.71% ⭐ 78.71% ⭐ 0.00%
flake8_nb/parsers/notebook_parsers.py 75.39% ⭐ 75.09% ⭐ -0.30% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
flake8_nb/parsers/notebook_parsers.py get_notebook_code_cells 16 🙂 130 😞 9 🙂 52.35% 🙂 Try splitting into smaller methods
flake8_nb/flake8_integration/cli.py Flake8NbApplication.set_flake8_option 14 🙂 90 🙂 12 😞 53.54% 🙂 Extract out complex expressions
flake8_nb/flake8_integration/cli.py get_notebooks_from_args 12 🙂 119 🙂 10 😞 55.00% 🙂 Extract out complex expressions
flake8_nb/parsers/cell_parsers.py notebook_cell_to_intermediate_dict 2 ⭐ 95 🙂 11 😞 65.80% 🙂 Extract out complex expressions
flake8_nb/flake8_integration/formatter.py map_notebook_error 3 ⭐ 69 🙂 10 😞 70.52% 🙂 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!

Help us improve this quality report!

@s-weigand s-weigand merged commit d40e9d3 into main Feb 21, 2022
@s-weigand s-weigand deleted the sourcery/main branch February 21, 2022 09:40
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.

1 participant