Showing 2,859 of 2,859 total issues

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

                            Avoid deeply nested control flow statements.
                            Open

                                        if not last_in_line and token.next.type == Type.SEMICOLON:
                                          self._HandleError(errors.ILLEGAL_SEMICOLON_AFTER_FUNCTION,
                                              'Illegal semicolon after function declaration',
                                              token.next, Position.All(token.next.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('override'):
                                            self._HandleError(errors.INVALID_OVERRIDE_PRIVATE,
                                                '%s should not override a private member.' % identifier,
                                                jsdoc.GetFlag('override').flag_token)
                                          # Can have a private class which inherits documentation from a
                              Severity: Major
                              Found in tools/closure_linter/closure_linter/ecmalintrules.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                          for name, value in sorted(tool_settings.iteritems()):
                                            formatted_value = _GetValueFormattedForMSBuild(tool_name, name,
                                                                                           value)
                                            tool.append([name, formatted_value])
                                          group.append(tool)
                                Severity: Major
                                Found in tools/gyp/pylib/gyp/generator/msvs.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                            if len(concrete_output_dirs) > 0:
                                              makefile.write('\t@mkdir -p "%s"\n' %
                                                             '" "'.join(concrete_output_dirs))
                                  
                                            # The rule message and action have already had the necessary variable
                                  Severity: Major
                                  Found in tools/gyp/pylib/gyp/generator/xcode.py - About 45 mins to fix

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

                                      def WriteActions(self, actions, extra_sources, prebuild,
                                                       extra_mac_bundle_resources):
                                        # Actions cd into the base directory.
                                        env = self.GetSortedXcodeEnv()
                                        if self.flavor == 'win':
                                    Severity: Minor
                                    Found in tools/gyp/pylib/gyp/generator/ninja.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 _AddConfigurationToMSVS has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name):
                                    Severity: Minor
                                    Found in tools/gyp/pylib/gyp/generator/msvs.py - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language