Amadren/lgogd_uri-mk.II

View on GitHub
lgogd_uri/gtkexcepthook.py

Summary

Maintainability
D
1 day
Test Coverage

Function analyse has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

def analyse(exctyp, value, tb):
    import tokenize, keyword

    trace = StringIO()
    nlines = 3
Severity: Minor
Found in lgogd_uri/gtkexcepthook.py - About 7 hrs 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 _info has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def _info(exctyp, value, tb):
    trace = None
    dialog = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_WARNING, buttons=gtk.BUTTONS_NONE)
    dialog.set_title(_("Bug Detected"))
    if gtk.check_version(2, 4, 0) is not None:
Severity: Minor
Found in lgogd_uri/gtkexcepthook.py - About 3 hrs 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 lookup has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def lookup(name, frame, lcls):
    '''Find the value for a given name in the given frame'''
    if name in lcls:
        return 'local', lcls[name]
    elif name in frame.f_globals:
Severity: Minor
Found in lgogd_uri/gtkexcepthook.py - About 1 hr 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

Avoid deeply nested control flow statements.
Open

                    if name[-1] == '.':
                        try:
                            val = getattr(prev, tstr)
                        except AttributeError:
                            # XXX skip the rest of this identifier only
Severity: Major
Found in lgogd_uri/gtkexcepthook.py - About 45 mins to fix

    Avoid too many return statements within this function.
    Open

        return None, []
    Severity: Major
    Found in lgogd_uri/gtkexcepthook.py - About 30 mins to fix

      There are no issues that match your filters.

      Category
      Status