enclose-io/compiler

View on GitHub
lts/deps/v8/tools/clusterfuzz/v8_foozzie.py

Summary

Maintainability
F
4 days
Test Coverage

File v8_foozzie.py has 304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

Severity: Minor
Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py - About 3 hrs to fix

    Function main has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def main():
      options = parse_args()
    
      # Suppressions are architecture and configuration specific.
      suppress = v8_suppressions.get_suppression(
    Severity: Minor
    Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.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 print_difference has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def print_difference(
    Severity: Major
    Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py - About 1 hr to fix

      Avoid too many return statements within this function.
      Open

            return RETURN_FAIL
      Severity: Major
      Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return RETURN_FAIL
        Severity: Major
        Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return RETURN_PASS
          Severity: Major
          Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return RETURN_FAIL
            Severity: Major
            Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return RETURN_PASS
              Severity: Major
              Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py - About 30 mins to fix

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

                def parse_args():
                  parser = argparse.ArgumentParser()
                  parser.add_argument(
                    '--random-seed', type=int, required=True,
                    help='random seed passed to both runs')
                Severity: Minor
                Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.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

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                if __name__ == "__main__":
                  try:
                    result = main()
                  except SystemExit:
                    # Make sure clusterfuzz reports internal errors and wrong usage.
                Severity: Major
                Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py and 1 other location - About 1 day to fix
                current/deps/v8/tools/clusterfuzz/v8_foozzie.py on lines 406..426

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 141.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                def fail_bailout(output, ignore_by_output_fun):
                  """Print failure state and return if ignore_by_output_fun matches output."""
                  bug = (ignore_by_output_fun(output.stdout) or '').strip()
                  if bug:
                    print(FAILURE_HEADER_TEMPLATE % dict(
                Severity: Major
                Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py and 1 other location - About 3 hrs to fix
                current/deps/v8/tools/clusterfuzz/v8_foozzie.py on lines 270..277

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 65.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                def content_bailout(content, ignore_fun):
                  """Print failure state and return if ignore_fun matches content."""
                  bug = (ignore_fun(content) or '').strip()
                  if bug:
                    print(FAILURE_HEADER_TEMPLATE % dict(
                Severity: Major
                Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py and 1 other location - About 3 hrs to fix
                current/deps/v8/tools/clusterfuzz/v8_foozzie.py on lines 250..257

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 63.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                def get_meta_data(content):
                  """Extracts original-source-file paths from test case content."""
                  sources = []
                  for line in content.splitlines():
                    match = SOURCE_RE.match(line)
                Severity: Major
                Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py and 1 other location - About 2 hrs to fix
                current/deps/v8/tools/clusterfuzz/v8_foozzie.py on lines 240..247

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 61.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                  if difference:
                    # Only bail out due to suppressed output if there was a difference. If a
                    # suppression doesn't show up anymore in the statistics, we might want to
                    # remove it.
                    if fail_bailout(first_config_output, suppress.ignore_by_output1):
                Severity: Major
                Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py and 1 other location - About 1 hr to fix
                current/deps/v8/tools/clusterfuzz/v8_foozzie.py on lines 377..389

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 49.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                  with open(os.path.join(os.path.dirname(d8), 'v8_build_config.json')) as f:
                    arch = json.load(f)['v8_current_cpu']
                Severity: Major
                Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py and 1 other location - About 1 hr to fix
                current/deps/v8/tools/clusterfuzz/v8_foozzie.py on lines 151..152

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 44.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                  assert (os.path.exists(options.testcase) and
                          os.path.isfile(options.testcase)), (
                      'Test case %s doesn\'t exist' % options.testcase)
                Severity: Major
                Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py and 1 other location - About 1 hr to fix
                current/deps/v8/tools/clusterfuzz/v8_foozzie.py on lines 225..227

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 38.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                  if not os.path.isabs(options.first_d8):
                    options.first_d8 = os.path.join(BASE_PATH, options.first_d8)
                Severity: Minor
                Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py and 1 other location - About 50 mins to fix
                lts/deps/v8/tools/clusterfuzz/v8_foozzie.py on lines 209..210

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 36.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                  if not os.path.isabs(options.second_d8):
                    options.second_d8 = os.path.join(BASE_PATH, options.second_d8)
                Severity: Minor
                Found in lts/deps/v8/tools/clusterfuzz/v8_foozzie.py and 1 other location - About 50 mins to fix
                lts/deps/v8/tools/clusterfuzz/v8_foozzie.py on lines 207..208

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 36.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status