IRC-SPHERE/HyperStream

View on GitHub

Showing 171 of 2,627 total issues

Avoid deeply nested control flow statements.
Open

                        if p not in set(sink.plate_ids):
                            raise IncompatiblePlatesError("{} not in sink plates".format(p))
            plates = sink.plates
Severity: Major
Found in hyperstream/workflow/workflow.py - About 45 mins to fix

Function plot_multiple_stock has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def plot_multiple_stock(data, time=None, names=None, htype=None, title='title', ylabel=None):
Severity: Minor
Found in examples/utils.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if not is_sub_plate:
                            raise IncompatiblePlatesError("Sink plate is not a simplification of source plate")
                    else:
Severity: Major
Found in hyperstream/workflow/workflow.py - About 45 mins to fix

Function find_streams has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def find_streams(self, **kwargs):
        """
        Finds streams with the given meta data values. Useful for debugging purposes.

        :param kwargs: The meta data as keyword arguments
Severity: Minor
Found in hyperstream/channels/base_channel.py - About 45 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

Avoid deeply nested control flow statements.
Open

                        if self.header:
                            colnames = [name.replace('\n', '') for name in line.split(',')]
                            del colnames[self.datetime_column]
                        count += 1
Severity: Major
Found in plugins/data_importers/tools/csv_multi_reader/2017-07-21_v0.0.1.py - About 45 mins to fix

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

    def __init__(self, workflow_id, name, description, owner, online=False, monitor=False):
Severity: Minor
Found in hyperstream/workflow/workflow.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if next(p.is_root for p in sources[-1].plates):
                            if len(sink.plates) != 1:
                                raise IncompatiblePlatesError(
                                    "Multiple sink plates defined. "
                                    "Did you intend a simplification of 2 source plates to a sink plate?")
Severity: Major
Found in hyperstream/workflow/workflow.py - About 45 mins to fix

Function _execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _execute(self, sources, interval):

        found_source = False
        found_data_in_source = False
        for source in sources:
Severity: Minor
Found in hyperstream/tools/index_of/2016-11-23_v0.2.0.py - About 45 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_tool has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def get_tool(self, name, parameters, version=None):
        """
        Gets the tool object from the tool channel(s), and instantiates it using the tool parameters

        :param name: The name or stream id for the tool in the tool channel
Severity: Minor
Found in hyperstream/channels/channel_manager.py - About 45 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 create_plate has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def create_plate(self, plate_id, description, meta_data_id, values, complement, parent_plate):
Severity: Minor
Found in hyperstream/plate/plate_manager.py - About 45 mins to fix

Function __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self):
        self.global_plate_definitions = MetaDataTree()
        self.global_plate_definitions.create_node(identifier="root")

        to_be_added = dict((i, d) for i, d, in enumerate(self.global_meta_data))
Severity: Minor
Found in hyperstream/meta_data/meta_data_manager.py - About 45 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 execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def execute(self, debug=False):
        """
        Execute the engine - currently simple executes all workflows.
        """

Severity: Minor
Found in hyperstream/online_engine.py - About 45 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 calculated_intervals has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def calculated_intervals(self, value):
        """
        Set the calculated intervals
        This will be written to the stream_status collection if it's in the database channel

Severity: Minor
Found in hyperstream/stream/stream.py - About 45 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 execute has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def execute(self, source, splitting_stream, sinks, interval, meta_data_id, output_plate_values):
Severity: Minor
Found in hyperstream/tool/multi_output_tool.py - About 45 mins to fix

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

    def __init__(self, filename_template, datetime_parser=parse,
Severity: Minor
Found in plugins/data_importers/tools/csv_multi_reader/2017-07-21_v0.0.1.py - About 35 mins to fix

Function _execute has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _execute(self, source, splitting_stream, interval, meta_data_id, output_plate_values):
Severity: Minor
Found in hyperstream/tools/splitter_time_aware/2016-10-06_v0.0.1.py - About 35 mins to fix

Function _execute has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _execute(self, source, splitting_stream, interval, meta_data_id, output_plate_values):
Severity: Minor
Found in hyperstream/tools/splitter_from_stream/2016-12-13_v0.0.3.py - About 35 mins to fix

Function _execute has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _execute(self, source, splitting_stream, interval, meta_data_id, output_plate_values):
Severity: Minor
Found in hyperstream/tools/splitter_with_unlist/2016-10-24_v0.0.1.py - About 35 mins to fix

Function _execute has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _execute(self, source, splitting_stream, interval, meta_data_id, output_plate_values):
Severity: Minor
Found in hyperstream/tools/stream_broadcaster_from_stream/2016-11-10_v0.0.1.py - About 35 mins to fix

Function _execute has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _execute(self, source, splitting_stream, interval, meta_data_id, output_plate_values):
Severity: Minor
Found in hyperstream/tools/splitter_from_stream/2016-12-12_v0.0.2.py - About 35 mins to fix
Severity
Category
Status
Source
Language