distributed-system-analysis/run-perf

View on GitHub

Showing 32 of 84 total issues

Function generate_report has a Cognitive Complexity of 65 (exceeds 6 allowed). Consider refactoring.
Open

def generate_report(path, results, with_charts=False, small_file=False):
    """
    Generate html report from results

    :param path: Path to the output html file
Severity: Minor
Found in runperf/html_report.py - About 1 day 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 _recalculate has a Cognitive Complexity of 18 (exceeds 6 allowed). Consider refactoring.
Open

    def _recalculate(self):
        """Recalculate this result status"""
        if not self.agg_weights:
            if not self.error:
                self._score = -100
Severity: Minor
Found in runperf/result.py - About 2 hrs 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_metadata has a Cognitive Complexity of 15 (exceeds 6 allowed). Consider refactoring.
Open

def create_metadata(output_dir, args):
    """
    Generate RUNPERF_METADATA in this directory
    """
    def mask_arguments(cmd, i):
Severity: Minor
Found in runperf/__init__.py - About 1 hr 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 iter_tabular_output has a Cognitive Complexity of 15 (exceeds 6 allowed). Consider refactoring.
Open

def iter_tabular_output(matrix, header=None):
    """
    Generator for a pretty, aligned string representation of a nxm matrix.

    This representation can be used to print any tabular data, such as
Severity: Minor
Found in runperf/utils/__init__.py - About 1 hr 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 record_result has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def record_result(self, test_name, src, dst, primary=False, grouped=False,
Severity: Major
Found in runperf/result.py - About 1 hr to fix

    Function identify has a Cognitive Complexity of 12 (exceeds 6 allowed). Consider refactoring.
    Open

        def identify(self, data):
            """
            Identify model based on data
    
            :param data: dict of {result: [value, value, value]}
    Severity: Minor
    Found in runperf/result.py - About 1 hr 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 identify has a Cognitive Complexity of 12 (exceeds 6 allowed). Consider refactoring.
    Open

        def identify(self, data):
            """
            Identify model based on data
    
            :param data: dict of {result: [value, value, value]}
    Severity: Minor
    Found in runperf/result.py - About 1 hr 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 has a Cognitive Complexity of 12 (exceeds 6 allowed). Consider refactoring.
    Open

    def process(path_glob, variant, out, average):
        """Process single variant"""
        safe_variant = variant.replace('-', '')
        out.write(CHART1 % (variant, variant, safe_variant, variant, safe_variant,
                            safe_variant))
    Severity: Minor
    Found in contrib/data_analysis/extract_data.py - About 1 hr 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 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, host, name, distro, base_image, smp, mem,
    Severity: Major
    Found in runperf/machine.py - About 1 hr to fix

      Function get_merged_name has a Cognitive Complexity of 11 (exceeds 6 allowed). Consider refactoring.
      Open

          def get_merged_name(self, merge):
              """
              Report full test name but replace parts specified in "merge" wiht '*'
              """
              if not merge:
      Severity: Minor
      Found in runperf/result.py - About 1 hr 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 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, log, tolerance, stddev_tolerance, models,
      Severity: Major
      Found in runperf/result.py - About 1 hr to fix

        Function write_file has a Cognitive Complexity of 10 (exceeds 6 allowed). Consider refactoring.
        Open

        def write_file(path, content, mode='w'):
            """
            Write content to path, create the necessary upper dirs
            """
            if not os.path.exists(path):
        Severity: Minor
        Found in runperf/utils/__init__.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 ssh_copy_id has a Cognitive Complexity of 10 (exceeds 6 allowed). Consider refactoring.
        Open

        def ssh_copy_id(log, addr, passwords, hop=None):
            """
            Use "ssh-copy-id" to copy ssh id, try passwords if asked for.
            """
            session = None
        Severity: Minor
        Found in runperf/utils/__init__.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 add_bad has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def add_bad(self, suffix, name, details, difference, weight, src=None):
        Severity: Major
        Found in runperf/result.py - About 50 mins to fix

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

              def __init__(self, parent_log, name, addr, distro, args, hop=None):
          Severity: Major
          Found in runperf/machine.py - About 50 mins to fix

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

                def __init__(self, log, mean_tolerance, stddev_tolerance, models,
            Severity: Major
            Found in runperf/result.py - About 50 mins to fix

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

                  def for_each_host_retry(self, attempts, hosts, method, args=tuple(),
              Severity: Minor
              Found in runperf/machine.py - About 45 mins to fix

                Function check_result has a Cognitive Complexity of 9 (exceeds 6 allowed). Consider refactoring.
                Open

                    def check_result(self, test_name, src, dst):
                        model = self.model.get(test_name)
                        if model is None:
                            return []
                        equation = model["equation"]
                Severity: Minor
                Found in runperf/result.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 _image_up_to_date has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def _image_up_to_date(self, session, pubkey, image, setup_script,
                Severity: Minor
                Found in runperf/profiles.py - About 45 mins to fix

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

                      def __init__(self, distro, arch, pub_key, base_path, session,
                  Severity: Minor
                  Found in runperf/utils/cloud_image_providers.py - About 45 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language