tools/cpplint.py

Summary

Maintainability
F
2 wks
Test Coverage

File cpplint.py has 2110 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/python2.4
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Severity: Major
Found in tools/cpplint.py - About 5 days to fix

    Function CheckSpacing has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckSpacing(filename, clean_lines, linenum, error):
      """Checks for the correctness of various spacing issues in the code.
    
      Things we check for: spaces around operators, spaces after
      if/for/while/switch, no spaces around parens in function calls, two
    Severity: Minor
    Found in tools/cpplint.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 CheckLanguage has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
                      error):
      """Checks rules from the 'C++ language rules' section of cppguide.html.
    
      Some of these rules are hard to test (function overloading, using
    Severity: Minor
    Found in tools/cpplint.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 CheckIncludeLine has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
      """Check rules that are applicable to #include lines.
    
      Strings on #include lines are NOT removed from elided line, to make
      certain tasks easier. However, to prevent false positives, checks
    Severity: Minor
    Found in tools/cpplint.py - About 4 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 CheckForNonStandardConstructs has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckForNonStandardConstructs(filename, clean_lines, linenum,
                                      class_state, error):
      """Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
    
      Complain about several constructs which gcc-2 accepts, but which are
    Severity: Minor
    Found in tools/cpplint.py - About 4 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 CheckForIncludeWhatYouUse has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
                                  io=codecs):
      """Reports for missing stl includes.
    
      This function will output warnings to make sure you are including the headers
    Severity: Minor
    Found in tools/cpplint.py - About 4 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 CheckBraces has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckBraces(filename, clean_lines, linenum, error):
      """Looks for misplaced braces (e.g. at the end of line).
    
      Args:
        filename: The name of the current file.
    Severity: Minor
    Found in tools/cpplint.py - About 3 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 CheckForFunctionLengths has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckForFunctionLengths(filename, clean_lines, linenum,
                                function_state, error):
      """Reports for long function bodies.
    
      For an overview why this is done, see:
    Severity: Minor
    Found in tools/cpplint.py - About 3 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 CheckStyle has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckStyle(filename, clean_lines, linenum, file_extension, error):
      """Checks rules from the 'C++ style rules' section of cppguide.html.
    
      Most of these rules are hard to test (naming, comment style), but we
      do what we can.  In particular we check for 2-space indents, line lengths,
    Severity: Minor
    Found in tools/cpplint.py - About 3 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 CheckForHeaderGuard has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckForHeaderGuard(filename, lines, error):
      """Checks that the file contains a header guard.
    
      Logs an error if no #ifndef header guard is present.  For other
      headers, checks that the full pathname is used.
    Severity: Minor
    Found in tools/cpplint.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 ParseArguments has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def ParseArguments(args):
      """Parses the command line arguments.
    
      This may set the output format and verbosity level as side-effects.
    
    
    Severity: Minor
    Found in tools/cpplint.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 CheckNextIncludeOrder has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

      def CheckNextIncludeOrder(self, header_type):
        """Returns a non-empty error message if the next header is out of order.
    
        This function also updates the internal state to be ready to check
        the next include.
    Severity: Minor
    Found in tools/cpplint.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 _ShouldPrintError has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def _ShouldPrintError(category, confidence, linenum):
      """Returns true iff confidence >= verbose, category passes
      filter and is not NOLINT-suppressed."""
    
      # There are three ways we might decide not to print an error message:
    Severity: Minor
    Found in tools/cpplint.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 ParseNolintSuppressions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def ParseNolintSuppressions(filename, raw_line, linenum, error):
      """Updates the global list of error-suppressions.
    
      Parses any NOLINT comments on the current line, updating the global
      error_suppressions store.  Reports an error if the NOLINT comment
    Severity: Minor
    Found in tools/cpplint.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 CheckSpacingForFunctionCall has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckSpacingForFunctionCall(filename, line, linenum, error):
      """Checks for the correctness of various spacing around function calls.
    
      Args:
        filename: The name of the current file.
    Severity: Minor
    Found in tools/cpplint.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 RepositoryName has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      def RepositoryName(self):
        """FullName after removing the local path to the repository.
    
        If we have a real absolute path name here we can try to do something smart:
        detecting the root of the checkout and truncating /path/to/checkout from
    Severity: Minor
    Found in tools/cpplint.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 ProcessFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def ProcessFile(filename, vlevel):
      """Does google-lint on a single file.
    
      Args:
        filename: The name of the file to parse.
    Severity: Minor
    Found in tools/cpplint.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 ProcessLine has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def ProcessLine(filename, file_extension,
    Severity: Major
    Found in tools/cpplint.py - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

        if (cleansed_line.count(';') > 1 and
            # for loops are allowed two ;'s (and may run over two lines).
            cleansed_line.find('for') == -1 and
            (GetPreviousNonBlankLine(clean_lines, linenum)[0].find('for') == -1 or
             GetPreviousNonBlankLine(clean_lines, linenum)[0].find(';') != -1) and
      Severity: Major
      Found in tools/cpplint.py - About 1 hr to fix

        Function _ClassifyInclude has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def _ClassifyInclude(fileinfo, include, is_system):
          """Figures out what kind of header 'include' is.
        
          Args:
            fileinfo: The current file cpplint is running over. A FileInfo instance.
        Severity: Minor
        Found in tools/cpplint.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 CheckCStyleCast has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
        Severity: Major
        Found in tools/cpplint.py - About 50 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    if parameter_regexp:             # Ignore bad syntax
                      function += parameter_regexp.group(1)
                  else:
          Severity: Major
          Found in tools/cpplint.py - About 45 mins to fix

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

            def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
            Severity: Minor
            Found in tools/cpplint.py - About 45 mins to fix

              Function CheckComment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def CheckComment(comment, filename, linenum, error):
                """Checks for common mistakes in TODO comments.
              
                Args:
                  comment: The text of the comment from the line in question.
              Severity: Minor
              Found in tools/cpplint.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 GetLineWidth has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def GetLineWidth(line):
                """Determines the width of the line in column positions.
              
                Args:
                  line: A string, which may be a Unicode string.
              Severity: Minor
              Found in tools/cpplint.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

              Consider simplifying this complex logical expression.
              Open

                if line and line[-1].isspace():
                  error(filename, linenum, 'whitespace/end_of_line', 4,
                        'Line ends in whitespace.  Consider deleting these extra spaces.')
                # There are certain situations we allow one space, notably for labels
                elif ((initial_spaces == 1 or initial_spaces == 3) and
              Severity: Major
              Found in tools/cpplint.py - About 40 mins to fix

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

                def CheckForNonStandardConstructs(filename, clean_lines, linenum,
                Severity: Minor
                Found in tools/cpplint.py - About 35 mins to fix

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

                  def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
                  Severity: Minor
                  Found in tools/cpplint.py - About 35 mins to fix

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

                    def CheckForFunctionLengths(filename, clean_lines, linenum,
                    Severity: Minor
                    Found in tools/cpplint.py - About 35 mins to fix

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

                      def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
                      Severity: Minor
                      Found in tools/cpplint.py - About 35 mins to fix

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

                        def CheckStyle(filename, clean_lines, linenum, file_extension, error):
                        Severity: Minor
                        Found in tools/cpplint.py - About 35 mins to fix

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

                          def Error(filename, linenum, category, confidence, message):
                          Severity: Minor
                          Found in tools/cpplint.py - About 35 mins to fix

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

                            def CheckCheck(filename, clean_lines, linenum, error):
                              """Checks the use of CHECK and EXPECT macros.
                            
                              Args:
                                filename: The name of the current file.
                            Severity: Minor
                            Found in tools/cpplint.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 tools/cpplint.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 _OTHER_HEADER
                            Severity: Major
                            Found in tools/cpplint.py - About 30 mins to fix

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

                              def CheckPosixThreading(filename, clean_lines, linenum, error):
                                """Checks for calls to thread-unsafe functions.
                              
                                Much code has been originally written without consideration of
                                multi-threading. Also, engineers are relying on their old experience;
                              Severity: Minor
                              Found in tools/cpplint.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 FilesBelongToSameModule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def FilesBelongToSameModule(filename_cc, filename_h):
                                """Check if these two filenames belong to the same module.
                              
                                The concept of a 'module' here is a as follows:
                                foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the
                              Severity: Minor
                              Found in tools/cpplint.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 CloseExpression has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def CloseExpression(clean_lines, linenum, pos):
                                """If input points to ( or { or [, finds the position that closes it.
                              
                                If lines[linenum][pos] points to a '(' or '{' or '[', finds the the
                                linenum/pos that correspond to the closing of the expression.
                              Severity: Minor
                              Found in tools/cpplint.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 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 tools/cpplint.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 CheckCStyleCast has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
                                                  error):
                                """Checks for a C-style cast by looking for the pattern.
                              
                                This also handles sizeof(type) warnings, due to similarity of content.
                              Severity: Minor
                              Found in tools/cpplint.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

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

                                match_this = (r'\s*' + macro + r'\((\s*' +
                                              match_constant + r'\s*' + operator + r'[^<>].*|'
                                              r'.*[^<>]' + operator + r'\s*' + match_constant +
                              Severity: Major
                              Found in tools/cpplint.py and 1 other location - About 3 hrs to fix
                              tools/gyp/pylib/gyp/generator/make.py on lines 231..441

                              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

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

                              def Search(pattern, s):
                                """Searches the string for the pattern, caching the compiled regexp."""
                                if not pattern in _regexp_compile_cache:
                                  _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
                                return _regexp_compile_cache[pattern].search(s)
                              Severity: Major
                              Found in tools/cpplint.py and 1 other location - About 2 hrs to fix
                              tools/cpplint.py on lines 348..355

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

                              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 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: Major
                              Found in tools/cpplint.py and 1 other location - About 2 hrs to fix
                              tools/cpplint.py on lines 2451..2456

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

                              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

                              def Match(pattern, s):
                                """Matches the string with the pattern, caching the compiled regexp."""
                                # The regexp compilation caching is inlined in both Match and Search for
                                # performance reasons; factoring it out into a separate function turns out
                                # to be noticeably expensive.
                              Severity: Major
                              Found in tools/cpplint.py and 1 other location - About 2 hrs to fix
                              tools/cpplint.py on lines 358..362

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

                              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 match and not Match(r'\s*(<.*>)?(::[a-zA-Z0-9_]+)?\s*\(([^"]|$)',
                                                       match.group(3)):
                                  error(filename, linenum, 'runtime/string', 4,
                                        'For a static/global string constant, use a C style string instead: '
                                        '"%schar %s[]".' %
                              Severity: Major
                              Found in tools/cpplint.py and 1 other location - About 2 hrs to fix
                              tools/cpplint.py on lines 2537..2540

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

                              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 5 locations. Consider refactoring.
                              Open

                                  if (Search(r'\w\s+\(', fncall) and
                                      not Search(r'#\s*define|typedef', fncall)):
                                    error(filename, linenum, 'whitespace/parens', 4,
                                          'Extra space before ( in function call')
                              Severity: Major
                              Found in tools/cpplint.py and 4 other locations - About 40 mins to fix
                              tools/cpplint.py on lines 1763..1765
                              tools/cpplint.py on lines 1851..1853
                              tools/cpplint.py on lines 1861..1868
                              tools/cpplint.py on lines 1943..1945

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

                              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 5 locations. Consider refactoring.
                              Open

                                if Search(r'\w\s+\[', line) and not Search(r'delete\s+\[', line):
                                  error(filename, linenum, 'whitespace/braces', 5,
                                        'Extra space before [')
                              Severity: Major
                              Found in tools/cpplint.py and 4 other locations - About 40 mins to fix
                              tools/cpplint.py on lines 1506..1509
                              tools/cpplint.py on lines 1763..1765
                              tools/cpplint.py on lines 1861..1868
                              tools/cpplint.py on lines 1943..1945

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

                              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 3 locations. Consider refactoring.
                              Open

                                  if header_type == _LIKELY_MY_HEADER:
                                    if self._section <= self._MY_H_SECTION:
                                      self._section = self._MY_H_SECTION
                                    else:
                                      self._last_header = ''
                              Severity: Major
                              Found in tools/cpplint.py and 2 other locations - About 40 mins to fix
                              tools/cpplint.py on lines 462..467
                              tools/cpplint.py on lines 468..473

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

                              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 3 locations. Consider refactoring.
                              Open

                                  elif header_type == _POSSIBLE_MY_HEADER:
                                    if self._section <= self._MY_H_SECTION:
                                      self._section = self._MY_H_SECTION
                                    else:
                                      self._last_header = ''
                              Severity: Major
                              Found in tools/cpplint.py and 2 other locations - About 40 mins to fix
                              tools/cpplint.py on lines 456..461
                              tools/cpplint.py on lines 468..473

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

                              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 5 locations. Consider refactoring.
                              Open

                                elif Search(r'^\s*;\s*$', line):
                                  error(filename, linenum, 'whitespace/semicolon', 5,
                                        'Line contains only semicolon. If this should be an empty statement, '
                                        'use { } instead.')
                                elif (Search(r'\s+;\s*$', line) and
                              Severity: Major
                              Found in tools/cpplint.py and 4 other locations - About 40 mins to fix
                              tools/cpplint.py on lines 1506..1509
                              tools/cpplint.py on lines 1763..1765
                              tools/cpplint.py on lines 1851..1853
                              tools/cpplint.py on lines 1943..1945

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

                              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 5 locations. Consider refactoring.
                              Open

                                if Search(r'\belse [^\s{]', line) and not Search(r'\belse if\b', line):
                                  error(filename, linenum, 'whitespace/newline', 4,
                                        'Else clause should never be on same line as else (use 2 lines)')
                              Severity: Major
                              Found in tools/cpplint.py and 4 other locations - About 40 mins to fix
                              tools/cpplint.py on lines 1506..1509
                              tools/cpplint.py on lines 1763..1765
                              tools/cpplint.py on lines 1851..1853
                              tools/cpplint.py on lines 1861..1868

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

                              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 3 locations. Consider refactoring.
                              Open

                                  elif header_type == _OTHER_HEADER:
                                    if self._section <= self._OTHER_H_SECTION:
                                      self._section = self._OTHER_H_SECTION
                                    else:
                                      self._last_header = ''
                              Severity: Major
                              Found in tools/cpplint.py and 2 other locations - About 40 mins to fix
                              tools/cpplint.py on lines 456..461
                              tools/cpplint.py on lines 462..467

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

                              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 5 locations. Consider refactoring.
                              Open

                                if Search(r'[\w.]=[\w.]', line) and not Search(r'\b(if|while) ', line):
                                  error(filename, linenum, 'whitespace/operators', 4,
                                        'Missing spaces around =')
                              Severity: Major
                              Found in tools/cpplint.py and 4 other locations - About 40 mins to fix
                              tools/cpplint.py on lines 1506..1509
                              tools/cpplint.py on lines 1851..1853
                              tools/cpplint.py on lines 1861..1868
                              tools/cpplint.py on lines 1943..1945

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

                              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

                                  for pattern, template, header in _re_pattern_algorithm_header:
                                    if pattern.search(line):
                                      required[header] = (linenum, template)
                              Severity: Minor
                              Found in tools/cpplint.py and 1 other location - About 40 mins to fix
                              tools/cpplint.py on lines 2848..2850

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

                              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

                                  for pattern, template, header in _re_pattern_templates:
                                    if pattern.search(line):
                                      required[header] = (linenum, template)
                              Severity: Minor
                              Found in tools/cpplint.py and 1 other location - About 40 mins to fix
                              tools/cpplint.py on lines 2840..2842

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

                              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

                                        ((commentpos >= 1 and
                                          line[commentpos-1] not in string.whitespace) or
                              Severity: Minor
                              Found in tools/cpplint.py and 1 other location - About 30 mins to fix
                              tools/cpplint.py on lines 1732..1733

                              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

                              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 tools/cpplint.py and 1 other location - About 30 mins to fix
                              tools/cpplint.py on lines 1730..1731

                              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

                              There are no issues that match your filters.

                              Category
                              Status