distributed-system-analysis/run-perf

View on GitHub

Showing 67 of 84 total issues

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

    def __init__(self, test, dst, tolerance, primary=False, params=None):
Severity: Minor
Found in runperf/result.py - About 35 mins to fix

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

        def __init__(self, host, workers, base_output_path,
    Severity: Minor
    Found in runperf/tests.py - About 35 mins to fix

      Function comma_separated_ranges_to_list has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring.
      Open

      def comma_separated_ranges_to_list(text):
          """
          Provides a list from comma separated ranges
      
          :param text: string of comma separated range
      Severity: Minor
      Found in runperf/utils/__init__.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 __init__ has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring.
      Open

          def __init__(self, mean_tolerance, stddev_tolerance, model=None):
              self.mean_tolerance = mean_tolerance
              self.stddev_tolerance = stddev_tolerance
              if model:
                  with open(model, encoding="utf-8") as fd_model:
      Severity: Minor
      Found in runperf/result.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 check_output has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring.
      Open

      def check_output(*args, **kwargs):
          """
          Execute command while masking stdin and providing better errors.
      
          :param args: args to be passed to subprocess.check_output
      Severity: Minor
      Found in runperf/utils/__init__.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

      Refactor this function to reduce its Cognitive Complexity from 35 to the 15 allowed.
      Open

      def iter_results(path, skip_incorrect=False):
      Severity: Critical
      Found in runperf/result.py by sonar-python

      Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

      See

      Refactor this function to reduce its Cognitive Complexity from 21 to the 15 allowed.
      Open

          def get_session(self, timeout=60, hop=None):
      Severity: Critical
      Found in runperf/machine.py by sonar-python

      Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

      See

      Method "record_result" has 10 parameters, which is greater than the 7 authorized.
      Open

          def record_result(self, test_name, src, dst, primary=False, grouped=False,
                            difference=None, tolerance=None, params=None,
                            last=False):
      Severity: Major
      Found in runperf/result.py by sonar-python

      A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

      Noncompliant Code Example

      With a maximum number of 4 parameters:

      def do_something(param1, param2, param3, param4, param5):
          ...
      

      Compliant Solution

      def do_something(param1, param2, param3, param4):
          ...
      

      FIXME found
      Open

                      # FIXME: Return this when https://github.com/distributed
      Severity: Minor
      Found in runperf/tests.py by fixme

      Take the required action to fix the issue indicated by this "FIXME" comment.
      Open

              # FIXME: Workaround missing perl paths
      Severity: Major
      Found in runperf/tests.py by sonar-python

      FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

      Sometimes the developer will not have the time or will simply forget to get back to that tag.

      This rule is meant to track those tags and to ensure that they do not go unnoticed.

      Noncompliant Code Example

      def divide(numerator, denominator):
        return numerator / denominator              # FIXME denominator value might be 0
      

      See

      FIXME found
      Open

          {#- FIXME: Bring unique back; probably using [] and append #}

      Refactor this function to reduce its Cognitive Complexity from 40 to the 15 allowed.
      Open

      def main():
      Severity: Critical
      Found in runperf/__init__.py by sonar-python

      Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

      See

      Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.
      Open

          def _recalculate(self):
      Severity: Critical
      Found in runperf/result.py by sonar-python

      Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

      See

      Refactor this function to reduce its Cognitive Complexity from 29 to the 15 allowed.
      Open

          def process_result_json(src_path, dst_base):
      Severity: Critical
      Found in runperf/__init__.py by sonar-python

      Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

      See

      Method "__init__" has 9 parameters, which is greater than the 7 authorized.
      Open

          def __init__(self, host, name, distro, base_image, smp, mem,
                       default_passwords=None, extra_params=None):
      Severity: Major
      Found in runperf/machine.py by sonar-python

      A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

      Noncompliant Code Example

      With a maximum number of 4 parameters:

      def do_something(param1, param2, param3, param4, param5):
          ...
      

      Compliant Solution

      def do_something(param1, param2, param3, param4):
          ...
      

      Merge this if statement with the enclosing one.
      Open

                  if os.path.exists(split_arg[1]):
      Severity: Major
      Found in runperf/__init__.py by sonar-python

      Merging collapsible if statements increases the code's readability.

      Noncompliant Code Example

      if condition1:
          if condition2:
              # ...
      

      Compliant Solution

      if condition1 and condition2:
          # ...
      

      Take the required action to fix the issue indicated by this "FIXME" comment.
      Open

              # FIXME: Ugly IPv4-libvirt-bridge-only hack to use main host
      Severity: Major
      Found in runperf/tests.py by sonar-python

      FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

      Sometimes the developer will not have the time or will simply forget to get back to that tag.

      This rule is meant to track those tags and to ensure that they do not go unnoticed.

      Noncompliant Code Example

      def divide(numerator, denominator):
        return numerator / denominator              # FIXME denominator value might be 0
      

      See

      FIXME found
      Open

              # FIXME: Ugly IPv4-libvirt-bridge-only hack to use main host
      Severity: Minor
      Found in runperf/tests.py by fixme

      FIXME found
      Open

          {# FIXME: Bring unique back; probably using [] and append -#}

      FIXME found
      Open

              # FIXME: Workaround missing perl paths
      Severity: Minor
      Found in runperf/tests.py by fixme
      Severity
      Category
      Status
      Source
      Language