132nd-etcher/EMFT

View on GitHub

Showing 131 of 436 total issues

Function join_all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def join_all(self, wait_for_pending_tasks=True, wait_for_running_tasks=True):
        """ Clear the task queue and terminate all pooled threads,
        optionally allowing the tasks and threads to finish.
        :param wait_for_pending_tasks: whether or not to process pending tasks before joining
        :param wait_for_running_tasks: whether or not to wait for running tasks before joining"""
Severity: Minor
Found in emft/core/threadpool.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

Function add_output_folder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def add_output_folder(name: str, path: Path or str) -> bool:
        if isinstance(path, str):
            path = Path(path)
        if name in OutputFolders():
            raise FileExistsError(f'an output folder is already registered with that name: {name}')
Severity: Minor
Found in emft/plugins/reorder/service/manage_output_folders.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

Function __get__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __get__(self, instance, owner=None):
        """
        """
        if instance is None:
            # Calling from Class object
Severity: Minor
Found in emft/meta/meta_property_guid_with_default.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

Function _display_new_version has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _display_new_version(self, latest_version: customversion.CustomVersion):
        """
        Shows the latest version found by the updater
        """
        if latest_version:
Severity: Minor
Found in emft/gui/tab_config.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

Function _filter_output has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _filter_output(input_):

        def _filter_line(line):
            # noinspection PyTypeChecker
            for filter_str in filter_output:
Severity: Minor
Found in emft/build.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

Function parse_vfs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_vfs(self):
        LOGGER.debug('reading "{}"'.format(self._path.abspath()))
        with open(self._path.abspath()) as f:
            lines = f.readlines()
        if lines:
Severity: Minor
Found in emft/core/filesystem/dcs_installs.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

Function farps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def farps(self) -> typing.Generator['Static', None, None]:
        for country in self.countries:
            assert isinstance(country, Country)
            for static in country.statics:
                assert isinstance(static, Static)
Severity: Minor
Found in emft/miz/mission.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

Function _parse_precip has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _parse_precip(self):
        if 'rain' in self.metar.present_weather():
            self.precip = 1
            self.force_cloud_density = 5
        if 'snow' in self.metar.present_weather():
Severity: Minor
Found in emft/miz/mission_weather.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

Function unit_pos_to_spot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def unit_pos_to_spot(unit_pos) -> ParkingSpot:
    min_ = 50
    res = None
    for airport in parkings:
        for spot in parkings[airport]:
Severity: Minor
Found in emft/miz/parking_spots.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

Function get_all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_all(self):  # pragma: no cover
        ret = set()
        for k in self.__class__.__dict__:
            if k.startswith('__'):
                continue
Severity: Minor
Found in emft/core/providers/json_object.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

Function _set_weather has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _set_weather(station_icao, in_file, out_file):
    LOGGER.debug(f'getting METAR for {station_icao}')
    result = {
        'icao': station_icao,
        'from': in_file,
Severity: Minor
Found in emft/cli/weather.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