hackedteam/core-android-market

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

Summary

Maintainability
F
3 days
Test Coverage

File virtual_target.py has 684 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Status: ported.
# Base revision: 64488.
# 
#  Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and
#  distribute this software is granted provided this copyright notice appears in
Severity: Major
Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.py - About 1 day to fix

    Function register has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        def register (self, target):
            """ Registers a new virtual target. Checks if there's already registered target, with the same
                name, type, project and subvariant properties, and also with the same sources
                and equal action. If such target is found it is retured and 'target' is not registered.
                Otherwise, 'target' is registered and returned.
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.py - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function __adjust_name has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def __adjust_name(self, specified_name):
            """Given the target name specified in constructor, returns the
            name which should be really used, by looking at the <tag> properties.
            The tag properties come in two flavour:
              - <tag>value, 
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.py - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function all_referenced_targets has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def all_referenced_targets(self, result):
            """Returns all targets referenced by this subvariant,
            either directly or indirectly, and either as sources,
            or as dependency properties. Targets referred with
            dependency property are returned a properties, not targets."""

    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 register_actual_name has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def register_actual_name (self, actual_name, virtual_target):
            if self.actual_.has_key (actual_name):
                cs1 = self.actual_ [actual_name].creating_subvariant ()
                cs2 = virtual_target.creating_subvariant ()
                cmt1 = cs1.main_target ()

    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 traverse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def traverse (target, include_roots = False, include_sources = False):
        """ Traverses the dependency graph of 'target' and return all targets that will
            be created before this one is created. If root of some dependency graph is
            found during traversal, it's either included or not, dependencing of the
            value of 'include_roots'. In either case, sources of root are not traversed.
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.py - About 55 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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__ (self, main_target, prop_set, sources, build_properties, sources_usage_requirements, created_targets):
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if p1 == p2:
                                  result = t
              
      Severity: Major
      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.py - About 45 mins to fix

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

            def __init__ (self, name, type, project, action = None, path=None, exact=False):
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.py - About 45 mins to fix

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

              def __init__ (self, name, type, project, action = None, exact=False):
          Severity: Minor
          Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.py - About 35 mins to fix

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

            def add_prefix_and_suffix(specified_name, type, property_set):
                """Appends the suffix appropriate to 'type/property-set' combination
                to the specified name and returns the result."""
            
                property_set = b2.util.jam_to_value_maybe(property_set)
            Severity: Minor
            Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.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 grist has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def grist (self):
                    """Helper to 'actual_name', above. Compute unique prefix used to distinguish
                        this target from other targets with the same name which create different
                        file.
                    """
            Severity: Minor
            Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.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 path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def path (self):
                    """ Returns the directory for this target.
                    """
                    if not self.path_:
                        if self.action_:
            Severity: Minor
            Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.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

                                    p2 = ps2.base () + ps2.free () +\
                                        b2.util.set.difference(ps2.dependency(), ps2.incidental())
            src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.py on lines 134..135

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

            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

                                    p1 = ps1.base () + ps1.free () +\
                                        b2.util.set.difference(ps1.dependency(), ps1.incidental())
            src/libbson/boost/boost_1_53_0/tools/build/v2/build/virtual_target.py on lines 136..137

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

            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