odin-detector/odin-data

View on GitHub

Showing 69 of 110 total issues

Method run_socket has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private void run_socket()
    {
        while(!Thread.currentThread().isInterrupted())
        {
            if(!is_paused)
Severity: Minor
Found in tools/imagej/src/LiveViewSocket.java - 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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def render(pieces, style):
    """Render the given version pieces into the requested style."""
    if pieces["error"]:
        return {"version": "unknown",
                "full-revisionid": pieces.get("long"),
Severity: Minor
Found in python/src/odin_data/_version.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 process_updates has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def process_updates(self):
        """Handle additional background update loop tasks

        Store a copy of all parameters so they don't disappear

Severity: Minor
Found in python/src/odin_data/control/meta_listener_adapter.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 render_pep440_old has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def render_pep440_old(pieces):
    """TAG[.postDISTANCE[.dev0]] .

    The ".dev0" means dirty.

Severity: Minor
Found in python/src/odin_data/_version.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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, **kwargs):
        """
        Initialise the Adapter, using the provided configuration.
        Create the node classes for the subscriptions to multiple ZMQ sockets.
        Also create the publish socket to push frames onto.
Severity: Minor
Found in python/src/odin_data/control/live_view_proxy_adapter.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 get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def get(self, path, request):

        """Implementation of the HTTP GET verb for MetaListenerAdapter

        :param path: URI path of the GET request
Severity: Minor
Found in python/src/odin_data/control/meta_listener_adapter.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 put has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def put(self, path, request):

        """
        Implementation of the HTTP PUT verb for MetaListenerAdapter

Severity: Minor
Found in python/src/odin_data/control/meta_listener_adapter.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__(
Severity: Major
Found in python/src/odin_data/meta_writer/hdf5dataset.py - About 50 mins to fix

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

        def __init__(
    Severity: Major
    Found in python/src/odin_data/meta_writer/hdf5dataset.py - About 50 mins to fix

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

          def render_image(self, colormap=None, clip_min=None, clip_max=None):
              """
              Render an image from the image data, applying a colormap to the greyscale data.
      
              :param colormap: Desired image colormap. if None, uses the default colormap.
      Severity: Minor
      Found in python/src/odin_data/control/live_view_adapter.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 clear_writers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def clear_writers(self):
              unfinished_writers = {}
              for writer_name, writer in self._writers.items():
                  self._status_dict[writer_name] = writer.status()
                  if writer.finished:
      Severity: Minor
      Found in python/src/odin_data/meta_writer/meta_listener.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 uri_params_to_dictionary has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def uri_params_to_dictionary(request_command, parameters):
              # Check to see if the request contains more than one item
              if request_command is not None:
                  request_list = request_command.split('/')
                  logging.debug("URI request list: %s", request_list)
      Severity: Minor
      Found in python/src/odin_data/control/odin_data_adapter.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 run_command has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
      Severity: Minor
      Found in python/src/odin_data/_version.py - About 45 mins to fix

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

        def setup_logging(default_log_config=None,
                          default_level=logging.INFO,
                          env_key='LOG_CFG'):
            """Setup logging configuration
        
        
        Severity: Minor
        Found in python/src/odin_data/meta_writer/logconfig.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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, name, dtype, fillvalue, block_size, data_shape, block_timeout):
        Severity: Minor
        Found in python/src/odin_data/meta_writer/hdf5dataset.py - About 45 mins to fix

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

              def add_value(self, value, offset=None):
                  """Add a value at the given offset
          
                  If we are caching parameters, add the value to the cache, otherwise
                  extend the dataset and write it directly.
          Severity: Minor
          Found in python/src/odin_data/meta_writer/hdf5dataset.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

                                  for item in decoder_config:
                                      self._decoder_config[index][item] = decoder_config[item]
                      else:
          Severity: Major
          Found in python/src/odin_data/control/frame_receiver_adapter.py - About 45 mins to fix

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

                def send_configuration(self, content, target=None, valid_error=None, timeout=1000):
                    msg = IpcMessage("cmd", "configure")
            
                    if target is not None:
                        msg.set_param(target, content)
            Severity: Minor
            Found in python/src/odin_data/control/ipc_client.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

            Method addComponent has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private void addComponent(Component item, Panel panel, int x, int y, GridBagConstraints c)
            Severity: Minor
            Found in tools/imagej/src/Live_View.java - About 35 mins to fix

              Method addComponent has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  private void addComponent(Component comp, Component label, Panel panel, int x, GridBagConstraints constraints)
              Severity: Minor
              Found in tools/imagej/src/Live_View.java - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language