MongoEngine / flask-mongoengine

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

New model form generator: Support of BooleanField #508

Closed insspb closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.72 ⭐ 0.80 ⭐ 0.08 👎
Method Length 50.55 ⭐ 51.00 ⭐ 0.45 👎
Working memory 5.95 ⭐ 6.01 ⭐ 0.06 👎
Quality 82.13% 81.92% -0.21% 👎
Other metrics Before After Change
Lines 2262 2335 73
Changed files Quality Before Quality After Quality Change
example_app/app.py 49.59% 😞 46.75% 😞 -2.84% 👎
example_app/views.py 76.98% ⭐ 77.05% ⭐ 0.07% 👍
flask_mongoengine/db_fields.py 83.91% ⭐ 83.96% ⭐ 0.05% 👍
flask_mongoengine/wtf/fields.py 82.84% ⭐ 81.36% ⭐ -1.48% 👎
tests/test_db_fields.py 84.57% ⭐ 84.58% ⭐ 0.01% 👍
tests/test_forms_v2.py 75.73% ⭐ 76.62% ⭐ 0.89% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
flask_mongoengine/db_fields.py StringField.__init__ 6 ⭐ 111 🙂 14 😞 54.98% 🙂 Extract out complex expressions
flask_mongoengine/db_fields.py WtfFieldMixin.__init__ 5 ⭐ 131 😞 12 😞 56.45% 🙂 Try splitting into smaller methods. Extract out complex expressions
tests/test_forms_v2.py test__full_document_form__does_not_create_any_unexpected_data_in_database 0 ⭐ 458 ⛔ 6 ⭐ 59.56% 🙂 Try splitting into smaller methods
tests/test_db_fields.py TestNumberFieldCommons.test__init__method__set_number_range_validator__if_range_given 0 ⭐ 105 🙂 11 😞 66.43% 🙂 Extract out complex expressions
example_app/views.py generate_data 1 ⭐ 232 ⛔ 5 ⭐ 66.91% 🙂 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!