hackedteam/core-android-market

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

Summary

Maintainability
F
5 days
Test Coverage

File targets.py has 818 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Status: ported.
# Base revision: 64488

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

    Function generate has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        def generate (self, ps):
            """ Determines final build properties, generates sources,
            and calls 'construct'. This method should not be
            overridden.
            """
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.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 find_really has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        def find_really(self, id):
            """ Find and return the target with the specified id, treated
                relative to self.
            """
            result = None        
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.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 evaluate_requirements has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        def evaluate_requirements(self, requirements, context, what):
            # Apply non-conditional requirements. 
            # It's possible that that further conditional requirement change 
            # a value set by non-conditional requirements. For example:
            #
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.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 __select_alternatives has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def __select_alternatives (self, property_set, debug):
            """ Returns the best viable alternative for this property_set
                See the documentation for selection rules.
                # TODO: shouldn't this be 'alternative' (singular)?
            """
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__ (self, name, project, type, sources, requirements, default_build, usage_requirements):
    Severity: Major
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py - About 50 mins to fix

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

          def create_typed_target (self, type, project, name, sources, requirements, default_build, usage_requirements):
      Severity: Major
      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py - About 50 mins to fix

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

        def create_metatarget(klass, name, sources, requirements=[], default_build=[], usage_requirements=[]):
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py - About 45 mins to fix

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

              def create_subvariant (self, root_targets, all_targets,
          Severity: Minor
          Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py - About 45 mins to fix

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

            def create_typed_metatarget(name, type, sources, requirements, default_build, usage_requirements):
            Severity: Minor
            Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py - About 45 mins to fix

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

                  def __init__ (self, manager, name, project_module, parent_project, requirements, default_build):
              Severity: Minor
              Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        for t in result:
                                            t.always()
                
                
                Severity: Major
                Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py - About 45 mins to fix

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

                      def __init__ (self, name, project, sources, requirements = None, default_build = None, usage_requirements = None):
                  Severity: Minor
                  Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py - About 45 mins to fix

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

                        def create_metatarget(name, sources, requirements = [], default_build = None, usage_requirements = []):
                    Severity: Minor
                    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py - About 35 mins to fix

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

                          def main_target_sources (self, sources, main_target_name, no_renaming=0):
                              """Return the list of sources to use, if main target rule is invoked
                              with 'sources'. If there are any objects in 'sources', they are treated
                              as main target instances, and the name of such targets are adjusted to
                              be '<name_of_this_target>__<name_of_source_target>'. Such renaming
                      Severity: Minor
                      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.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

                      Avoid too many return statements within this function.
                      Open

                              return best
                      Severity: Major
                      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py - About 30 mins to fix

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

                            def location (self):
                                # Returns the location of target. Needed by 'testing.jam'
                                if not self.file_location_:
                                    source_location = self.project_.get('source-location')
                                    
                        Severity: Minor
                        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def __init__ (self, name, project, sources, requirements = None, default_build = None, usage_requirements = None):
                                AbstractTarget.__init__ (self, name, project)
                            
                                for s in sources:
                                    if get_grist (s):
                        Severity: Minor
                        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.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 create_typed_metatarget(name, type, sources, requirements, default_build, usage_requirements):
                            
                            from b2.manager import get_manager
                            t = get_manager().targets()
                            
                        src/libbson/boost/boost_1_53_0/tools/build/v2/tools/cast.py on lines 52..66

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

                        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

                            @bjam_signature((["name"], ["sources", "*"], ["requirements", "*"],
                                             ["default_build", "*"], ["usage_requirements", "*"]))
                            def create_metatarget(name, sources, requirements = [], default_build = None, usage_requirements = []):
                        
                                from b2.manager import get_manager
                        src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py on lines 1371..1382

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

                        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 create_metatarget(klass, name, sources, requirements=[], default_build=[], usage_requirements=[]):
                            from b2.manager import get_manager
                            t = get_manager().targets()
                            
                            project = get_manager().projects().current()
                        src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py on lines 1386..1400

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                self.manager_.targets().log(
                                    "Building project '%s' with '%s'" % (self.name (), str(ps)))
                        Severity: Minor
                        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py and 1 other location - About 30 mins to fix
                        src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py on lines 1177..1179

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 32.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                            self.manager_.targets().log (
                                                "Usage requirements from '%s' are '%s'" %
                                                (self.name(), str(rproperties)))
                        Severity: Minor
                        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py and 1 other location - About 30 mins to fix
                        src/libbson/boost/boost_1_53_0/tools/build/v2/build/targets.py on lines 407..408

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 32.

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

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

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

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

                        Refactorings

                        Further Reading

                        There are no issues that match your filters.

                        Category
                        Status