neovim/neovim

View on GitHub

Showing 46 of 66 total issues

Avoid too many return statements within this function.
Open

                return
Severity: Major
Found in src/clint.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return
    Severity: Major
    Found in src/clint.py - About 30 mins to fix

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

      def FindNextMultiLineCommentStart(lines, lineix):
          """Find the beginning marker for a multiline comment."""
          while lineix < len(lines):
              if lines[lineix].strip().startswith('/*'):
                  # Only return this marker if the comment goes beyond this line
      Severity: Minor
      Found in src/clint.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 Error has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def Error(filename, linenum, category, confidence, message):
          """Logs the fact we've found a lint error.
      
          We log where the error was found, and also our confidence in the error,
          that is, how certain we are this is a legitimate style regression, and
      Severity: Minor
      Found in src/clint.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 CheckMemoryFunctions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def CheckMemoryFunctions(filename, clean_lines, linenum, error):
          """Checks for calls to invalid functions.
      
          Args:
            filename: The name of the current file.
      Severity: Minor
      Found in src/clint.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 RelativePath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def RelativePath(self):
              """FullName with <prefix>/src/nvim/ chopped off."""
              fullname = self.FullName()
      
              if os.path.exists(fullname):
      Severity: Minor
      Found in src/clint.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

      Severity
      Category
      Status
      Source
      Language