hackedteam/core-android-market

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

Summary

Maintainability
D
2 days
Test Coverage

File builtin.py has 422 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Status: minor updates by Steven Watanabe to make gcc work
#
#  Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and
#  distribute this software is granted provided this copyright notice appears in
#  all copies. This software is provided "as is" without express or implied
Severity: Minor
Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.py - About 6 hrs to fix

    Function register_globals has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def register_globals ():
        """ Registers all features and variants declared by this module.
        """
    
        # This feature is used to determine which OS we're on.
    Severity: Major
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.py - About 2 hrs to fix

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

      def default_host_os():
          host_os = os_name()
          if host_os not in (x.upper() for x in __os_names):
              if host_os == 'NT': host_os = 'windows'
              elif host_os == 'AS400': host_os = 'unix'
      Severity: Minor
      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.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 generated_targets has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def generated_targets (self, sources, prop_set, project, name):
      
              # sources to pass to inherited rule
              sources2 = []
              # sources which are libraries
      Severity: Minor
      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.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 run has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def run (self, project, name, prop_set, sources):
      
              sources.extend(prop_set.get('<library>'))
              
              # Add <library-path> properties for all searched libraries
      Severity: Minor
      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.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 lib has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def lib(names, sources=[], requirements=[], default_build=[], usage_requirements=[]):
          """The implementation of the 'lib' rule. Beyond standard syntax that rule allows
          simplified: 'lib a b c ;'."""
      
          if len(names) > 1:
      Severity: Minor
      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.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, name, project, shared, real_name, search, action):
      Severity: Minor
      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.py - About 45 mins to fix

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

            def run(self, project, name, prop_set, sources):
        
                # The lib generator is composing, and can be only invoked with
                # explicit name. This check is present in generator.run (and so in
                # builtin.LinkingGenerator), but duplicate it here to avoid doing
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, id, composing = True, source_types = [], target_types_and_names = ['LIB'], requirements = []):
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.py - About 35 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/tools/builtin.py - About 35 mins to fix

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

            def lib(names, sources=[], requirements=[], default_build=[], usage_requirements=[]):
            Severity: Minor
            Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.py - About 35 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/tools/builtin.py - About 35 mins to fix

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

                def register_c_compiler (id, source_types, target_types, requirements, optional_properties = []):
                Severity: Minor
                Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.py - About 35 mins to fix

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

                      def __init__ (self, id = 'SearchedLibGenerator', composing = False, source_types = [], target_types_and_names = ['SEARCHED_LIB'], requirements = []):
                  Severity: Minor
                  Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.py - About 35 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/tools/builtin.py - About 35 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/tools/builtin.py - About 35 mins to fix

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

                        def variant (name, parents_or_properties, explicit_properties = []):
                            """ Declares a new variant.
                                First determines explicit properties for this variant, by
                                refining parents' explicit properties with the passed explicit
                                properties. The result is remembered and will be used if
                        Severity: Minor
                        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.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 extra_usage_requirements has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def extra_usage_requirements (self, created_targets, prop_set):
                                
                                result = property_set.empty ()
                                extra = []
                                                
                        Severity: Minor
                        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/tools/builtin.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

                        There are no issues that match your filters.

                        Category
                        Status