neovim/neovim

View on GitHub

Showing 66 of 66 total issues

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

        def RecordedError(filename, linenum, category, confidence, message):
Severity: Minor
Found in src/clint.py - About 35 mins to fix

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

    def ProcessFileData(filename, file_extension, lines, error,
    Severity: Minor
    Found in src/clint.py - About 35 mins to fix

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

      def FindEndOfExpressionInLine(line, startpos, depth, startchar, endchar):
      Severity: Minor
      Found in src/clint.py - About 35 mins to fix

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

        def highlight(attrs):
            fg, bg = [int(attrs['foreground']), int(attrs['background'])]
            rv = [SGR0]  # start with sgr0
            if fg != -1:
                rv.append(get_color_code(False, fg))
        Severity: Minor
        Found in contrib/gdb/nvim-gdb-pretty-printers.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 FindEndOfExpressionInLine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def FindEndOfExpressionInLine(line, startpos, depth, startchar, endchar):
            """Find the position just after the matching endchar.
        
            Args:
              line: a CleansedLines line.
        Severity: Minor
        Found in src/clint.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 SetFilters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def SetFilters(self, filters):
                """Sets the error-message filters.
        
                These filters are applied when deciding whether to emit a given
                error message.
        Severity: Minor
        Found in src/clint.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 _CollapseStrings has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _CollapseStrings(elided, keep_spaces=False):
                """Collapses strings and chars on a line to simple "" or '' blocks.
        
                We nix strings first so we're not fooled by text like '"http://"'
        
        
        Severity: Minor
        Found in src/clint.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

        Avoid too many return statements within this function.
        Open

            return True
        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

            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

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

                    if match and not Match(r"^''|-?[0-9]+|0x[0-9A-Fa-f]$", match.group(2)):
                        error(filename, linenum, 'runtime/memset', 4,
                              'Did you mean "memset(%s, 0, %s)"?'
                              % (match.group(1), match.group(2)))
                Severity: Minor
                Found in src/clint.py and 1 other location - About 30 mins to fix
                src/clint.py on lines 1979..1983

                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 32.

                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

                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

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

                                     (commentpos >= 2 and
                                      line[commentpos - 2] not in string.whitespace))):
                    Severity: Minor
                    Found in src/clint.py and 1 other location - About 30 mins to fix
                    src/clint.py on lines 1613..1614

                    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 32.

                    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

                    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

                        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

                            Avoid too many return statements within this function.
                            Open

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