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 handling for leftover list elements after our main loop finishes #6

Merged
merged 3 commits into from
Apr 14, 2021

Conversation

sondrelg
Copy link
Contributor

@sondrelg sondrelg commented Apr 14, 2021

Fixes upstream test nr 10, but cheats (!) by changing the expected result. I reverted the div removal

Comment on lines +40 to +41
if list_nodes:
result += self._render_list(list_nodes)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We weren't handling leftover list elements, so if we ended on a list element we were getting bad results.

@sourcery-ai
Copy link

sourcery-ai bot commented Apr 14, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 6.99 ⭐ 7.22 ⭐ 0.23 👎
Method Length 62.25 🙂 63.25 🙂 1.00 👎
Working memory 9.53 🙂 9.46 🙂 -0.07 👍
Quality 66.49% 🙂 66.20% 🙂 -0.29% 👎
Other metrics Before After Change
Lines 141 145 4
Changed files Quality Before Quality After Quality Change
sanity_html/renderer.py 66.49% 🙂 66.20% 🙂 -0.29% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
sanity_html/renderer.py SanityBlockRenderer._render_list 9 🙂 128 😞 15 😞 48.74% 😞 Try splitting into smaller methods. Extract out complex expressions
sanity_html/renderer.py SanityBlockRenderer._render_node 6 ⭐ 65 🙂 10 😞 68.19% 🙂 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!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@sondrelg sondrelg merged commit f57d723 into main Apr 14, 2021
@sondrelg sondrelg deleted the sondrelg/correct-list-logic branch April 14, 2021 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant