mrDoctorWho/vk4xmpp

View on GitHub

Showing 283 of 283 total issues

Function acceptCaptcha has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def acceptCaptcha(key, source, destination):
    """
    Accepts the captcha value in 2 possible ways:
        1. User sent a message
        2. User sent an IQ with the captcha value
Severity: Minor
Found in modules/mod_msg_main.py - About 25 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 parseXHTML has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def parseXHTML(user, html, source, destination, mType="user_id"):
    body = html.getTag("body")
    if body:
        # TODO: Maybe would be better if we use regular expressions?
        src = body.getTagAttr("img", "src")
Severity: Minor
Found in modules/mod_xhtml.py - About 25 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 initializeUser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def initializeUser(source, resource, prs):
    """
    Initializes user for the first time after they connected
    """
    logger.debug("Got a presence. Searching jid in the database. (jid: %s)", source)
Severity: Minor
Found in modules/mod_prs_main.py - About 25 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