MongoEngine / flask-mongoengine

MongoEngine flask extension with WTF model forms support
Other
841 stars 254 forks source link

New model form generator: Support of ComplexDateTimeField, DateField, DateTimeField #504

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.15%.

Quality metrics Before After Change
Complexity 0.81 ⭐ 0.81 ⭐ 0.00
Method Length 51.35 ⭐ 51.93 ⭐ 0.58 👎
Working memory 6.13 ⭐ 6.17 ⭐ 0.04 👎
Quality 82.35% 82.20% -0.15% 👎
Other metrics Before After Change
Lines 1847 1854 7
Changed files Quality Before Quality After Quality Change
example_app/app.py 53.02% 🙂 49.59% 😞 -3.43% 👎
example_app/numbers_demo.py 71.68% 🙂 69.93% 🙂 -1.75% 👎
example_app/strings_demo.py 70.26% 🙂 68.51% 🙂 -1.75% 👎
example_app/views.py 76.85% ⭐ 76.98% ⭐ 0.13% 👍
flask_mongoengine/db_fields.py 83.47% ⭐ 83.91% ⭐ 0.44% 👍
tests/test_db_fields.py 84.56% ⭐ 84.57% ⭐ 0.01% 👍

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_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
tests/test_db_fields.py TestStringFieldCommons.test__init__method__set_length_validator__if_size_given 0 ⭐ 90 🙂 11 😞 68.51% 🙂 Extract out complex expressions

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!