MongoEngine / flask-mongoengine

MongoEngine flask extension with WTF model forms support
Other
840 stars 256 forks source link

Sourcery refactored master branch #499

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

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[bot] commented 2 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.18 ⭐ 1.15 ⭐ -0.03 👍
Method Length 71.95 🙂 71.83 🙂 -0.12 👍
Working memory 6.43 🙂 6.49 🙂 0.06 👎
Quality 75.58% 75.49% -0.09% 👎
Other metrics Before After Change
Lines 926 932 6
Changed files Quality Before Quality After Quality Change
flask_mongoengine/sessions.py 73.53% 🙂 72.10% 🙂 -1.43% 👎
flask_mongoengine/wtf/orm.py 80.49% ⭐ 80.63% ⭐ 0.14% 👍
tests/test_forms.py 73.58% 🙂 73.59% 🙂 0.01% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
tests/test_forms.py test_model_form 0 ⭐ 339 ⛔ 8 🙂 56.40% 🙂 Try splitting into smaller methods
tests/test_forms.py test_modelselectfield_multiple 1 ⭐ 219 ⛔ 9 🙂 58.13% 🙂 Try splitting into smaller methods
flask_mongoengine/sessions.py MongoEngineSessionInterface.open_session 9 🙂 94 🙂 10 😞 61.05% 🙂 Extract out complex expressions
flask_mongoengine/sessions.py MongoEngineSessionInterface.save_session 4 ⭐ 107 🙂 11 😞 62.18% 🙂 Extract out complex expressions
tests/test_forms.py test_modelselectfield 0 ⭐ 181 😞 7 🙂 66.56% 🙂 Try splitting into smaller methods

Legend and Explanation

The emojis denote the absolute quality of the code:

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!

insspb commented 2 years ago

Need to implement project wide sourcery config first. These changes are not compatible with all supported python versions.