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

Add tests to methods #30

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Add tests to methods #30

wants to merge 5 commits into from

Conversation

fsargent
Copy link
Contributor

No description provided.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@fsargent fsargent mentioned this pull request Jun 16, 2022
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 17, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 1.37%.

Quality metrics Before After Change
Complexity 4.15 ⭐ 4.17 ⭐ 0.02 👎
Method Length 199.64 😞 193.60 😞 -6.04 👍
Working memory 11.42 😞 10.62 😞 -0.80 👍
Quality 55.92% 🙂 57.29% 🙂 1.37% 👍
Other metrics Before After Change
Lines 403 421 18
Changed files Quality Before Quality After Quality Change
examples/ballot_generator.py 64.24% 🙂 62.73% 🙂 -1.51% 👎
examples/methods.py 55.42% 🙂 58.01% 🙂 2.59% 👍
tests/test_ballot_generator.py 51.22% 🙂 51.22% 🙂 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
examples/methods.py STV 4 ⭐ 237 ⛔ 15 😞 44.12% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_ballot_generator.py MyTestCase.test_generate_ballot 0 ⭐ 295 ⛔ 16 ⛔ 44.38% 😞 Try splitting into smaller methods. Extract out complex expressions
examples/methods.py Allocated_Score 5 ⭐ 245 ⛔ 12 😞 46.94% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_ballot_generator.py MyTestCase.test_generate_ballot_multiple 21 😞 89 🙂 11 😞 50.05% 🙂 Refactor to reduce nesting. Extract out complex expressions
examples/methods.py MES 4 ⭐ 139 😞 13 😞 54.94% 🙂 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!

@fsargent fsargent requested a review from adienes November 17, 2022 06:27
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