tools/gyp/pylib/gyp/generator/cmake.py

Summary

Maintainability
F
1 wk
Test Coverage

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

def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
                options, generator_flags, all_qualified_targets, output):

  # The make generator does this always.
  # TODO: It would be nice to be able to tell CMake all dependencies.
Severity: Minor
Found in tools/gyp/pylib/gyp/generator/cmake.py - About 2 days 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

File cmake.py has 837 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.

"""cmake output module
Severity: Major
Found in tools/gyp/pylib/gyp/generator/cmake.py - About 2 days to fix

    Function WriteRules has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def WriteRules(target_name, rules, extra_sources, extra_deps,
                   path_to_gyp, output):
      """Write CMake for the 'rules' in the target.
    
      Args:
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/cmake.py - About 3 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 WriteCopies has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output):
      """Write CMake for the 'copies' in the target.
    
      Args:
        target_name: the name of the CMake target being generated.
    Severity: Minor
    Found in tools/gyp/pylib/gyp/generator/cmake.py - About 3 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 WriteTarget has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
                    options, generator_flags, all_qualified_targets, output):
    
      # The make generator does this always.
      # TODO: It would be nice to be able to tell CMake all dependencies.
    Severity: Major
    Found in tools/gyp/pylib/gyp/generator/cmake.py - About 2 hrs to fix

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

      def GenerateOutput(target_list, target_dicts, data, params):
        user_config = params.get('generator_flags', {}).get('config', None)
        if user_config:
          GenerateOutputForConfig(target_list, target_dicts, data,
                                  params, user_config)
      Severity: Minor
      Found in tools/gyp/pylib/gyp/generator/cmake.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 WriteActions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def WriteActions(target_name, actions, extra_sources, extra_deps,
                       path_to_gyp, output):
        """Write CMake for the 'actions' in the target.
      
        Args:
      Severity: Minor
      Found in tools/gyp/pylib/gyp/generator/cmake.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 WriteCopies has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output):
        """Write CMake for the 'copies' in the target.
      
        Args:
          target_name: the name of the CMake target being generated.
      Severity: Minor
      Found in tools/gyp/pylib/gyp/generator/cmake.py - About 1 hr to fix

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

        def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
        Severity: Major
        Found in tools/gyp/pylib/gyp/generator/cmake.py - About 1 hr to fix

          Function GenerateOutputForConfig has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def GenerateOutputForConfig(target_list, target_dicts, data,
                                      params, config_to_use):
            options = params['options']
            generator_flags = params['generator_flags']
          
          
          Severity: Minor
          Found in tools/gyp/pylib/gyp/generator/cmake.py - About 1 hr to fix

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

            def WriteRules(target_name, rules, extra_sources, extra_deps,
            Severity: Minor
            Found in tools/gyp/pylib/gyp/generator/cmake.py - About 45 mins to fix

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

              def WriteActions(target_name, actions, extra_sources, extra_deps,
              Severity: Minor
              Found in tools/gyp/pylib/gyp/generator/cmake.py - About 45 mins to fix

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

                def SetTargetProperty(output, target_name, property_name, values, sep=''):
                Severity: Minor
                Found in tools/gyp/pylib/gyp/generator/cmake.py - About 35 mins to fix

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

                  def SetFilesProperty(output, source_names, property_name, values, sep):
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/generator/cmake.py - About 35 mins to fix

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

                    def SetFileProperty(output, source_name, property_name, values, sep):
                    Severity: Minor
                    Found in tools/gyp/pylib/gyp/generator/cmake.py - About 35 mins to fix

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

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

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

                        def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output):
                        Severity: Minor
                        Found in tools/gyp/pylib/gyp/generator/cmake.py - About 35 mins to fix

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

                          def SetFileProperty(output, source_name, property_name, values, sep):
                            """Given a set of source file, sets the given property on them."""
                            output.write('set_source_files_properties(')
                            output.write(source_name)
                            output.write(' PROPERTIES ')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 5 hrs to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 169..179

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

                          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

                          def SetTargetProperty(output, target_name, property_name, values, sep=''):
                            """Given a target, sets the given property."""
                            output.write('set_target_properties(')
                            output.write(target_name)
                            output.write(' PROPERTIES ')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 5 hrs to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 140..150

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

                          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 cxx_sources and (cflags or cflags_cxx):
                                flags = []
                                flags.extend(cflags)
                                flags.extend(cflags_cxx)
                                SetFilesProperty(output, cxx_sources, 'COMPILE_FLAGS', flags, ' ')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 1 hr to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 903..907

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

                          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 c_sources and (cflags or cflags_c):
                                flags = []
                                flags.extend(cflags)
                                flags.extend(cflags_c)
                                SetFilesProperty(output, c_sources, 'COMPILE_FLAGS', flags, ' ')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 1 hr to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 909..913

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

                          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 qualified_target in gyp.common.AllTargets(target_list,
                                                                            target_dicts,
                                                                            os.path.normpath(build_file)):
                                all_qualified_targets.add(qualified_target)
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 1 hr to fix
                          tools/gyp/pylib/gyp/generator/ninja.py on lines 2027..2031

                          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

                                if shared_deps:
                                  for dep in gyp.common.uniquer(shared_deps):
                                    output.write('  ')
                                    output.write(dep)
                                    output.write('\n')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 1 hr to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 1002..1006

                          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

                                if external_libs:
                                  for lib in gyp.common.uniquer(external_libs):
                                    output.write('  ')
                                    output.write(lib)
                                    output.write('\n')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 1 hr to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 997..1001

                          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

                          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/cmake.py and 1 other location - About 1 hr to fix
                          tools/gyp/pylib/gyp/generator/ninja.py on lines 2111..2117

                          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

                          generator_default_variables = {
                            'EXECUTABLE_PREFIX': '',
                            'EXECUTABLE_SUFFIX': '',
                            'STATIC_LIB_PREFIX': 'lib',
                            'STATIC_LIB_SUFFIX': '.a',
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 1 hr to fix
                          tools/gyp/pylib/gyp/generator/msvs.py on lines 47..64

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

                          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 library_dir in library_dirs:
                                output.write(' ')
                                output.write(NormjoinPath(path_from_cmakelists_to_gyp, library_dir))
                                output.write('\n')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 1 hr to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 721..724

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

                          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 src in compilable_srcs:
                              output.write('  ')
                              output.write(NormjoinPath(path_from_cmakelists_to_gyp, src))
                              output.write('\n')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 1 hr to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 702..705

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

                          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

                              elif target_type in ('loadable_module', 'shared_library'):
                                shared_library_prefix = generator_default_variables['SHARED_LIB_PREFIX']
                                default_product_name = RemovePrefix(default_product_name,
                                                                    shared_library_prefix)
                                default_product_prefix = shared_library_prefix
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 1 hr to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 769..774

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

                          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 target_type == 'static_library':
                                static_library_prefix = generator_default_variables['STATIC_LIB_PREFIX']
                                default_product_name = RemovePrefix(default_product_name,
                                                                    static_library_prefix)
                                default_product_prefix = static_library_prefix
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 1 hr to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 776..781

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

                          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

                              dirs = set(dir for dir in (os.path.dirname(o) for o in outputs) if dir)
                          Severity: Minor
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 45 mins to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 368..368

                          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

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

                                dirs = set(dir for dir in (os.path.dirname(o) for o in outputs) if dir)
                          Severity: Minor
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 45 mins to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 275..275

                          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 2 locations. Consider refactoring.
                          Open

                                if 'message' in rule:
                                  output.write(rule['message'])
                                else:
                                  output.write(action_name)
                          Severity: Minor
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 45 mins to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 304..307

                          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 2 locations. Consider refactoring.
                          Open

                              if 'message' in action:
                                output.write(action['message'])
                              else:
                                output.write(action_target_name)
                          Severity: Minor
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 45 mins to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 411..414

                          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 5 locations. Consider refactoring.
                          Open

                            for source_name in source_names:
                              output.write('  ')
                              output.write(source_name)
                              output.write('\n')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 4 other locations - About 35 mins to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 285..289
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 384..387
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 389..392
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 430..433

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

                          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 5 locations. Consider refactoring.
                          Open

                              for out in var_outputs:
                                output.write('  ')
                                output.write(out)
                                output.write('\n')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 4 other locations - About 35 mins to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 156..159
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 285..289
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 384..387
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 389..392

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

                          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 5 locations. Consider refactoring.
                          Open

                                for directory in dirs:
                                  output.write('  COMMAND ${CMAKE_COMMAND} -E make_directory ')
                                  output.write(directory)
                                  output.write('\n')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 4 other locations - About 35 mins to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 156..159
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 285..289
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 384..387
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 430..433

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

                          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 5 locations. Consider refactoring.
                          Open

                              if len(dirs) > 0:
                                for directory in dirs:
                                  output.write('  COMMAND ${CMAKE_COMMAND} -E make_directory ')
                                  output.write(directory)
                                  output.write('\n')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 4 other locations - About 35 mins to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 156..159
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 384..387
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 389..392
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 430..433

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

                          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 5 locations. Consider refactoring.
                          Open

                                for out in these_outputs:
                                  output.write('  ')
                                  output.write(out)
                                  output.write('\n')
                          Severity: Major
                          Found in tools/gyp/pylib/gyp/generator/cmake.py and 4 other locations - About 35 mins to fix
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 156..159
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 285..289
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 389..392
                          tools/gyp/pylib/gyp/generator/cmake.py on lines 430..433

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

                          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