hackedteam/core-android-market

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

Summary

Maintainability
F
5 days
Test Coverage

File project.py has 695 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Status: ported.
# Base revision: 64488

# Copyright 2002, 2003 Dave Abrahams 
# Copyright 2002, 2005, 2006 Rene Rivera 
Severity: Major
Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.py - About 1 day to fix

    Function project has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def project(self, *args):
    
            jamfile_module = self.registry.current().project_module()
            attributes = self.registry.attributes(jamfile_module)
            
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.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 set has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        def set(self, attribute, specification, exact=False):
            """Set the named attribute from the specification given by the user.
            The value actually set may be different."""
    
            if exact:
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.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

    ProjectRegistry has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ProjectRegistry:
    
        def __init__(self, manager, global_build_dir):
            self.manager = manager
            self.global_build_dir = global_build_dir
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.py - About 3 hrs to fix

      Function initialize has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def initialize(self, module_name, location=None, basename=None):
              """Initialize the module for a project.
              
              module-name is the name of the project module.
              location is the location (directory) of the project to initialize.
      Severity: Minor
      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.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 load_jamfile has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          def load_jamfile(self, dir, jamfile_module):
              """Load a Jamfile at the given directory. Returns nothing.
              Will attempt to load the file as indicated by the JAMFILE patterns.
              Effect of calling this rule twice with the same 'dir' is underfined."""
            
      Severity: Minor
      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.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

      ProjectRules has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class ProjectRules:
          """Class keeping all rules that are made available to Jamfile."""
      
          def __init__(self, registry):
              self.registry = registry
      Severity: Minor
      Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.py - About 2 hrs to fix

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

            def find_jamfile (self, dir, parent_root=0, no_errors=0):
                """Find the Jamfile at the given location. This returns the
                exact names of all the Jamfiles in the given directory. The optional
                parent-root argument causes this to search not the given directory
                but the ones above it up to the directory given in it."""
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.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_project has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def init_project(self, project_module, python_standalone=False):
        
                if python_standalone:
                    m = sys.modules[project_module]
        
        
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.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 glob_internal has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def glob_internal(self, project, wildcards, excludes, rule_name):
                location = project.get("source-location")[0]
        
                result = []
                callable = b2.util.path.__dict__[rule_name]
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.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 import_ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def import_(self, name, names_to_import=None, local_names=None):
        
                name = name[0]
                py_name = name
                if py_name == "os":
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.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 load_module has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def load_module(self, name, extra_path=None):
                """Load a Python module that should be useable from Jamfiles.
        
                There are generally two types of modules Jamfiles might want to
                use:
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.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 glob_tree has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def glob_tree(self, wildcards, excludes=None):
                bad = 0
                for p in wildcards:
                    if os.path.dirname(p):
                        bad = 1
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.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 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def find(self, name, current_location):
                """Given 'name' which can be project-id or plain directory name,
                return project module corresponding to that id or directory.
                Returns nothing of project is not found."""
        
        
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/project.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

        There are no issues that match your filters.

        Category
        Status