132nd-etcher/EMFT

View on GitHub

Showing 131 of 436 total issues

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

    def __getitem__(self, item) -> AVArtifact:
        if isinstance(item, int):
            if item > self.__len__():
                raise IndexError(item)
            return AVArtifact(self.json[item])
Severity: Minor
Found in emft/core/providers/appveyor/av_objects/av_artifact.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 validate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
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 - 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 10 (exceeds 5 allowed). Consider refactoring.
Open

def main(ctx, test, profile, verbose, quiet):  # pylint: disable=too-many-locals
    """Init Sentry"""
    # noinspection PyUnresolvedReferences
    from emft.core.sentry import SENTRY
    from emft.core.threadpool import register_sentry
Severity: Minor
Found in emft/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 word has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def word(self):
        s = ''
        if self.ch != '\n':
            s = self.ch
        while self.next_chr():
Severity: Minor
Found in emft/core/sltp.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 filterAcceptsRow has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def filterAcceptsRow(self, row: int, index: QModelIndex):  # noqa: N802
        if self._filter:
            model = self.sourceModel()
            for column, filter_ in enumerate(self._filter):
                if filter_:
Severity: Minor
Found in emft/gui/base.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 __getitem__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def __getitem__(self, item) -> GHAsset:
        if isinstance(item, int):
            if item > self.__len__() - 1:
                raise IndexError(item)
            return GHAsset(self.json[item])
Severity: Minor
Found in emft/core/providers/github/gh_objects/gh_asset.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 add_children has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def add_children(self, children: list):
        for child in children:
            params = {}
            if isinstance(child, tuple):
                params = child[1]
Severity: Minor
Found in emft/gui/base.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 __getitem__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def __getitem__(self, job_id) -> AVJob:
        if isinstance(job_id, int):
            if job_id > self.__len__() - 1:
                raise IndexError(job_id)
            else:
Severity: Minor
Found in emft/core/providers/appveyor/av_objects/av_job.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 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def __init__(self, parent=None):
        super(TabChildSkins, self).__init__(parent)

        self.no_install_label = Label('No DSC installation found on this system')
        self.no_install_label.set_text_color('red')
Severity: Minor
Found in emft/gui/tab_skins.py - About 1 hr to fix
  • Create a ticket

    Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, mission_dict, l10n, coa_color, country_index, group_category, group_index, unit_index):
    Severity: Major
    Found in emft/miz/mission.py - About 1 hr to fix
    • Create a ticket

      Function do has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def do(
      Severity: Major
      Found in emft/build.py - About 1 hr to fix
      • Create a ticket

        Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(
        Severity: Major
        Found in emft/gui/base.py - About 1 hr to fix
        • Create a ticket

          Function queue_task has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def queue_task(self,
          Severity: Major
          Found in emft/core/threadpool.py - About 1 hr to fix
          • Create a ticket

            Function __run has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __run(self, cmd, args, kwargs, callback, err_call_back, err_args, err_kwargs, task_id):
            Severity: Major
            Found in emft/core/threadpool.py - About 1 hr to fix
            • Create a ticket

              Function print_all has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def print_all(self, indent=''):
                      for k in sorted((k for k in self.__class__.__dict__)):
                          if k.startswith('__'):
                              continue
                          else:
              Severity: Minor
              Found in emft/core/providers/json_object.py - About 55 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 _parse_available_releases has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _parse_available_releases(self, event: EventData):
                      LOGGER.debug(f'from: {event.event.name}: parsing AV builds')
              
                      available_versions = set(self.av_builds.keys())
                      self.latest_version = self._spec.select_channel(available_versions, self._channel)
              Severity: Minor
              Found in emft/updater/updater.py - About 55 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 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, mission_dict, l10n, coa_color, country_index, group_category, group_index, unit_index):
              Severity: Major
              Found in emft/miz/mission.py - About 50 mins to fix
              • Create a ticket

                Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, mission_dict, l10n, coa_color, country_index, group_category, group_index, unit_index):
                Severity: Major
                Found in emft/miz/mission.py - About 50 mins to fix
                • Create a ticket

                  Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self, mission_dict, l10n, coa_color, country_index, group_category, group_index, unit_index):
                  Severity: Major
                  Found in emft/miz/mission.py - About 50 mins to fix
                  • Create a ticket

                    Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self, mission_dict, l10n, coa_color, country_index, group_category, group_index, unit_index):
                    Severity: Major
                    Found in emft/miz/mission.py - About 50 mins to fix
                    • Create a ticket
                      Severity
                      Category
                      Status
                      Source
                      Language