Skip to content

Conversation

giacomocaironi
Copy link
Member

  • Fix import of script module
  • Make Tx fail assert_valid() when there are no inputs or outputs

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 6, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 3.64 ⭐ 3.65 ⭐ 0.01 👎
Method Length 92.97 🙂 93.94 🙂 0.97 👎
Working memory 8.26 🙂 8.38 🙂 0.12 👎
Quality 64.82% 🙂 64.52% 🙂 -0.30% 👎
Other metrics Before After Change
Lines 1680 1697 17
Changed files Quality Before Quality After Quality Change
btclib/alias.py 75.39% ⭐ 73.96% 🙂 -1.43% 👎
btclib/b32.py 72.21% 🙂 72.21% 🙂 0.00%
btclib/hashes.py 85.49% ⭐ 85.98% ⭐ 0.49% 👍
btclib/psbt/psbt.py 61.12% 🙂 61.12% 🙂 0.00%
btclib/script/__init__.py 53.98% 🙂 53.98% 🙂 0.00%
btclib/script/taproot.py 65.01% 🙂 64.83% 🙂 -0.18% 👎
btclib/tx/tx.py 74.62% 🙂 74.33% 🙂 -0.29% 👎
tests/tx/test_tx.py 59.35% 🙂 58.55% 🙂 -0.80% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
btclib/psbt/psbt.py Psbt.assert_signable 22 😞 163 😞 11 😞 40.42% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
btclib/psbt/psbt.py Psbt.parse 10 🙂 188 😞 15 😞 41.77% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/tx/test_tx.py test_tx 0 ⭐ 754 ⛔ 13 😞 44.57% 😞 Try splitting into smaller methods. Extract out complex expressions
btclib/script/taproot.py check_output_pubkey 8 ⭐ 212 ⛔ 11 😞 47.79% 😞 Try splitting into smaller methods. Extract out complex expressions
btclib/psbt/psbt.py join_psbts 5 ⭐ 158 😞 16 ⛔ 48.14% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

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!

@fametrano fametrano merged commit 57c2516 into master Feb 6, 2023
@fametrano fametrano deleted the fix_import branch February 6, 2023 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants