avendesora / pythonbible

A python library for validating, parsing, normalizing scripture references and retrieving scripture texts (for open source and public domain versions)
https://docs.python.bible
MIT License
58 stars 11 forks source link

Sourcery refactored main branch #26

Closed sourcery-ai[bot] closed 3 years ago

sourcery-ai[bot] commented 3 years ago

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^
sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 8.17 ⭐ 7.70 ⭐ -0.47 👍
Method Length 51.12 ⭐ 50.58 ⭐ -0.54 👍
Working memory 10.04 😞 10.05 😞 0.01 👎
Quality 62.15% 🙂 62.52% 🙂 0.37% 👍
Other metrics Before After Change
Lines 513 512 -1
Changed files Quality Before Quality After Quality Change
pythonbible/converter.py 48.35% 😞 49.69% 😞 1.34% 👍
pythonbible/bible/osis/parser.py 69.26% 🙂 69.19% 🙂 -0.07% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
pythonbible/converter.py convert_verse_ids_to_references 17 🙂 217 ⛔ 12 😞 37.91% 😞 Try splitting into smaller methods. Extract out complex expressions
pythonbible/bible/osis/parser.py _handle_child_element 12 🙂 118 🙂 12 😞 51.50% 🙂 Extract out complex expressions
pythonbible/bible/osis/parser.py _handle_verse_tag 10 🙂 111 🙂 12 😞 54.19% 🙂 Extract out complex expressions
pythonbible/bible/osis/parser.py _get_paragraphs 2 ⭐ 119 🙂 14 😞 57.90% 🙂 Extract out complex expressions
pythonbible/bible/osis/parser.py _get_paragraph_from_element 6 ⭐ 79 🙂 10 😞 66.07% 🙂 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!

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