Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when loading big module #37

Merged
merged 1 commit into from Nov 10, 2021
Merged

Conversation

hikariatama
Copy link
Contributor

telethon.errors.rpcerrorlist.MediaCaptionTooLongError: The caption is too long (caused by EditMessageRequest)
When loading module, that contains the description, that doesn't fit in 2048 characters.

telethon.errors.rpcerrorlist.MediaCaptionTooLongError: The caption is too long (caused by EditMessageRequest)
When loading module, that contains the description, that doesn't fit in 2048 characters.
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 10, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 11.02 🙂 11.52 🙂 0.50 👎
Method Length 93.85 🙂 94.74 🙂 0.89 👎
Working memory 9.46 🙂 9.50 🙂 0.04 👎
Quality 58.69% 🙂 58.27% 🙂 -0.42% 👎
Other metrics Before After Change
Lines 432 436 4
Changed files Quality Before Quality After Quality Change
friendly-telegram/modules/loader.py 58.69% 🙂 58.27% 🙂 -0.42% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
friendly-telegram/modules/loader.py LoaderMod.load_module 39 ⛔ 447 ⛔ 16 ⛔ 14.09% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/modules/loader.py LoaderMod.send_module 11 🙂 222 ⛔ 15 😞 38.38% 😞 Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/modules/loader.py LoaderMod.loadmodcmd 13 🙂 136 😞 10 😞 52.09% 🙂 Try splitting into smaller methods. Extract out complex expressions
friendly-telegram/modules/loader.py LoaderMod.moduleinfocmd 10 🙂 168 😞 9 🙂 53.47% 🙂 Try splitting into smaller methods
friendly-telegram/modules/loader.py LoaderMod.restorecmd 9 🙂 158 😞 8 🙂 57.58% 🙂 Try splitting into smaller methods

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!

@hikariatama
Copy link
Contributor Author

hikariatama commented Nov 10, 2021

image

@rodion-gudz rodion-gudz merged commit 2ee18f6 into GeekTG:master Nov 10, 2021
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.

None yet

2 participants