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

Optional parameters #60

Closed
wants to merge 4 commits into from
Closed

Optional parameters #60

wants to merge 4 commits into from

Conversation

matej2
Copy link

@matej2 matej2 commented Mar 28, 2022

This adds functionality for optional parameters and resolves a bug with default table names: https://docs.djangoproject.com/en/1.10/ref/models/options/#db-table

Edit: As an alternative to db name we can change confiuration in admin file so that the app wil take in account default table name.

Db table name
@matej2
Copy link
Author

matej2 commented Apr 22, 2022

@Abdenasser is this PR ok or should I add something? Can you please review it? I went trought quality report and i dont think we could further optimize it since I added parameters...

@sourcery-ai
Copy link

sourcery-ai bot commented Apr 30, 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 0.55 ⭐ 0.56 ⭐ 0.01 👎
Method Length 57.74 ⭐ 58.09 ⭐ 0.35 👎
Working memory 7.91 🙂 7.89 🙂 -0.02 👍
Quality 77.50% 77.52% 0.02% 👍
Other metrics Before After Change
Lines 1125 1128 3
Changed files Quality Before Quality After Quality Change
dr_scaffold/generators.py 83.65% ⭐ 83.59% ⭐ -0.06% 👎
dr_scaffold/scaffold_templates/model_templates.py 51.73% 🙂 51.73% 🙂 0.00%
tests/test_generator.py 75.71% ⭐ 75.71% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
tests/test_generator.py TestGenerator.test_generate_urls 0 ⭐ 170 😞 12 😞 57.30% 🙂 Try splitting into smaller methods. Extract out complex expressions
dr_scaffold/generators.py ModelGenerator.get_fields_string 8 ⭐ 109 🙂 11 😞 58.05% 🙂 Extract out complex expressions
tests/test_generator.py TestGenerator.test_generate_views 0 ⭐ 151 😞 11 😞 60.92% 🙂 Try splitting into smaller methods. Extract out complex expressions
tests/test_generator.py TestGenerator.test_register_models_to_admin 0 ⭐ 131 😞 11 😞 63.15% 🙂 Try splitting into smaller methods. Extract out complex expressions
tests/test_generator.py TestGenerator.test_generate_serializer 0 ⭐ 131 😞 11 😞 63.15% 🙂 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!

@Abdenasser Abdenasser closed this May 26, 2022
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.

None yet

2 participants