132nd-etcher/EMFT

View on GitHub

Showing 436 of 436 total issues

File mission.py has 1264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding=utf-8

import typing
from calendar import timegm
from itertools import chain
Severity: Major
Found in emft/miz/mission.py - About 3 days to fix
  • Create a ticket

    File base.py has 630 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # coding=utf-8
    import abc
    import typing
    from abc import abstractmethod
    
    
    Severity: Major
    Found in emft/gui/base.py - About 1 day to fix
    • Create a ticket

      File build.py has 617 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # coding=utf-8
      """
      Collections of tools to build EMFT
      """
      import datetime
      Severity: Major
      Found in emft/build.py - About 1 day to fix
      • Create a ticket

        File qt_resource.py has 594 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        
        # Resource object code
        #
        # Created by: The Resource Compiler for PyQt5 (Qt v5.9.1)
        Severity: Major
        Found in emft/resources/qt_resource.py - About 1 day to fix
        • Create a ticket

          Weather has 52 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Weather(BaseMissionObject):
              validator_precipitations = Validator(_type=int, _min=0, _max=4, exc=ValueError, logger=LOGGER)
              validator_cloud_density = Validator(_type=int, _min=0, _max=10, exc=ValueError, logger=LOGGER)
              validator_cloud_thickness = Validator(_type=int, _min=200, _max=2000, exc=ValueError,
                                                    logger=LOGGER)
          Severity: Major
          Found in emft/miz/mission.py - About 7 hrs to fix
          • Create a ticket

            Function object has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
            Open

                def object(self):  # noqa C901
                    o = dict()
                    k = ''
                    idx = 0
                    numeric_keys = False
            Severity: Minor
            Found in emft/core/sltp.py - About 5 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 __encode has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
            Open

                def __encode(self, obj, dict_name=None):  # noqa C901
                    s = ''
                    tab = self.tab
                    newline = self.newline
                    if isinstance(obj, str):
            Severity: Minor
            Found in emft/core/sltp.py - About 4 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

            Cyclomatic complexity is too high in method __encode. (20)
            Open

                def __encode(self, obj, dict_name=None):  # noqa C901
                    s = ''
                    tab = self.tab
                    newline = self.newline
                    if isinstance(obj, str):
            Severity: Minor
            Found in emft/core/sltp.py by radon

            Cyclomatic Complexity

            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

            Construct Effect on CC Reasoning
            if +1 An if statement is a single decision.
            elif +1 The elif statement adds another decision.
            else +0 The else statement does not cause a new decision. The decision is at the if.
            for +1 There is a decision at the start of the loop.
            while +1 There is a decision at the while statement.
            except +1 Each except branch adds a new conditional path of execution.
            finally +0 The finally block is unconditionally executed.
            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
            assert +1 The assert statement internally roughly equals a conditional statement.
            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

            Source: http://radon.readthedocs.org/en/latest/intro.html

            Function discover_skins has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def discover_skins(self):
            
                    self.__skins = {}
            
                    def scan_dir(p: Path):
            Severity: Minor
            Found in emft/core/filesystem/dcs_installs.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 filter_channel has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def filter_channel(
                    self,
                    versions: typing.Set[CustomVersion],
                    prerelease: str = channel.STABLE
                ):
            Severity: Minor
            Found in emft/updater/customspec.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

            Cyclomatic complexity is too high in method validate. (17)
            Open

                def validate(self, value, param_name, exc=None, logger=None):
                    """
                    :param value: value to validate
                    :param param_name: name of the value (for logging purpose)
                    :param exc: exception to raise (default is "ValidatorError")
            Severity: Minor
            Found in emft/core/validator.py by radon

            Cyclomatic Complexity

            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

            Construct Effect on CC Reasoning
            if +1 An if statement is a single decision.
            elif +1 The elif statement adds another decision.
            else +0 The else statement does not cause a new decision. The decision is at the if.
            for +1 There is a decision at the start of the loop.
            while +1 There is a decision at the while statement.
            except +1 Each except branch adds a new conditional path of execution.
            finally +0 The finally block is unconditionally executed.
            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
            assert +1 The assert statement internally roughly equals a conditional statement.
            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

            Source: http://radon.readthedocs.org/en/latest/intro.html

            Cyclomatic complexity is too high in method object. (16)
            Open

                def object(self):  # noqa C901
                    o = dict()
                    k = ''
                    idx = 0
                    numeric_keys = False
            Severity: Minor
            Found in emft/core/sltp.py by radon

            Cyclomatic Complexity

            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

            Construct Effect on CC Reasoning
            if +1 An if statement is a single decision.
            elif +1 The elif statement adds another decision.
            else +0 The else statement does not cause a new decision. The decision is at the if.
            for +1 There is a decision at the start of the loop.
            while +1 There is a decision at the while statement.
            except +1 Each except branch adds a new conditional path of execution.
            finally +0 The finally block is unconditionally executed.
            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
            assert +1 The assert statement internally roughly equals a conditional statement.
            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

            Source: http://radon.readthedocs.org/en/latest/intro.html

            Group has 27 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Group(Country):
                attribs = ('group_category', 'group_index', 'group_hidden', 'group_start_time', '_group_name_key')
            
                class Route:
            
            
            Severity: Minor
            Found in emft/miz/mission.py - About 3 hrs to fix
            • Create a ticket

              Cyclomatic complexity is too high in method data. (14)
              Open

                  def data(self, index: QModelIndex, role=Qt.DisplayRole):
                      if index.isValid():
                          if role == Qt.DisplayRole:
                              item = self._data[index.row()]
                              if hasattr(item, '__len__'):
              Severity: Minor
              Found in emft/gui/base.py by radon

              Cyclomatic Complexity

              Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

              Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

              Construct Effect on CC Reasoning
              if +1 An if statement is a single decision.
              elif +1 The elif statement adds another decision.
              else +0 The else statement does not cause a new decision. The decision is at the if.
              for +1 There is a decision at the start of the loop.
              while +1 There is a decision at the while statement.
              except +1 Each except branch adds a new conditional path of execution.
              finally +0 The finally block is unconditionally executed.
              with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
              assert +1 The assert statement internally roughly equals a conditional statement.
              Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
              Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

              Source: http://radon.readthedocs.org/en/latest/intro.html

              File sltp.py has 294 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # coding=utf-8
              """Simple Lua Python Parser"""
              import re
              
              import mpmath
              Severity: Minor
              Found in emft/core/sltp.py - About 3 hrs to fix
              • Create a ticket

                Updater has 26 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Updater(Machine):
                    def __init__(self, current_version: str, av_user: str, av_repo: str, local_executable: str, channel: str, **_):
                        Machine.__init__(
                            self,
                            states=[
                Severity: Minor
                Found in emft/updater/updater.py - About 3 hrs to fix
                • Create a ticket

                  GroundControl has 26 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class GroundControl(BaseMissionObject):
                      validator_commander = Validator(_type=int, _min=0, _max=100, exc=ValueError, logger=LOGGER)
                  
                      def __init__(self, mission_dict, l10n):
                          super().__init__(mission_dict, l10n)
                  Severity: Minor
                  Found in emft/miz/mission.py - About 3 hrs to fix
                  • Create a ticket

                    Cyclomatic complexity is too high in method tab_roster_show_data_in_table. (13)
                    Open

                        def tab_roster_show_data_in_table(self, *_):
                    
                            miz_data = self._parse_miz_data()
                            roster_data = self._parse_roster_data()
                    
                    
                    Severity: Minor
                    Found in emft/gui/tab_roster.py by radon

                    Cyclomatic Complexity

                    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                    Construct Effect on CC Reasoning
                    if +1 An if statement is a single decision.
                    elif +1 The elif statement adds another decision.
                    else +0 The else statement does not cause a new decision. The decision is at the if.
                    for +1 There is a decision at the start of the loop.
                    while +1 There is a decision at the while statement.
                    except +1 Each except branch adds a new conditional path of execution.
                    finally +0 The finally block is unconditionally executed.
                    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                    assert +1 The assert statement internally roughly equals a conditional statement.
                    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                    Source: http://radon.readthedocs.org/en/latest/intro.html

                    Cyclomatic complexity is too high in function main. (13)
                    Open

                    @click.group(invoke_without_command=True, chain=True)
                    @click.pass_context
                    @click.option('-t', '--test', is_flag=True, help='Test and exit')
                    @click.option('-p', '--profile', is_flag=True, help='Profile execution')
                    @click.option('-v', '--verbose', is_flag=True, help='Outputs debug messages')
                    Severity: Minor
                    Found in emft/main.py by radon

                    Cyclomatic Complexity

                    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                    Construct Effect on CC Reasoning
                    if +1 An if statement is a single decision.
                    elif +1 The elif statement adds another decision.
                    else +0 The else statement does not cause a new decision. The decision is at the if.
                    for +1 There is a decision at the start of the loop.
                    while +1 There is a decision at the while statement.
                    except +1 Each except branch adds a new conditional path of execution.
                    finally +0 The finally block is unconditionally executed.
                    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                    assert +1 The assert statement internally roughly equals a conditional statement.
                    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                    Source: http://radon.readthedocs.org/en/latest/intro.html

                    Cyclomatic complexity is too high in method add_children. (13)
                    Open

                        def add_children(self, children: list):  # noqa C901
                            for r in range(len(children)):  # "r" is the row
                                child = children[r]
                                for c in range(len(child)):  # "c" is the column
                                    if child[c] is None:
                    Severity: Minor
                    Found in emft/gui/base.py by radon

                    Cyclomatic Complexity

                    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                    Construct Effect on CC Reasoning
                    if +1 An if statement is a single decision.
                    elif +1 The elif statement adds another decision.
                    else +0 The else statement does not cause a new decision. The decision is at the if.
                    for +1 There is a decision at the start of the loop.
                    while +1 There is a decision at the while statement.
                    except +1 Each except branch adds a new conditional path of execution.
                    finally +0 The finally block is unconditionally executed.
                    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                    assert +1 The assert statement internally roughly equals a conditional statement.
                    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                    Source: http://radon.readthedocs.org/en/latest/intro.html

                    Severity
                    Category
                    Status
                    Source
                    Language