benhoff/CHATIMUSMAXIMUS

View on GitHub

Showing 8 of 8 total issues

Function _recv_sub_socket has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def _recv_sub_socket(self):
        while True:
            frame = self.sub_socket.recv_multipart()
            message = decode_vex_message(frame)
            if message.type == 'MSG':
Severity: Minor
Found in chatimusmaximus/messaging.py - About 2 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 _set_settings has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def _set_settings(self, settings):
        # FIXME: not used
        # display = settings.get('display')
        for service, platform in settings['services'].items():
            if not service == 'youtube':
Severity: Minor
Found in chatimusmaximus/gui/main_window.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

Function main has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    # create the Application
    app = QtWidgets.QApplication(sys.argv)

    # create the event loop and set it in asyncio
Severity: Minor
Found in chatimusmaximus/__main__.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

Function __init__ has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def __init__(self, model, parent=None):
        super().__init__(parent)
        self.setWindowTitle('CHATIMUS Settings')
        self.setStyleSheet('background: black; color: white;')
        ok_button = QtWidgets.QPushButton('Ok')
Severity: Minor
Found in chatimusmaximus/gui/menu_bar.py - About 1 hr to fix

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

        def __getitem__(self, index):
            if isinstance(index, tuple):
                item = self
                for key in index:
                    if item != ():
    Severity: Minor
    Found in chatimusmaximus/gui/models/settings_model.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 parent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def parent(self, index):
            """
            Returns the parent (QModelIndex) of the given item (QModelIndex)
            Top level returns QModelIndex()
            """
    Severity: Minor
    Found in chatimusmaximus/gui/models/settings_model.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 __setitem__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def __setitem__(self, key, value):
            if isinstance(key, tuple):
                item = self
                previous_item = None
                for k in key:
    Severity: Minor
    Found in chatimusmaximus/gui/models/settings_model.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 rowCount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def rowCount(self, parent):
            """Returns number of rows in parent (QModelIndex)"""
            if parent.column() > 0:
                return 0    # only keys have children, not values
            if parent.isValid():
    Severity: Minor
    Found in chatimusmaximus/gui/models/settings_model.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