132nd-etcher/EMFT

View on GitHub

Showing 131 of 436 total issues

BaseMissionObject has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class BaseMissionObject(Logged):
    def __init__(self, mission_dict: dict, l10n: dict):
        super().__init__()

        if not isinstance(mission_dict, dict):
Severity: Minor
Found in emft/miz/mission.py - About 2 hrs to fix
  • Create a ticket

    File dcs_installs.py has 270 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # coding=utf-8
    import os
    import re
    
    from emft.config import Config
    Severity: Minor
    Found in emft/core/filesystem/dcs_installs.py - About 2 hrs to fix
    • Create a ticket

      Function contextMenuEvent has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          def contextMenuEvent(self, event):  # noqa: N802
              LOGGER.debug('in')
              if self._menu:
                  LOGGER.debug('menu')
                  if self.selectionModel().selection().indexes():
      Severity: Minor
      Found in emft/gui/base.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

      GHAnonymousSession has 22 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class GHAnonymousSession(requests.Session, metaclass=Singleton):
          def __init__(self):
      
              requests.Session.__init__(self)
      
      
      Severity: Minor
      Found in emft/core/providers/github/gh_anon.py - About 2 hrs to fix
      • Create a ticket

        File tab_config.py has 262 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # coding=utf-8
        
        import os
        import webbrowser
        
        
        Severity: Minor
        Found in emft/gui/tab_config.py - About 2 hrs to fix
        • Create a ticket

          Function _run_box has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              def _run_box(
                      text: str,
                      title: str,
                      ico: str,
                      is_question=False,
          Severity: Minor
          Found in emft/gui/main_ui_msgbox.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 reorder has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              def reorder(miz_file_path, target_dir, skip_options_file):
          
                  LOGGER.debug('re-ordering miz file: {}'.format(miz_file_path))
                  LOGGER.debug('destination folder: {}'.format(target_dir))
                  LOGGER.debug('{}option file'.format('skipping' if skip_options_file else 'including'))
          Severity: Minor
          Found in emft/miz/miz.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 number has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              def number(self):  # noqa C901
                  # noinspection PyMissingOrEmptyDocstring
                  def next_digit(err):
                      _n = self.ch
                      self.next_chr()
          Severity: Minor
          Found in emft/core/sltp.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 __run has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              def __run(self, cmd, args, kwargs, callback, err_call_back, err_args, err_kwargs, task_id):
                  # noinspection PyBroadException
                  try:
                      return_value = self.__run_with_optional_args(cmd, args, kwargs)
                      if callback is not None:
          Severity: Minor
          Found in emft/core/threadpool.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 discover_dcs_installations has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              def discover_dcs_installations(self):
                  LOGGER.debug('looking for local DCS installations')
          
                  for k in self.installs_props:
          
          
          Severity: Minor
          Found in emft/core/filesystem/dcs_installs.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 __parse_resp_error has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def __parse_resp_error(self):
          
                  LOGGER.error(self.req)
          
                  if self.resp.status_code >= 500:
          Severity: Minor
          Found in emft/core/providers/github/gh_anon.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 _do has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def _do(self, obj_name, func, args, kwargs):
                  """
                  Actually do the work
                  :param obj_name: str or None; name of the attribute object holding func; MainUi if None
                  :param func: method to call
          Severity: Minor
          Found in emft/gui/main_ui_threading.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 __read_props has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def __read_props(self):
          
                  def _loword(dword):
                      return dword & 0x0000ffff
          
          
          Severity: Minor
          Found in emft/core/path.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 start_ui has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def start_ui(show: bool = True):
              from PyQt5.QtWidgets import QApplication
              LOGGER.info('starting application')
              constant.QT_APP = QApplication([])
              main_ui = MainUi()
          Severity: Minor
          Found in emft/gui/main_ui.py - About 1 hr to fix
          • Create a ticket

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

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

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

                  def read(self):
              
                      self.wait_for_lock()
              
                      meta_updated = False
              Severity: Minor
              Found in emft/meta/meta_file.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 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def __init__(self, parent=None):
                      MainUiTabChild.__init__(self, parent)
              
                      self.roster = Roster()
              
              
              Severity: Minor
              Found in emft/gui/tab_roster.py - About 1 hr to fix
              • Create a ticket

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

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

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

                      def __init__(self, parent=None):
                          Widget.__init__(self, parent)
                  
                          self._remote_version = None
                  
                  
                  Severity: Minor
                  Found in emft/plugins/reorder/gui/widget_auto_reorder.py - About 1 hr to fix
                  • Create a ticket

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

                        def groups(self) -> typing.Generator['Group', None, None]:
                            for group_category in Mission.valid_group_categories:
                                if group_category in self._section_this_country.keys():
                                    for group_index in self._section_this_country[group_category]['group']:
                                        if group_index not in self.__groups[group_category]:
                    Severity: Minor
                    Found in emft/miz/mission.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

                    Severity
                    Category
                    Status
                    Source
                    Language