mrDoctorWho/vk4xmpp

View on GitHub

Showing 227 of 283 total issues

Function sendMessages has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def sendMessages(self, init=False, messages=None, mid=0, uid=0, filter_="unread"):
Severity: Minor
Found in gateway.py - About 35 mins to fix

    Function sendPhoto has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def sendPhoto(user, data, type, address, mType):
    Severity: Minor
    Found in modules/mod_xhtml.py - About 35 mins to fix

      Function parseXHTML has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def parseXHTML(user, html, source, destination, mType="user_id"):
      Severity: Minor
      Found in modules/mod_xhtml.py - About 35 mins to fix

        Function sendMessage has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def sendMessage(self, body, id, mType="user_id", more={}, mid=0):
        Severity: Minor
        Found in gateway.py - About 35 mins to fix

          Function getPrivacyLists has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def getPrivacyLists(disp):
              """
              Requests privacy lists from connected server.
              Returns dictionary of existing lists on success.
              """
          Severity: Minor
          Found in library/xmpp/features.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function Bind has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def Bind(self, domain=None):
                  """
                  Perform binding. Use provided domain name (if not provided).
                  """
                  while self.bound is None and self._owner.Process(1):
          Severity: Minor
          Found in library/xmpp/auth.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function cleanTheChatsUp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def cleanTheChatsUp():
              """
              Calls Dalek(s) to exterminate inactive users or their chats, whatever they catch
              """
              chats = runDatabaseQuery("select jid, owner, last_used, user from groupchats")
          Severity: Minor
          Found in extensions/groupchats.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(self, node=None):
                  """
                  Create new empty data item. However, note that, according XEP-0004, DataItem MUST contain ALL
                  DataFields described in DataReported.
                  Alternatively other XML object can be passed in as the "node" parameted to replicate it as a new
          Severity: Minor
          Found in library/xmpp/protocol.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function getCDATA has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def getCDATA(self):
                  """
                  Serialize node, dropping all tags and leaving CDATA intact.
                  That is effectively kills all formatting, leaving only text were contained in XML.
                  """
          Severity: Minor
          Found in library/xmpp/simplexml.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function _ReceivedRegInfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def _ReceivedRegInfo(con, resp, agent):
              iq = Iq("get", NS_REGISTER, to=agent)
              if not isResultNode(resp):
                  return None
              df = resp.getTag("query", namespace=NS_REGISTER).getTag("x", namespace=NS_DATA)
          Severity: Minor
          Found in library/xmpp/features.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function parseForwardedMessages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def parseForwardedMessages(self, msg, depth=0):
              body = ""
              result = (MSG_APPEND, "")
              if msg.get("fwd_messages"):
                  spacer = BASE_SPACER * depth
          Severity: Minor
          Found in extensions/forwarded_messages.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function parseReplyMessages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def parseReplyMessages(self, msg):
              body = ""
              result = (MSG_APPEND, "")
              if msg.get("reply_message"):
                  # todo: add date if the message wasn't sent today
          Severity: Minor
          Found in extensions/reply.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function login has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def login(self):
                  """
                  Logging in using password
                  """
                  url = "https://login.vk.com/"
          Severity: Minor
          Found in library/vkapi.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function StreamBrokenHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def StreamBrokenHandler(self, conn, stanza):
                  """
                  Handle stream closure due to all some error while receiving data.
                  Raise xmpppy event specifying unsuccessfull data receive.
                  """
          Severity: Minor
          Found in library/xmpp/filetransfer.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(self, node=None):
                  """
                  Create new empty "reported data" field. However, note that, according XEP-0004:
                  * It MUST contain one or more DataFields.
                  * Contained DataFields SHOULD possess a "type" and "label" attribute in addition to "var" attribute
          Severity: Minor
          Found in library/xmpp/protocol.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function _CommandHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def _CommandHandler(self, conn, request):
                  """
                  The internal method to process the routing of command execution requests.
                  """
                  # This is the command handler itself.
          Severity: Minor
          Found in library/xmpp/commands.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function getUserObject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def getUserObject(source):
                  """
                  Gets user object by chat jid
                  """
                  user = None
          Severity: Minor
          Found in extensions/groupchats.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function FeaturesHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def FeaturesHandler(self, conn, feats):
                  """
                  Used to determine if server supports SASL auth. Used internally.
                  """
                  if not feats.getTag("mechanisms", namespace=NS_SASL):
          Severity: Minor
          Found in library/xmpp/auth.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function main_iq_handler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def main_iq_handler(cl, iq):
              source = iq.getFrom()
              if WhiteList:
                  if source and source.getDomain() not in WhiteList:
                      sender(cl, utils.buildIQError(iq, xmpp.ERR_BAD_REQUEST, "You're not in the white-list"))
          Severity: Minor
          Found in modules/mod_iq_main.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function getPeerIds has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def getPeerIds(conversations, source=None):
                  """
                  Returns a list of peer ids that exist in the given conversations
                  Args:
                      conversations: list of Conversations objects
          Severity: Minor
          Found in gateway.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Severity
          Category
          Status
          Source
          Language