hackedteam/core-android-market

View on GitHub
src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py

Summary

Maintainability
F
6 days
Test Coverage

File generators.py has 649 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Status: being ported by Vladimir Prus
# Base revision: 48649
# TODO: replace the logging with dout

# Copyright Vladimir Prus 2002.
Severity: Major
Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 1 day to fix

    Function __viable_source_types_real has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

    def __viable_source_types_real (target_type):
        """ Returns a list of source type which can possibly be converted
            to 'target_type' by some chain of generator invocation.
            
            More formally, takes all generators for 'target_type' and
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.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 __construct_really has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    def __construct_really (project, name, target_type, prop_set, sources):
        """ Attempts to construct target by finding viable generators, running them
            and selecting the dependency graph.
        """
        viable_generators = find_viable_generators (target_type, prop_set)
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.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 invalidate_extendable_viable_source_target_type_cache has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def invalidate_extendable_viable_source_target_type_cache():
    
        global __vstg_cached_generators
        generators_with_cached_source_types = __vstg_cached_generators
        __vstg_cached_generators = []
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.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 find_viable_generators has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def find_viable_generators (target_type, prop_set):
        key = target_type + '.' + str (prop_set)
    
        l = __viable_generators_cache.get (key, None)
        if not l:
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.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 find_viable_generators_aux has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def find_viable_generators_aux (target_type, prop_set):
        """ Returns generators which can be used to construct target of specified type
            with specified properties. Uses the following algorithm:
            - iterates over requested target_type and all it's bases (in the order returned bt
              type.all-bases.
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.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 convert_to_consumable_types has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def convert_to_consumable_types (self, project, name, prop_set, sources, only_one=False):
            """ Attempts to convert 'source' to the types that this generator can
                handle. The intention is to produce the set of targets can should be
                used when generator is run.
                only_one:   convert 'source' to only one of source types
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__ (self, id, composing, source_types, target_types_and_names, requirements = []):
            assert(not isinstance(source_types, str))
            assert(not isinstance(target_types_and_names, str))
            self.id_ = id
            self.composing_ = composing
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.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 update_cached_information_with_a_new_type has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def update_cached_information_with_a_new_type(type):
    
        base_type = b2.build.type.base(type)
    
        if base_type:
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.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 try_one_generator_really has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def try_one_generator_really (project, name, generator, target_type, properties, sources):
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 45 mins to fix

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

      def construct (project, name, target_type, prop_set, sources, top_level=False):
      Severity: Minor
      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 45 mins to fix

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

        def viable_source_types_for_generator_real (generator):
            """ Returns the list of source types, which, when passed to 'run'
                method of 'generator', has some change of being eventually used
                (probably after conversion by other generators)
            """
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Avoid deeply nested control flow statements.
        Open

                            for n in all:
                                if not n in result:
        
                                    # Here there is no point in adding target types to
                                    # the list of types to process in case they are or
        Severity: Major
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 45 mins to fix

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

              def clone_and_change_target_type(self, base, type):
                  """Creates another generator that is the same as $(self), except that
                  if 'base' is in target types of $(self), 'type' will in target types
                  of the new generator."""
                  target_types = []
          Severity: Minor
          Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.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 try_one_generator has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def try_one_generator (project, name, generator, target_type, properties, sources):
          Severity: Minor
          Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 45 mins to fix

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

                def __init__ (self, id, composing, source_types, target_types_and_names, requirements = []):
            Severity: Minor
            Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 35 mins to fix

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

              def construct_types (project, name, target_types, prop_set, sources):
              Severity: Minor
              Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 35 mins to fix

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

                def __construct_really (project, name, target_type, prop_set, sources):
                Severity: Minor
                Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 35 mins to fix

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

                      def convert_to_consumable_types (self, project, name, prop_set, sources, only_one=False):
                  Severity: Minor
                  Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 35 mins to fix

                    Function construct_result has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def construct_result (self, consumed, project, name, prop_set):
                            """ Constructs the dependency graph that will be returned by this 
                                generator.
                                    consumed:        Already prepared list of consumable targets
                                                     If generator requires several source files will contain 
                    Severity: Minor
                    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 35 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 run_really has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def run_really (self, project, name, prop_set, sources):
                    
                            # consumed: Targets that this generator will consume directly.
                            # bypassed: Targets that can't be consumed and will be returned as-is.
                            
                    Severity: Minor
                    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 35 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 try_one_generator_really has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def try_one_generator_really (project, name, generator, target_type, properties, sources):
                        """ Returns usage requirements + list of created targets.
                        """
                        targets = generator.run (project, name, properties, sources)
                    
                    
                    Severity: Minor
                    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 25 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                    def try_one_generator (project, name, generator, target_type, properties, sources):
                        """ Checks if generator invocation can be pruned, because it's guaranteed
                            to fail. If so, quickly returns empty list. Otherwise, calls
                            try_one_generator_really.
                        """
                    Severity: Minor
                    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 25 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                    def construct (project, name, target_type, prop_set, sources, top_level=False):
                        """ Attempts to create target of 'target-type' with 'properties'
                            from 'sources'. The 'sources' are treated as a collection of
                            *possible* ingridients -- i.e. it is not required to consume
                            them all. If 'multiple' is true, the rule is allowed to return
                    Severity: Minor
                    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py - About 25 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                        def consume_directly (self, source):
                            real_source_type = source.type ()
                    
                            # If there are no source types, we can consume anything
                            source_types = self.source_types()
                    Severity: Minor
                    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.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 viable_source_types (target_type):
                        """ Helper rule, caches the result of '__viable_source_types_real'.
                        """
                        if not __viable_source_types_cache.has_key(target_type):
                            __vst_cached_types.append(target_type)
                    src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py on lines 791..798

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

                    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 viable_source_types_for_generator (generator):
                        """ Caches the result of 'viable_source_types_for_generator'.
                        """
                        if not __viable_source_types_cache.has_key(generator):
                            __vstg_cached_generators.append(generator)
                    src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py on lines 757..763

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

                    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 g in generators_with_cached_source_types:
                            if __viable_source_types_cache.has_key(g):
                                if __viable_source_types_cache[g] == ["*"]:
                                    __vstg_cached_generators.append(g)
                                else:
                    src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py on lines 150..155

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

                    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 t in types_with_cached_sources_types:
                            if __viable_source_types_cache.has_key(t):
                                if __viable_source_types_cache[t] == ["*"]:
                                    __vst_cached_types.append(t)
                                else:
                    src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py on lines 140..145

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

                    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 g in __vstg_cached_generators:
                                if base_type in __viable_source_types_cache.get(g, []):
                                    __viable_source_types_cache[g].append(type)
                    src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py on lines 125..127

                    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 t in __vst_cached_types:
                                if base_type in __viable_source_types_cache.get(t, []):
                                    __viable_source_types_cache[t].append(type)
                    src/libbson/boost/boost_1_53_0/tools/build/v2/build/generators.py on lines 121..123

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

                    def debug():
                        global __debug
                        if __debug is None:
                            __debug = "--debug-generators" in bjam.variable("ARGV")        
                        return __debug
                    src/libbson/boost/boost_1_53_0/tools/build/v2/tools/gcc.py on lines 38..42
                    src/libbson/boost/boost_1_53_0/tools/build/v2/tools/msvc.py on lines 44..48
                    src/libbson/boost/boost_1_53_0/tools/build/v2/tools/rc.py on lines 32..36

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

                    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