btclib-org / btclib

btclib: a python3 library for 'bitcoin cryptography'
https://btclib.org
MIT License
97 stars 42 forks source link

improved test #104

Closed fametrano closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.30 ⭐ 4.32 ⭐ 0.02 👎
Method Length 99.69 🙂 100.25 🙂 0.56 👎
Working memory 7.05 🙂 7.09 🙂 0.04 👎
Quality 64.95% 🙂 64.75% 🙂 -0.20% 👎
Other metrics Before After Change
Lines 772 774 2
Changed files Quality Before Quality After Quality Change
btclib/bip32/bip32.py 63.21% 🙂 62.87% 🙂 -0.34% 👎
tests/bip32/test_bip32.py 66.55% 🙂 66.49% 🙂 -0.06% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
btclib/bip32/bip32.py BIP32KeyData.assert_valid 21 😞 304 ⛔ 11 😞 32.58% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
btclib/bip32/bip32.py _derive 16 🙂 164 😞 8 🙂 50.90% 🙂 Try splitting into smaller methods
tests/bip32/test_bip32.py test_derive_exceptions 3 ⭐ 295 ⛔ 7 🙂 57.00% 🙂 Try splitting into smaller methods
tests/bip32/test_bip32.py test_assert_valid2 0 ⭐ 469 ⛔ 7 🙂 57.02% 🙂 Try splitting into smaller methods
btclib/bip32/bip32.py crack_prv_key 9 🙂 218 ⛔ 6 ⭐ 57.43% 🙂 Try splitting into smaller methods

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!