NabDev/NabBot

View on GitHub

Showing 14 of 14 total issues

Consider simplifying this complex logical expression.
Open

        if a < 125 or (r < 15 and g < 15 and b < 15) or (r > 254 and g > 254 and b > 254):
            continue
        return r, g, b
Severity: Major
Found in cogs/utils/__init__.py - About 1 hr to fix

    Avoid deeply nested control flow statements.
    Open

                            with closing(wiki_db.cursor()) as c:
                                c.execute("""SELECT item.name FROM item
                                             LEFT JOIN item_attribute att on item_id = item.article_id
                                             WHERE item.name LIKE ? AND article_id = item_id AND att.name = 'imbuement'
                                             LIMIT 1""", (item,))
    Severity: Major
    Found in cogs/loot.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if not image_copy.getpixel((x + xs, y + ys)) == slot_border[s] \
                                      and image_copy.getpixel((x + xs, y + ys)) not in [(24, 24, 24, 255),
                                                                                        (55, 55, 55, 255),
                                                                                        (57, 57, 57, 255),
                                                                                        (75, 76, 76, 255),
      Severity: Major
      Found in cogs/loot.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if last_scan_ss >= current_ss:
                                        log.debug(f"{tag} {values[0].name} | {values[1].name} | Already saved")
                                        await asyncio.sleep(0.1)
                                        continue
                                try:
        Severity: Major
        Found in cogs/tracking.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if result:
                                      has_marketable = True
                                      emoji = "💎"
                                  else:
                                      emoji = ""
          Severity: Major
          Found in cogs/loot.py - About 45 mins to fix

            Avoid too many return statements within this function.
            Open

                    return "moments"
            Severity: Major
            Found in cogs/utils/__init__.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return "{0} minutes".format(minutes)
              Severity: Major
              Found in cogs/utils/__init__.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return commands.check(predicate)
                Severity: Major
                Found in cogs/utils/checks.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return commands.check(predicate)
                  Severity: Major
                  Found in cogs/utils/checks.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return None
                    Severity: Major
                    Found in cogs/utils/tibia.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return "1 hour"
                      Severity: Major
                      Found in cogs/utils/__init__.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return "none"
                        Severity: Major
                        Found in cogs/utils/tibia.py - About 30 mins to fix

                          Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed.
                          Open

                          def check_sql_database(conn: sqlite3.Connection):
                          Severity: Critical
                          Found in cogs/utils/database_migration.py by sonar-python

                          Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                          See

                          Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
                          Open

                              async def stats(self, ctx: NabCtx, *, params: str):
                          Severity: Critical
                          Found in cogs/calculators.py by sonar-python

                          Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                          See

                          Severity
                          Category
                          Status
                          Source
                          Language