Skip to content

Conversation

@sourcery-ai
Copy link

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

Branch master 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 master branch, then run:

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

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from dinh February 7, 2022 10:32
nb_url = os.path.join(directory, nb)
else:
nb_url = nb
nb_url = os.path.join(directory, nb) if directory else nb
Copy link
Author

Choose a reason for hiding this comment

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

Function gen_contents refactored with the following changes:

nbformat.write(content, os.path.join(NB_DEST_DIR, nb))

pagefile = os.path.join(PAGE_DEST_DIR, base + '.md')
pagefile = os.path.join(PAGE_DEST_DIR, f'{base}.md')
Copy link
Author

Choose a reason for hiding this comment

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

Function copy_notebooks refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Feb 7, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 21.64 😞 21.78 😞 0.14 👎
Method Length 55.82 ⭐ 55.64 ⭐ -0.18 👍
Working memory 10.40 😞 10.46 😞 0.06 👎
Quality 48.86% 😞 48.57% 😞 -0.29% 👎
Other metrics Before After Change
Lines 149 146 -3
Changed files Quality Before Quality After Quality Change
tools/generate_contents.py 80.73% ⭐ 82.27% ⭐ 1.54% 👍
website/copy_notebooks.py 32.92% 😞 32.92% 😞 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
website/copy_notebooks.py copy_notebooks 37 ⛔ 340.99 ⛔ 15 😞 17.40% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. 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!

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