tools/gyp/pylib/gyp/generator/ninja.py

Summary

Maintainability
F
2 wks
Test Coverage

File ninja.py has 1664 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import copy
Severity: Major
Found in tools/gyp/pylib/gyp/generator/ninja.py - About 4 days to fix

    Function GenerateOutputForConfig has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenerateOutputForConfig(target_list, target_dicts, data, params,
                                config_name):
      options = params['options']
      flavor = gyp.common.GetFlavor(params)
      generator_flags = params.get('generator_flags', {})
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 day 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 WriteLinkForArch has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
    Open

      def WriteLinkForArch(self, ninja_file, spec, config_name, config,
                           link_deps, arch=None):
        """Write out a link step. Fills out target.binary. """
        command = {
          'executable':      'link',
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 day 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 WriteRules has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
    Open

      def WriteRules(self, rules, extra_sources, prebuild,
                     mac_bundle_resources, extra_mac_bundle_resources):
        env = self.GetSortedXcodeEnv()
        all_outputs = []
        for rule in rules:
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/ninja.py - About 6 hrs 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 WriteSpec has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

      def WriteSpec(self, spec, config_name, generator_flags):
        """The main entry point for NinjaWriter: write the build rules for a spec.
    
        Returns a Target object, which represents the output paths for this spec.
        Returns None if there are no outputs (e.g. a settings-only 'none' type
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/ninja.py - About 5 hrs 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 WriteSourcesForArch has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

      def WriteSourcesForArch(self, ninja_file, config_name, config, sources,
                              predepends, precompiled_header, spec, arch=None):
        """Write build rules to compile all of |sources|."""
    
        extra_defines = []
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/ninja.py - About 5 hrs 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

    NinjaWriter has 34 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class NinjaWriter:
      def __init__(self, qualified_target, target_outputs, base_dir, build_dir,
                   output_file, toplevel_build, output_file_name, flavor,
                   toplevel_dir=None):
        """
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/ninja.py - About 4 hrs to fix

      Function WriteTarget has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

        def WriteTarget(self, spec, config_name, config, link_deps, compile_deps):
          extra_link_deps = any(self.target_outputs.get(dep).Linkable()
                                for dep in spec.get('dependencies', [])
                                if dep in self.target_outputs)
          if spec['type'] == 'none' or (not link_deps and not extra_link_deps):
      Severity: Minor
      Found in tools/gyp/pylib/gyp/generator/ninja.py - About 4 hrs 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 ComputeOutput has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

        def ComputeOutput(self, spec, arch=None):
          """Compute the path for the final output of the spec."""
          type = spec['type']
      
          if self.flavor == 'win':
      Severity: Minor
      Found in tools/gyp/pylib/gyp/generator/ninja.py - About 2 hrs 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

      Consider simplifying this complex logical expression.
      Open

            if ext in ('cc', 'cpp', 'cxx'):
              command = 'cxx'
              self.uses_cpp = True
            elif ext == 'c' or (ext == 'S' and self.flavor != 'win'):
              command = 'cc'
      Severity: Critical
      Found in tools/gyp/pylib/gyp/generator/ninja.py - About 2 hrs to fix

        Function GenerateOutput has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

        def GenerateOutput(target_list, target_dicts, data, params):
          # Update target_dicts for iOS device builds.
          target_dicts = gyp.xcode_emulation.CloneConfigurationForDeviceAndEmulator(
              target_dicts)
        
        
        Severity: Minor
        Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 hr 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 GenerateOutputForConfig has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def GenerateOutputForConfig(target_list, target_dicts, data, params,
                                    config_name):
          options = params['options']
          flavor = gyp.common.GetFlavor(params)
          generator_flags = params.get('generator_flags', {})
        Severity: Minor
        Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 hr to fix

          Function GetDefaultConcurrentLinks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          def GetDefaultConcurrentLinks():
            """Returns a best-guess for a number of concurrent links."""
            if sys.platform in ('win32', 'cygwin'):
              import ctypes
          
          
          Severity: Minor
          Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 hr 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 __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def __init__(self, qualified_target, target_outputs, base_dir, build_dir,
          Severity: Major
          Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 hr to fix

            Function WriteCopies has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

              def WriteCopies(self, copies, prebuild, mac_bundle_depends):
                outputs = []
                env = self.GetSortedXcodeEnv()
                for copy in copies:
                  for path in copy['files']:
            Severity: Minor
            Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 hr 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 ComputeOutputFileName has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

              def ComputeOutputFileName(self, spec, type=None):
                """Compute the filename of the final output for the current target."""
                if not type:
                  type = spec['type']
            
            
            Severity: Minor
            Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 hr 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 WriteNewNinjaRule has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

              def WriteNewNinjaRule(self, name, args, description, is_cygwin, env):
                """Write out a new ninja "rule" statement for a given command.
            
                Returns the name of the new rule, and a copy of |args| with variables
                expanded."""
            Severity: Minor
            Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 hr 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 WriteSpec has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def WriteSpec(self, spec, config_name, generator_flags):
                """The main entry point for NinjaWriter: write the build rules for a spec.
            
                Returns a Target object, which represents the output paths for this spec.
                Returns None if there are no outputs (e.g. a settings-only 'none' type
            Severity: Minor
            Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 hr to fix

              Function WriteSourcesForArch has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def WriteSourcesForArch(self, ninja_file, config_name, config, sources,
              Severity: Major
              Found in tools/gyp/pylib/gyp/generator/ninja.py - About 1 hr to fix

                Function WriteSources has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def WriteSources(self, ninja_file, config_name, config, sources, predepends,
                Severity: Major
                Found in tools/gyp/pylib/gyp/generator/ninja.py - About 50 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

                  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 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 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

                    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 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 WriteNewNinjaRule has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          def WriteNewNinjaRule(self, name, args, description, is_cygwin, env):
                        Severity: Minor
                        Found in tools/gyp/pylib/gyp/generator/ninja.py - About 35 mins to fix

                          Function WriteTarget has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            def WriteTarget(self, spec, config_name, config, link_deps, compile_deps):
                          Severity: Minor
                          Found in tools/gyp/pylib/gyp/generator/ninja.py - About 35 mins to fix

                            Function GenerateOutputForConfig has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def GenerateOutputForConfig(target_list, target_dicts, data, params,
                            Severity: Minor
                            Found in tools/gyp/pylib/gyp/generator/ninja.py - About 35 mins to fix

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

                                def WriteRules(self, rules, extra_sources, prebuild,
                              Severity: Minor
                              Found in tools/gyp/pylib/gyp/generator/ninja.py - About 35 mins to fix

                                Function AppendPostbuildVariable has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  def AppendPostbuildVariable(self, variables, spec, output, binary,
                                Severity: Minor
                                Found in tools/gyp/pylib/gyp/generator/ninja.py - About 35 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return self.GypPathToUniqueOutput(filename, qualified=False)
                                  Severity: Major
                                  Found in tools/gyp/pylib/gyp/generator/ninja.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        return 1
                                    Severity: Major
                                    Found in tools/gyp/pylib/gyp/generator/ninja.py - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                            return 1
                                      Severity: Major
                                      Found in tools/gyp/pylib/gyp/generator/ninja.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                              return os.path.join(libdir, filename)
                                        Severity: Major
                                        Found in tools/gyp/pylib/gyp/generator/ninja.py - About 30 mins to fix

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

                                            def GetPostbuildCommand(self, spec, output, output_binary, is_command_start):
                                              """Returns a shell command that runs all the postbuilds, and removes
                                              |output| if any of them fails. If |is_command_start| is False, then the
                                              returned string will start with ' && '."""
                                              if not self.xcode_settings or spec['type'] == 'none' or not output:
                                          Severity: Minor
                                          Found in tools/gyp/pylib/gyp/generator/ninja.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

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                            def __init__(self, type):
                                              # Gyp type ("static_library", etc.) of this target.
                                              self.type = type
                                              # File representing whether any input dependencies necessary for
                                              # dependent actions have completed.
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 2 hrs to fix
                                          tools/test.py on lines 718..726

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 57.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                            for build_file in params['build_files']:
                                              for target in gyp.common.AllTargets(target_list,
                                                                                  target_dicts,
                                                                                  os.path.normpath(build_file)):
                                                all_targets.add(target)
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 1 hr to fix
                                          tools/gyp/pylib/gyp/generator/cmake.py on lines 1074..1078

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 45.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                cflags_c = (os.environ.get('CPPFLAGS', '').split() +
                                                            os.environ.get('CFLAGS', '').split() + cflags_c)
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 1 hr to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 840..841

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 43.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                cflags_cc = (os.environ.get('CPPFLAGS', '').split() +
                                                             os.environ.get('CXXFLAGS', '').split() + cflags_cc)
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 1 hr to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 838..839

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 43.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                          def CallGenerateOutputForConfig(arglist):
                                            # Ignore the interrupt signal so that the parent process catches it and
                                            # kills all multiprocessing children.
                                            signal.signal(signal.SIGINT, signal.SIG_IGN)
                                          
                                          
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 1 hr to fix
                                          tools/gyp/pylib/gyp/generator/cmake.py on lines 1113..1119

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 42.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                              DEFAULT_PREFIX = {
                                                'loadable_module': default_variables['SHARED_LIB_PREFIX'],
                                                'shared_library': default_variables['SHARED_LIB_PREFIX'],
                                                'static_library': default_variables['STATIC_LIB_PREFIX'],
                                                'executable': default_variables['EXECUTABLE_PREFIX'],
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 1 hr to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1299..1303

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 39.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                              DEFAULT_EXTENSION = {
                                                  'loadable_module': default_variables['SHARED_LIB_SUFFIX'],
                                                  'shared_library': default_variables['SHARED_LIB_SUFFIX'],
                                                  'static_library': default_variables['STATIC_LIB_SUFFIX'],
                                                  'executable': default_variables['EXECUTABLE_SUFFIX'],
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 1 hr to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1289..1293

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 39.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                self.WriteVariableList(ninja_file, 'resource_includes',
                                                    [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 1 hr to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 859..860

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 39.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                              self.WriteVariableList(ninja_file, 'includes',
                                                  [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 1 hr to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 933..934

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 39.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                          generator_default_variables = {
                                            'EXECUTABLE_PREFIX': '',
                                            'EXECUTABLE_SUFFIX': '',
                                            'STATIC_LIB_PREFIX': 'lib',
                                            'STATIC_LIB_SUFFIX': '.a',
                                          Severity: Minor
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 45 mins to fix
                                          tools/gyp/pylib/gyp/generator/make.py on lines 33..47

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 35.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                          Open

                                              master_ninja.rule(
                                                'solink_module_notoc',
                                                description='SOLINK(module) $lib, POSTBUILDS',
                                                restat=True,
                                                command=solink_base % {'suffix': solink_module_suffix, 'type': '-bundle'},
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 3 other locations - About 40 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1953..1958
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1960..1964
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1968..1973

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 34.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                          Open

                                              master_ninja.rule(
                                                'solink_notoc',
                                                description='SOLINK $lib, POSTBUILDS',
                                                restat=True,
                                                command=solink_base % {'suffix':solink_suffix, 'type': '-shared'},
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 3 other locations - About 40 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1953..1958
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1968..1973
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1975..1979

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 34.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                          Open

                                              master_ninja.rule(
                                                'solink',
                                                description='SOLINK $lib, POSTBUILDS',
                                                restat=True,
                                                command=mtime_preserving_solink_base % {'suffix': solink_suffix,
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 3 other locations - About 40 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1960..1964
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1968..1973
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1975..1979

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 34.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                          Open

                                              master_ninja.rule(
                                                'solink_module',
                                                description='SOLINK(module) $lib, POSTBUILDS',
                                                restat=True,
                                                command=mtime_preserving_solink_base % {'suffix': solink_module_suffix,
                                          Severity: Major
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 3 other locations - About 40 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1953..1958
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1960..1964
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1975..1979

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 34.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                            master_ninja.rule('solink_module' + rule_name_suffix,
                                          Severity: Minor
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 40 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1616..1616

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 34.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                if self.toolset != 'target':
                                                  archdir = os.path.join('arch', '%s' % self.toolset)
                                          Severity: Minor
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 40 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1368..1369

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 34.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                            master_ninja.rule('solink' + rule_name_suffix,
                                          Severity: Minor
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 40 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1622..1622

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 34.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                if self.toolset != 'target':
                                                  libdir = os.path.join('lib', '%s' % self.toolset)
                                          Severity: Minor
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 40 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1361..1362

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 34.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                name = '%s_%s' % (action['action_name'],
                                                                  hashlib.md5(self.qualified_target).hexdigest())
                                          Severity: Minor
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 30 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 623..624

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 32.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                              master_ninja.rule(
                                                'solink_module',
                                                description='SOLINK(module) $lib',
                                                restat=True,
                                                command=(mtime_preserving_solink_base % {
                                          Severity: Minor
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 30 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1871..1875

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 32.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                name = '%s_%s' % (rule['rule_name'],
                                                                  hashlib.md5(self.qualified_target).hexdigest())
                                          Severity: Minor
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 30 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 590..591

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 32.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                              master_ninja.rule(
                                                'solink',
                                                description='SOLINK $lib',
                                                restat=True,
                                                command=(mtime_preserving_solink_base % {
                                          Severity: Minor
                                          Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 30 mins to fix
                                          tools/gyp/pylib/gyp/generator/ninja.py on lines 1879..1883

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 32.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          There are no issues that match your filters.

                                          Category
                                          Status