IRC-SPHERE/HyperStream

View on GitHub

Showing 171 of 2,627 total issues

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/asset_splitter/2017-03-17_v0.2.0.py - About 35 mins to fix

Function split has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def split(self, points):
        '''Splits the list of time intervals in the specified points

        The function assumes that the time intervals do not overlap and ignores
        points that are not inside of any interval.
Severity: Minor
Found in hyperstream/time_interval.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _execute(self, sources, alignment_stream, interval):
        s0 = sources[0].window(interval, force_calculation=True).items()
        s1 = sources[1].window(interval, force_calculation=True).items()

        if len(s0) == 0 or len(s1) == 0:
Severity: Minor
Found in examples/plugins/example/tools/aligned_correlation/2017-08-17_v0.0.1.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _execute(self, source, splitting_stream, interval, meta_data_id, output_plate_values):
        if splitting_stream is not None:
            raise NotImplementedError("Splitting stream not supported for this tool")

        for timestamp, value in source.window(interval, force_calculation=True):
Severity: Minor
Found in hyperstream/tools/splitter_of_dict/2016-12-01_v0.0.1.py - About 35 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, server_config, auto_connect=True):
        """Initialise the client

        :param server_config: The server configuration
        :param auto_connect: Whether to automatically connect
Severity: Minor
Found in hyperstream/client.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _execute(self, sources, alignment_stream, interval):
        for time, data in sources[0].window(interval, force_calculation=True):
            max_value = None
            argmax = None
            for key in data.keys():
Severity: Minor
Found in hyperstream/tools/dict_argmax/2016-12-15_v0.0.1.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _execute(self, source, splitting_stream, interval, meta_data_id, output_plate_values):
        if splitting_stream is not None:
            raise NotImplementedError("Splitting stream not supported for this tool")

        for timestamp, value in source.window(interval, force_calculation=True):
Severity: Minor
Found in hyperstream/tools/splitter_of_list/2016-12-07_v0.0.1.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _execute(self, source, splitting_stream, interval, meta_data_id, output_plate_values):
        if splitting_stream is not None:
            raise NotImplementedError("Splitting stream not supported for this tool")

        for timestamp, value in source.window(interval, force_calculation=True):
Severity: Minor
Found in hyperstream/tools/splitter_of_dict/2017-07-20_v0.0.2.py - About 35 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_node has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def create_node(self, stream_name, channel, plates):
        """
        Create a node in the graph. Note: assumes that the streams already exist

        :param stream_name: The name of the stream
Severity: Minor
Found in hyperstream/workflow/workflow.py - About 35 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 file_filter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def file_filter(self, sorted_file_names):
        for file_long_name in sorted_file_names:
            if not file_long_name.startswith('__') and file_long_name[-3:] == '.py':
                try:
                    tool_info = FileDateTimeVersion(file_long_name)
Severity: Minor
Found in hyperstream/channels/file_channel.py - About 35 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, plate_id, meta_data_id, values, parent_plate=None):
        """
        Initialise the plate
        :param plate_id: Plate ID
        :param meta_data_id: Meta data ID - corresponds to the tag in the meta data definitions
Severity: Minor
Found in hyperstream/plate/plate.py - About 35 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, tool, source_node, splitting_node, sink_node, input_plate, output_plates):
        """
        Initialise this factor

        :param tool: The tool
Severity: Minor
Found in hyperstream/factor/factor.py - About 35 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 parameters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def parameters(self):
        """
        Get the tool parameters

        :return: The tool parameters along with additional information (whether they are functions or sets)
Severity: Minor
Found in hyperstream/tool/base_tool.py - About 35 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 too many return statements within this function.
Open

            return "{} not in source's parent plates".format(sink_plate.plate_id)
Severity: Major
Found in hyperstream/workflow/workflow.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return TimeIntervals(self.intervals)
Severity: Major
Found in hyperstream/time_interval.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return new
Severity: Major
Found in hyperstream/time_interval.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                            return tool_factory_function
Severity: Major
Found in hyperstream/hyperstream.py - About 30 mins to fix

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

    def write_to_stream(self, stream_id, data, sandbox=None):
        """
        Write to the stream

        :param stream_id: The stream identifier
Severity: Minor
Found in hyperstream/channels/assets_channel.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 execute_all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def execute_all(self):
        """
        Execute all workflows
        """
        for workflow_id in self.workflows:
Severity: Minor
Found in hyperstream/workflow/workflow_manager.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 delete_workflow has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def delete_workflow(self, workflow_id):
        """
        Delete a workflow from the database
        :param workflow_id:
        :return: None
Severity: Minor
Found in hyperstream/workflow/workflow_manager.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