iranzo/stampython

View on GitHub

Showing 97 of 154 total issues

Avoid deeply nested control flow statements.
Open

                    if result['ok'] is True or result['ok'] == 'True':
                        text = _("User %s muted on chat %s") % (user_id,
                                                                chat_id)
                    else:
                        text = _("Error muting user %s from chat %s: %s") % (
Severity: Major
Found in stampy/plugin/irccommands.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if len(newadmin) != 0:
                            stampy.plugin.config.setconfig(key='admin',
                                                           value=newadmin, gid=id)
                        else:
                            stampy.plugin.config.deleteconfig(key='admin', gid=id)
    Severity: Major
    Found in stampy/plugin/stats.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if code:
                              gidstoping.append(chat_id)
                              feedsupdated.append({'name': name, 'gid': gid,
                                                   'dateitem': dateitemfor})
      
      
      Severity: Major
      Found in stampy/plugin/feed.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if key in validkeys or gid == 0:
                                value = "=".join(word.split('=')[1:])
                                setconfig(key=key, value=value, gid=gid)
                                text = _("Setting config for `%s` to `%s`") % (key, value)
                            else:
        Severity: Major
        Found in stampy/plugin/config.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if result['ok'] is True or result['ok'] == 'True':
                                  text = _("Users %s deoped on chat %s") % (user_id, chat_id)
                              else:
                                  text = _("Error deoping users from chat %s: %s") % (chat_id, result)
          
          
          Severity: Major
          Found in stampy/plugin/irccommands.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if len(word) == 2:
                                    oper = word[-2:]
                                    try:
                                        word = msgdetail["replyto"].lower()
                                    except:
            Severity: Major
            Found in stampy/plugin/karma.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if result['ok'] is True or result['ok'] == 'True':
                                      text = _("User %s unbanned out of chat %s") % (user_id, chat_id)
                                  else:
                                      text = _("Error unbanning user %s from chat %s: %s") % (user_id, chat_id, result['description'])
                                  stampy.stampy.sendmessage(chat_id=chat_id, text=text, reply_to_message_id=message_id, disable_web_page_preview=True, parse_mode="Markdown")
              Severity: Major
              Found in stampy/plugin/irccommands.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if token:
                                            chanlinkslave(message=message, token=token)
                                    except:
                Severity: Major
                Found in stampy/plugin/admin.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if url and 'USA-' in title:
                                          url = url = "https://us-redhat.icims.com/jobs/%s/job?iis=A+Red+Hat+Employee&iispid=21098" % jobid
                  
                  
                  Severity: Major
                  Found in stampy/plugin/feed.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if gid > 0:  # user private chat
                                            validkeys = ['language', 'currency', 'modulo',
                                                         'stock', 'espp', 'cleanlink', 'cleankey']
                                        elif gid < 0:  # group chat or channel
                                            validkeys = ['language', 'currency', 'modulo',
                    Severity: Major
                    Found in stampy/plugin/config.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if key == 'gid':
                                              value = texto.split('=')[1:][0].lower()
                                              text = _("Setting gid for sudo to `%s`") % value
                                              stampy.stampy.sendmessage(chat_id=chat_id, text=text,
                                                                        reply_to_message_id=message_id,
                      Severity: Major
                      Found in stampy/plugin/sudo.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if command == trigger[1:]:
                                                runplugin = True
                                                break
                                        elif trigger in texto:
                        Severity: Major
                        Found in stampy/stampy.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if result['ok'] is True or result['ok'] == 'True':
                                                  text = _("Users opped on chat %s") % chat_id
                                              else:
                                                  text = _("Error opping users from chat %s: %s") % (chat_id, result)
                          
                          
                          Severity: Major
                          Found in stampy/plugin/irccommands.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if result['ok'] is True or result['ok'] == 'True':
                                                    text = _("User %s oped on chat %s") % (user_id, chat_id)
                                                else:
                                                    text = _("Error oping user %s from chat %s: %s") % (user_id, chat_id, result)
                            
                            
                            Severity: Major
                            Found in stampy/plugin/irccommands.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if newurl != url:
                                                      delete = True
                              
                                                  # Check if url has to be cleaned
                                                  if cleankey:
                              Severity: Major
                              Found in stampy/plugin/cleanlink.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    for item in word:
                                                        if stampy.plugin.alias.getalias(item, gid=gid):
                                                            item = stampy.plugin.alias.getalias(item, gid=gid)
                                                        if oper == "++" and item not in wordadd:
                                                            wordadd.append(item)
                                Severity: Major
                                Found in stampy/plugin/karma.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if stampy.plugin.config.config(key='sudo'):
                                                          # "=" was not in first command, so consider a command to use as 'sudo'
                                  
                                                          # It is a new list, with unique message, so we can alter it
                                                          stampy.plugin.config.setconfig(key='overridegid', gid=0, value=message['message']['chat']['id'])
                                  Severity: Major
                                  Found in stampy/plugin/sudo.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if "@" in each:
                                                            username = each[1:-1]
                                                if username and username != "@":
                                    Severity: Major
                                    Found in stampy/plugin/stats.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if result['ok'] is True or result['ok'] == 'True':
                                                              text = _("User %s unmuted on chat %s") % (user_id, chat_id)
                                                          else:
                                                              text = _("Error unmuting %s from chat %s: %s") % (
                                                                  user_id, chat_id, result)
                                      Severity: Major
                                      Found in stampy/plugin/irccommands.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if result['ok'] is True or result['ok'] == 'True':
                                                                text = _("User %s information: %s") % (user_id, result['result'])
                                                            else:
                                                                text = _("Error querying user %s information: %s") % (user_id, result)
                                        
                                        
                                        Severity: Major
                                        Found in stampy/plugin/irccommands.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language