tools/gyp/pylib/gyp/win_tool.py

Summary

Maintainability
A
3 hrs
Test Coverage

Function ExecLinkWithManifests has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname,
Severity: Major
Found in tools/gyp/pylib/gyp/win_tool.py - About 1 hr to fix

    Function ExecMidlWrapper has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl,
    Severity: Major
    Found in tools/gyp/pylib/gyp/win_tool.py - About 1 hr to fix

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

        def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname,
                                  mt, rc, intermediate_manifest, *manifests):
          """A wrapper for handling creating a manifest resource and then executing
          a link command."""
          # The 'normal' way to do manifests is to have link generate a manifest
      Severity: Minor
      Found in tools/gyp/pylib/gyp/win_tool.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 _UseSeparateMspdbsrv has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def _UseSeparateMspdbsrv(self, env, args):
          """Allows to use a unique instance of mspdbsrv.exe per linker instead of a
          shared one."""
          if len(args) < 1:
            raise Exception("Not enough arguments")
      Severity: Minor
      Found in tools/gyp/pylib/gyp/win_tool.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 ExecRecursiveMirror has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def ExecRecursiveMirror(self, source, dest):
          """Emulation of rm -rf out && cp -af in out."""
          if os.path.exists(dest):
            if os.path.isdir(dest):
              shutil.rmtree(dest)
      Severity: Minor
      Found in tools/gyp/pylib/gyp/win_tool.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

      There are no issues that match your filters.

      Category
      Status