Showing 1,896 of 2,859 total issues

Avoid deeply nested control flow statements.
Open

            if end_token.type in Type.FLAG_DESCRIPTION_TYPES:
              end_string = htmlutil.StripTags(end_token.string).rstrip()

Severity: Major
Found in tools/closure_linter/closure_linter/ecmalintrules.py - About 45 mins to fix

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

    def WriteActions(target_name, actions, extra_sources, extra_deps,
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/cmake.py - About 45 mins to fix

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

      def WriteRules(target_name, rules, extra_sources, extra_deps,
      Severity: Minor
      Found in tools/gyp/pylib/gyp/generator/cmake.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if not (comment and comment.lower().count('jsdoc inherited')):
                      self._HandleError(errors.MISSING_MEMBER_DOCUMENTATION,
                          "No docs found for member '%s'" % identifier,
                          token);
                elif jsdoc and (not state.InConstructor() or
        Severity: Major
        Found in tools/closure_linter/closure_linter/ecmalintrules.py - About 45 mins to fix

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

            def _GetOperatorType(self, token):
              """Returns the operator type of the given operator token.
          
              Args:
                token: The token to get arity for.
          Severity: Minor
          Found in tools/closure_linter/closure_linter/ecmametadatapass.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 _GetMatchingEndBraceAndContents has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def _GetMatchingEndBraceAndContents(start_brace):
            """Returns the matching end brace and contents between the two braces.
          
            If any FLAG_ENDING_TYPE token is encountered before a matching end brace, then
            that token is used as the matching ending token. Contents will have all
          Severity: Minor
          Found in tools/closure_linter/closure_linter/statetracker.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

          Avoid deeply nested control flow statements.
          Open

                              if(options.verbose>0):
                                  print "Removing %s because tree %s is empty." % (thePool, tree)
                              remove.add(thePool)
          Severity: Major
          Found in tools/icu/icutrim.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        while desc_str.endswith('>'):
                          start_tag_index = desc_str.rfind('<')
                          if start_tag_index < 0:
                            break              
                          desc_str = desc_str[:start_tag_index].rstrip()
            Severity: Major
            Found in tools/closure_linter/closure_linter/ecmalintrules.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          if (not jsdoc.HasFlag('private') and
                              not ('underscore' in jsdoc.suppressions)):
                            self._HandleError(errors.MISSING_PRIVATE,
                                'Member "%s" must have @private JsDoc.' %
                                identifier, token)
              Severity: Major
              Found in tools/closure_linter/closure_linter/ecmalintrules.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if required in error.fix_data:
                              fixed_tokens.append(token)
                              # Want to delete: goog.require + open paren + open single-quote +
                              # text + close single-quote + close paren + semi-colon = 7.
                              tokenutil.DeleteTokens(token, 7)
                Severity: Major
                Found in tools/closure_linter/closure_linter/error_fixer.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            for include_dir in include_dirs:
                              include_dir = include_dir.replace('$SHARED_INTERMEDIATE_DIR',
                                                                shared_intermediate_dir)
                              if not os.path.isabs(include_dir):
                                base_dir = os.path.dirname(target_name)
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/generator/eclipse.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if op == 'I':
                                  # Insertion.
                                  # Parsing doc comments is the same for all languages
                                  # but some languages care about parameters that don't have
                                  # doc comments and some languages don't care.
                    Severity: Major
                    Found in tools/closure_linter/closure_linter/ecmalintrules.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                if MatchesSuffixes(f, suffixes):
                                  lint_files.append(os.path.join(root, f))
                        return lint_files
                      Severity: Major
                      Found in tools/closure_linter/closure_linter/common/simplefileflags.py - About 45 mins to fix

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

                          def __init__(self, lower_bound=None, upper_bound=None):
                            self.lower_bound = lower_bound
                            self.upper_bound = upper_bound
                            sh = self.syntactic_help
                            if lower_bound is not None and upper_bound is not None:
                        Severity: Minor
                        Found in tools/closure_linter/gflags.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

                        Avoid deeply nested control flow statements.
                        Open

                                    if (token.line_number == stack[-1].token.line_number):
                                      self._Add(TokenInfo(token))
                                  elif token.metadata.context.type == Context.CASE_BLOCK:
                        Severity: Major
                        Found in tools/closure_linter/closure_linter/indentation.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if(options.verbose > 5):
                                                  print "<< %s added to delete" % toDelete
                                              remove.add(toDelete)
                          Severity: Major
                          Found in tools/icu/icutrim.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        if not is_immediately_called and (last_in_line or
                                            not token.next.type == Type.SEMICOLON):
                                          self._HandleError(errors.MISSING_SEMICOLON_AFTER_FUNCTION,
                                              'Missing semicolon after function assigned to a variable',
                                              token, Position.AtEnd(token.string))
                            Severity: Major
                            Found in tools/closure_linter/closure_linter/ecmalintrules.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                          if jsdoc.HasFlag('inheritDoc') and not jsdoc.HasFlag('constructor'):
                                            self._HandleError(errors.INVALID_INHERIT_DOC_PRIVATE,
                                                '%s should not inherit from a private member.' % identifier,
                                                jsdoc.GetFlag('inheritDoc').flag_token)
                                          if (not jsdoc.HasFlag('private') and
                              Severity: Major
                              Found in tools/closure_linter/closure_linter/ecmalintrules.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                            if not identifier or not identifier.type in Type.NON_CODE_TYPES:
                                              break
                                
                                
                                Severity: Major
                                Found in tools/closure_linter/closure_linter/statetracker.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                              if (return_flag.type is None or (
                                                  'undefined' not in return_flag.type and
                                                  'void' not in return_flag.type and
                                                  '*' not in return_flag.type)):
                                                self._HandleError(
                                  Severity: Major
                                  Found in tools/closure_linter/closure_linter/javascriptlintrules.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language