Code Monkey home page Code Monkey logo

emcd's Introduction

emcd's People

Contributors

forevka avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

emcd's Issues

Refactor 27 lines occurring 2 times in 2 files: change_coin_enabled_setting_coins_for_account.py, change_coins_for_account.py

I've selected for refactoring 27 lines of code which are duplicated in 2 file(s) (1, 2). Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Code Once guideline rating! πŸ‘

Here's the gist of this guideline:

  • Definition πŸ“–
    Do not copy code.
  • Why❓
    When code is copied, bugs need to be fixed in multiple places. This is both inefficient and a source of regression bugs.
  • How πŸ”§
    Avoid duplication by never copy/pasting blocks of code and reduce duplication by extracting shared code, either to a new unit or introduce a superclass if the language permits.

You can find more info about this guideline in Building Maintainable Software. πŸ“–


ℹ️ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the πŸ”² next to them. The risk profile below the candidates signals (βœ…) when it's enough! 🏁


Good luck and happy coding! :shipit: ✨ πŸ’―

Refactor 37 lines occurring 2 times in 2 files: faq_callback.py, faq_command_handler.py

I've selected for refactoring 37 lines of code which are duplicated in 2 file(s) (1, 2). Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Code Once guideline rating! πŸ‘

Here's the gist of this guideline:

  • Definition πŸ“–
    Do not copy code.
  • Why❓
    When code is copied, bugs need to be fixed in multiple places. This is both inefficient and a source of regression bugs.
  • How πŸ”§
    Avoid duplication by never copy/pasting blocks of code and reduce duplication by extracting shared code, either to a new unit or introduce a superclass if the language permits.

You can find more info about this guideline in Building Maintainable Software. πŸ“–


ℹ️ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the πŸ”² next to them. The risk profile below the candidates signals (βœ…) when it's enough! 🏁


Good luck and happy coding! :shipit: ✨ πŸ’―

Fix bug with deleted account

when user deleted account they still can click on button with not existed account, and it produces error

`2021-03-21 15:22:34.554 | ERROR | asyncio.base_events:default_exception_handler:1707 - Task exception was never retrieved
future: <Task finished name='Task-13006' coro=<Dispatcher._process_polling_updates() done, defined at /usr/local/lib/python3.8/site-packages/aiogram/dispatcher/dispatcher.py:380> exception=AttributeError("'NoneType' object has no attribute 'username'")>
Traceback (most recent call last):

File "/usr/local/lib/python3.8/site-packages/aiogram/dispatcher/dispatcher.py", line 388, in process_polling_updates
for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”” True
β”‚ β”‚ β”‚ β”‚ β”‚ β”” [<aiogram.types.update.Update object at 0x7fc46e6ad9a0>]
β”‚ β”‚ β”‚ β”‚ β”” <function Dispatcher.process_updates at 0x7fc46fde5b80>
β”‚ β”‚ β”‚ β”” <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7fc4716be370>
β”‚ β”‚ β”” <method 'from_iterable' of 'itertools.chain' objects>
β”‚ β”” <class 'itertools.chain'>
β”” <module 'itertools' (built-in)>
File "/usr/local/lib/python3.8/site-packages/aiogram/dispatcher/dispatcher.py", line 225, in process_updates
return await asyncio.gather(*tasks)
β”‚ β”‚ β”” [<coroutine object Handler.notify at 0x7fc46f4f7c40>]
β”‚ β”” <function gather at 0x7fc471315430>
β”” <module 'asyncio' from '/usr/local/lib/python3.8/asyncio/init.py'>
File "/usr/local/lib/python3.8/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
β”‚ β”‚ β”‚ β”” {}
β”‚ β”‚ β”” (<aiogram.types.update.Update object at 0x7fc46e6ad9a0>,)
β”‚ β”” <bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7fc4716be370>>
β”” Handler.HandlerObj(handler=<bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7...
File "/usr/local/lib/python3.8/site-packages/aiogram/dispatcher/dispatcher.py", line 273, in process_update
return await self.callback_query_handlers.notify(update.callback_query)
β”‚ β”‚ β”‚ β”‚ β”” <aiogram.types.fields.Field object at 0x7fc46ffb4670>
β”‚ β”‚ β”‚ β”” <aiogram.types.update.Update object at 0x7fc46e6ad9a0>
β”‚ β”‚ β”” <function Handler.notify at 0x7fc46ff2a310>
β”‚ β”” <aiogram.dispatcher.handler.Handler object at 0x7fc470953100>
β”” <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7fc4716be370>
File "/usr/local/lib/python3.8/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
β”‚ β”‚ β”‚ β”” {'user': <database.user_repo.UserRepository object at 0x7fc46f383be0>, '
': {'choose_account_to_delete': 'Π’Ρ‹Π±Π΅Ρ€ΠΈ ΠΊΠ°ΠΊΠΎΠΉ Π°ΠΊΠΊΠ°ΡƒΠ½...
β”‚ β”‚ β”” (<aiogram.types.callback_query.CallbackQuery object at 0x7fc46e6805e0>,)
β”‚ β”” <function account_cabinet_callback_handler at 0x7fc46f6e0160>
β”” Handler.HandlerObj(handler=<function account_cabinet_callback_handler at 0x7fc46f6e0160>, spec=FullArgSpec(args=['query', 'ca...

File "/app/handlers/callback/account_cabinet_handler.py", line 70, in account_cabinet_callback_handler
account_name=account.username
β”” None

AttributeError: 'NoneType' object has no attribute 'username'`

where to fix

https://github.com/Forevka/Emcd/blob/master/handlers/callback/account_cabinet_handler.py#L66

Refactor 22 lines occurring 2 times in 2 files: language_file_url.py, languages.py

I've selected for refactoring 22 lines of code which are duplicated in 2 file(s) (1, 2). Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Code Once guideline rating! πŸ‘

Here's the gist of this guideline:

  • Definition πŸ“–
    Do not copy code.
  • Why❓
    When code is copied, bugs need to be fixed in multiple places. This is both inefficient and a source of regression bugs.
  • How πŸ”§
    Avoid duplication by never copy/pasting blocks of code and reduce duplication by extracting shared code, either to a new unit or introduce a superclass if the language permits.

You can find more info about this guideline in Building Maintainable Software. πŸ“–


ℹ️ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the πŸ”² next to them. The risk profile below the candidates signals (βœ…) when it's enough! 🏁


Good luck and happy coding! :shipit: ✨ πŸ’―

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.