Showing 1,896 of 2,859 total issues

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

def _GenerateExternalRules(rules, output_dir, spec,
Severity: Minor
Found in tools/gyp/pylib/gyp/generator/msvs.py - About 45 mins to fix

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

    def _CreateProjectObjects(target_list, target_dicts, options, msvs_version):
      """Create a MSVSProject object for the targets found in target list.
    
      Arguments:
        target_list: the list of targets to generate project objects for.
    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

    Avoid deeply nested control flow statements.
    Open

                for run_test_target in all_run_tests:
                  run_all_target.AddDependency(run_test_target)
    
                # Insert the test runner after the related target.
                idx = self.project._properties['targets'].index(xcode_target)
    Severity: Major
    Found in tools/gyp/pylib/gyp/generator/xcode.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                for config_name, configuration in sorted(excluded_configurations):
                  condition = _GetConfigurationCondition(config_name, configuration)
                  detail.append(['ExcludedFromBuild',
                                 {'Condition': condition},
                                 'true'])
      Severity: Major
      Found in tools/gyp/pylib/gyp/generator/msvs.py - About 45 mins to fix

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

          def GypPathToNinja(self, path, env=None):
            """Translate a gyp path to a ninja path, optionally expanding environment
            variable references in |path| with |env|.
        
            See the above discourse on path conversions."""
        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 ComputeAndroidModule has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def ComputeAndroidModule(self, spec):
            """Return the Android module name used for a gyp spec.
        
            We use the complete qualified target name to avoid collisions between
            duplicate targets in different directories. We also add a suffix to
        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

                  for output in concrete_outputs_for_this_rule_source:
                    AddResourceToTarget(output, pbxp, xct)
        
                # Do we have a message to print when this rule runs?
                message = rule.get('message')
        Severity: Major
        Found in tools/gyp/pylib/gyp/generator/xcode.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    for output in concrete_outputs_for_this_rule_source:
                      AddSourceToTarget(output, type, pbxp, xct)
          
                  # If the file came from the mac_bundle_resources list or if the rule
                  # is marked to process outputs as bundle resource, do so.
          Severity: Major
          Found in tools/gyp/pylib/gyp/generator/xcode.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      for prerequisite_index in xrange(0, len(prerequisites)):
                        prerequisite = prerequisites[prerequisite_index]
                        if prerequisite_index == len(prerequisites) - 1:
                          eol = ''
                        else:
            Severity: Major
            Found in tools/gyp/pylib/gyp/generator/xcode.py - About 45 mins to fix

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

                def WriteLinkForArch(self, ninja_file, spec, config_name, config,
              Severity: Minor
              Found in tools/gyp/pylib/gyp/generator/ninja.py - About 45 mins to fix

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

                def SelectVisualStudioVersion(version='auto'):
                  """Select which version of Visual Studio projects to generate.
                
                  Arguments:
                    version: Hook to allow caller to force a particular version (vs auto).
                Severity: Minor
                Found in tools/gyp/pylib/gyp/MSVSVersion.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 ResolveTarget has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def ResolveTarget(build_file, target, toolset):
                  # This function resolves a target into a canonical form:
                  # - a fully defined build file, either absolute or relative to the current
                  # directory
                  # - a target name
                Severity: Minor
                Found in tools/gyp/pylib/gyp/common.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 int(dependency_target_dict.get('suppress_wildcard', False)):
                            continue
                          dependency_target_name = dependency_target_dict['target_name']
                Severity: Major
                Found in tools/gyp/pylib/gyp/input.py - About 45 mins to fix

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

                    def _GetAndMunge(self, field, path, default, prefix, append, map):
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/msvs_emulation.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                              if (dependency_toolset != '*' and
                                  dependency_toolset != dependency_target_toolset):
                                continue
                              dependency = gyp.common.QualifiedTarget(dependency_build_file,
                    Severity: Major
                    Found in tools/gyp/pylib/gyp/input.py - About 45 mins to fix

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

                        def _GetLdManifestFlags(self, config, name, gyp_to_build_path,
                      Severity: Minor
                      Found in tools/gyp/pylib/gyp/msvs_emulation.py - About 45 mins to fix

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

                          def Children(self):
                            """Returns a list of all of this object's owned (strong) children."""
                        
                            children = []
                            for property, attributes in self._schema.iteritems():
                        Severity: Minor
                        Found in tools/gyp/pylib/gyp/xcodeproj_file.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 AddCustomBuildRule has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          def AddCustomBuildRule(self, name, cmd, description,
                        Severity: Minor
                        Found in tools/gyp/pylib/gyp/MSVSToolFile.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    if exclude_item == the_list[index]:
                                      # This item matches the exclude_item, so set its action to 0
                                      # (exclude).
                                      list_actions[index] = 0
                          
                          
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/input.py - About 45 mins to fix

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

                            def _DoRemapping(element, map):
                              """If |element| then remap it through |map|. If |element| is iterable then
                              each item will be remapped. Any elements not found will be removed."""
                              if map is not None and element is not None:
                                if not callable(map):
                            Severity: Minor
                            Found in tools/gyp/pylib/gyp/msvs_emulation.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

                            Severity
                            Category
                            Status
                            Source
                            Language