Showing 1,896 of 2,859 total issues

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

            Avoid deeply nested control flow statements.
            Open

                        if hasattr(dependency_xct, 'test_runner'):
                          all_run_tests.append(dependency_xct.test_runner)
            
                      # Directly depend on all the runners as they depend on the target
                      # that builds them.
            Severity: Major
            Found in tools/gyp/pylib/gyp/generator/xcode.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                        for concrete_output_index in xrange(0, len(concrete_outputs)):
                          concrete_output = concrete_outputs[concrete_output_index]
                          if concrete_output_index == 0:
                            bol = ''
                          else:
              Severity: Major
              Found in tools/gyp/pylib/gyp/generator/xcode.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if not item.startswith('$(BUILT_PRODUCTS_DIR)/'):
                            pbxp.AddOrGetFileInRootGroup(item)
                
                
                Severity: Major
                Found in tools/gyp/pylib/gyp/generator/xcode.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if new_dep not in extra_link_deps:
                                extra_link_deps.add(new_dep)
                                link_deps.append(new_dep)
                  
                  
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/generator/ninja.py - About 45 mins to fix

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

                    def _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl,
                                                    list_excluded):
                      exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl)
                      for file_name, excluded_configs in exclusions.iteritems():
                        if (not list_excluded and
                    Severity: Minor
                    Found in tools/gyp/pylib/gyp/generator/msvs.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 Write has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def Write(self):
                        # Write the project file to a temporary location first.  Xcode watches for
                        # changes to the project file and presents a UI sheet offering to reload
                        # the project when it does change.  However, in some cases, especially when
                        # multiple projects are open or when Xcode is busy, things don't work so
                    Severity: Minor
                    Found in tools/gyp/pylib/gyp/generator/xcode.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 _BuildCommandLineForRuleRaw has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path,
                    Severity: Minor
                    Found in tools/gyp/pylib/gyp/generator/msvs.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                if precompiled_source != '':
                                  precompiled_source = _FixPath(precompiled_source)
                                  if not extensions_excluded_from_precompile:
                                    # If the precompiled header is generated by a C source, we must
                                    # not try to use it for C++ sources, and vice versa.
                      Severity: Major
                      Found in tools/gyp/pylib/gyp/generator/msvs.py - About 45 mins to fix

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

                          def ExpandRuleVariables(self, path, root, dirname, source, ext, name):
                        Severity: Minor
                        Found in tools/gyp/pylib/gyp/generator/ninja.py - About 45 mins to fix

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

                            def ComputeOutputParts(self, spec):
                              """Return the 'output basename' of a gyp spec, split into filename + ext.
                          
                              Android libraries must be named the same thing as their module name,
                              otherwise the linker can't find them, so product_name and so on must be
                          Severity: Minor
                          Found in tools/gyp/pylib/gyp/generator/android.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 precompiled_source == source:
                                      condition = _GetConfigurationCondition(config_name, configuration)
                                      detail.append(['PrecompiledHeader',
                                                     {'Condition': condition},
                                                     'Create'
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/msvs.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                      if concrete_output_index == len(concrete_outputs_by_rule_source) - 1:
                                        eol = ''
                                      else:
                                        eol = ' \\'
                                      makefile.write('    %s%s\n' % (concrete_output, eol))
                            Severity: Major
                            Found in tools/gyp/pylib/gyp/generator/xcode.py - About 45 mins to fix

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

                                def WriteActionsRulesCopies(self, spec, extra_sources, prebuild,
                                                            mac_bundle_depends):
                                  """Write out the Actions, Rules, and Copies steps.  Return a path
                                  representing the outputs of these steps."""
                                  outputs = []
                              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

                              Avoid deeply nested control flow statements.
                              Open

                                        if message:
                                          # Mark it with note: so Xcode picks it up in build output.
                                          makefile.write('\t@echo note: %s\n' % message)
                                        makefile.write('\t%s\n' % action)
                              Severity: Major
                              Found in tools/gyp/pylib/gyp/generator/xcode.py - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language