deps/v8/tools/push-to-trunk/common_includes.py

Summary

Maintainability
D
2 days
Test Coverage

File common_includes.py has 467 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
# Copyright 2013 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
Severity: Minor
Found in deps/v8/tools/push-to-trunk/common_includes.py - About 7 hrs to fix

    Step has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Step(GitRecipesMixin):
      def __init__(self, text, requires, number, config, state, options, handler):
        self._text = text
        self._requires = requires
        self._number = number
    Severity: Minor
    Found in deps/v8/tools/push-to-trunk/common_includes.py - About 3 hrs to fix

      Function MakeChangeLogBugReference has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      def MakeChangeLogBugReference(body):
        """Grep for "BUG=xxxx" lines in the commit message and convert them to
        "(issue xxxx)".
        """
        crbugs = []
      Severity: Minor
      Found in deps/v8/tools/push-to-trunk/common_includes.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 MakeChangeLogBody has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      def MakeChangeLogBody(commit_messages, auto_format=False):
        result = ""
        added_titles = set()
        for (title, body, author) in commit_messages:
          # TODO(machenbach): Better check for reverts. A revert should remove the
      Severity: Minor
      Found in deps/v8/tools/push-to-trunk/common_includes.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 Retry has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def Retry(self, cb, retry_on=None, wait_plan=None):
          """ Retry a function.
          Params:
            cb: The function to retry.
            retry_on: A callback that takes the result of the function and returns
      Severity: Minor
      Found in deps/v8/tools/push-to-trunk/common_includes.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 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def __init__(self, text, requires, number, config, state, options, handler):
      Severity: Major
      Found in deps/v8/tools/push-to-trunk/common_includes.py - About 50 mins to fix

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

        def MakeStep(step_class=Step, number=0, state=None, config=None,
        Severity: Minor
        Found in deps/v8/tools/push-to-trunk/common_includes.py - About 45 mins to fix

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

            def DeleteBranch(self, name):
              for line in self.GitBranch().splitlines():
                if re.match(r"\*?\s*%s$" % re.escape(name), line):
                  msg = "Branch %s exists, do you want to delete it?" % name
                  if self.Confirm(msg):
          Severity: Minor
          Found in deps/v8/tools/push-to-trunk/common_includes.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 RunSteps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            def RunSteps(self, step_classes, args=None):
              options = self.MakeOptions(args)
              if not options:
                return 1
          
          
          Severity: Minor
          Found in deps/v8/tools/push-to-trunk/common_includes.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 SetVersion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            def SetVersion(self, version_file, prefix):
              output = ""
              for line in FileToText(version_file).splitlines():
                if line.startswith("#define MAJOR_VERSION"):
                  line = re.sub("\d+$", self[prefix + "major"], line)
          Severity: Minor
          Found in deps/v8/tools/push-to-trunk/common_includes.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 MakeOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            def MakeOptions(self, args=None):
              parser = argparse.ArgumentParser(description=self._Description())
              parser.add_argument("-a", "--author", default="",
                                  help="The author email used for rietveld.")
              parser.add_argument("-g", "--googlers-mapping",
          Severity: Minor
          Found in deps/v8/tools/push-to-trunk/common_includes.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

          There are no issues that match your filters.

          Category
          Status