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

Set up precommit #59

Closed avendesora 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 6.29%.

Quality metrics Before After Change
Complexity 2.98 ⭐ 4.74 ⭐ 1.76 👎
Method Length 42.00 ⭐ 57.31 ⭐ 15.31 👎
Working memory 6.53 🙂 7.46 🙂 0.93 👎
Quality 80.62% 74.33% 🙂 -6.29% 👎
Other metrics Before After Change
Lines 7240 5861 -1379
Changed files Quality Before Quality After Quality Change
docs/source/conf.py 89.80% ⭐ 89.33% ⭐ -0.47% 👎
pythonbible/init.py 76.31% ⭐ 75.89% ⭐ -0.42% 👎
pythonbible/book_groups.py 71.74% 🙂 71.57% 🙂 -0.17% 👎
pythonbible/books.py 91.09% ⭐ 91.05% ⭐ -0.04% 👎
pythonbible/converter.py 53.02% 🙂 53.02% 🙂 0.00%
pythonbible/errors.py 76.30% ⭐ 76.43% ⭐ 0.13% 👍
pythonbible/formatter.py 74.77% 🙂 74.86% 🙂 0.09% 👍
pythonbible/normalized_reference.py 97.17% ⭐ 96.68% ⭐ -0.49% 👎
pythonbible/parser.py 54.07% 🙂 56.10% 🙂 2.03% 👍
pythonbible/regular_expressions.py 46.46% 😞 45.13% 😞 -1.33% 👎
pythonbible/roman_numeral_util.py 85.62% ⭐ 86.40% ⭐ 0.78% 👍
pythonbible/validator.py 86.81% ⭐ 86.81% ⭐ 0.00%
pythonbible/verses.py 88.16% ⭐ 86.26% ⭐ -1.90% 👎
pythonbible/versions.py 85.13% ⭐ 85.10% ⭐ -0.03% 👎
pythonbible/bible/bible_parser.py 86.18% ⭐ 86.18% ⭐ 0.00%
pythonbible/bible/json_converter.py 88.98% ⭐ 89.20% ⭐ 0.22% 👍
pythonbible/bible/osis/constants.py 86.97% ⭐ 86.48% ⭐ -0.49% 👎
pythonbible/bible/osis/parser.py 72.53% 🙂 72.38% 🙂 -0.15% 👎
pythonbible/counters/book_counter.py 98.18% ⭐ 98.18% ⭐ 0.00%
pythonbible/counters/chapter_counter.py 90.47% ⭐ 91.32% ⭐ 0.85% 👍
pythonbible/counters/verse_counter.py 73.10% 🙂 73.10% 🙂 0.00%
tests/init.py % % %
tests/conftest.py 96.91% ⭐ 96.84% ⭐ -0.07% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
pythonbible/parser.py _process_sub_reference 14 🙂 218 ⛔ 13 😞 38.70% 😞 Try splitting into smaller methods. Extract out complex expressions
pythonbible/parser.py normalize_reference 18 🙂 182 😞 12 😞 39.79% 😞 Try splitting into smaller methods. Extract out complex expressions
pythonbible/converter.py convert_verse_ids_to_references 11 🙂 179 😞 15 😞 41.63% 😞 Try splitting into smaller methods. Extract out complex expressions
pythonbible/formatter.py _format_scripture_text_verse_by_verse 13 🙂 109 🙂 15 😞 47.54% 😞 Extract out complex expressions
pythonbible/counters/verse_counter.py _get_number_of_verses_in_reference 16 🙂 98 🙂 10 😞 54.40% 🙂 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!