SAGIRI-kawaii / sagiri-bot

基于Graia Ariadne和Mirai的QQ机器人 SAGIRI-BOT
GNU Affero General Public License v3.0
696 stars 83 forks source link

:bug: Multiple patches (Sourcery refactored) #394

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Pull Request #392 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/SAGIRI-kawaii/sagiri-bot pull/392/head
    git merge --ff-only FETCH_HEAD
    git push

NOTE: As code is pushed to the original Pull Request, Sourcery will re-run and update (force-push) this Pull Request with new refactorings as necessary. If Sourcery finds no refactorings at any point, this Pull Request will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Help us improve this pull request!

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 6.66 ⭐ 7.94 ⭐ 1.28 👎
Method Length 86.41 🙂 88.82 🙂 2.41 👎
Working memory 6.60 🙂 6.80 🙂 0.20 👎
Quality 62.25% 🙂 60.11% 🙂 -2.14% 👎
Other metrics Before After Change
Lines 216 233 17
Changed files Quality Before Quality After Quality Change
main.py 73.06% 🙂 75.01% ⭐ 1.95% 👍
shared/utils/tui.py 55.40% 🙂 50.71% 🙂 -4.69% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
shared/utils/tui.py process_info 23 😞 192 😞 19 ⛔ 27.48% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
shared/utils/tui.py set_config 15 🙂 239 ⛔ 38.10% 😞 Try splitting into smaller methods
main.py group_message_handler 0 ⭐ 69 🙂 11 😞 71.61% 🙂 Extract out complex expressions
main.py temp_message_listener 0 ⭐ 69 🙂 10 😞 73.51% 🙂 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!