btclib-org / btclib

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

assorted minor fixes #97

Closed fametrano closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.76 ⭐ 4.74 ⭐ -0.02 👍
Method Length 71.14 🙂 71.14 🙂 0.00
Working memory 8.23 🙂 8.23 🙂 0.00
Quality 68.71% 🙂 68.73% 🙂 0.02% 👍
Other metrics Before After Change
Lines 2421 2420 -1
Changed files Quality Before Quality After Quality Change
btclib/number_theory.py 59.06% 🙂 59.06% 🙂 0.00%
btclib/utils.py 81.99% ⭐ 81.99% ⭐ 0.00%
btclib/ec/curve_group.py 69.45% 🙂 69.45% 🙂 0.00%
btclib/ecc/bms.py 62.89% 🙂 62.94% 🙂 0.05% 👍
btclib/ecc/dsa.py 67.02% 🙂 67.04% 🙂 0.02% 👍
btclib/ecc/ssa.py 69.02% 🙂 69.05% 🙂 0.03% 👍
btclib/tx/tx.py 74.62% 🙂 74.62% 🙂 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
btclib/ecc/ssa.py assert_batch_as_valid_ 10 🙂 311 ⛔ 13 😞 37.95% 😞 Try splitting into smaller methods. Extract out complex expressions
btclib/ecc/bms.py assert_as_valid 18 🙂 217 ⛔ 10 😞 40.77% 😞 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/number_theory.py tonelli 16 🙂 209 ⛔ 9 🙂 44.93% 😞 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!