btclib-org / btclib

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

fixed error message and cleaned up code #103

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.61%.

Quality metrics Before After Change
Complexity 4.00 ⭐ 4.28 ⭐ 0.28 👎
Method Length 84.88 🙂 85.91 🙂 1.03 👎
Working memory 7.40 🙂 7.46 🙂 0.06 👎
Quality 67.55% 🙂 66.94% 🙂 -0.61% 👎
Other metrics Before After Change
Lines 1445 1445 0
Changed files Quality Before Quality After Quality Change
btclib/bip32/bip32.py 65.51% 🙂 63.21% 🙂 -2.30% 👎
btclib/ec/curve_group.py 69.45% 🙂 69.45% 🙂 0.00%
tests/bip32/test_bip32.py 66.55% 🙂 66.55% 🙂 0.00%

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/ec/curve_group.py CurveGroup.__init__ 13 🙂 224 ⛔ 11 😞 42.48% 😞 Try splitting into smaller methods. Extract out complex expressions
btclib/ec/curve_group.py _multi_mult 11 🙂 202 😞 12 😞 44.01% 😞 Try splitting into smaller methods. Extract out complex expressions
btclib/bip32/bip32.py _derive 16 🙂 164 😞 8 🙂 50.90% 🙂 Try splitting into smaller methods
btclib/ec/curve_group.py CurveGroup.add_jac 2 ⭐ 201 😞 11 😞 54.44% 🙂 Try splitting into smaller methods. 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!