hackedteam/core-android-market

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

Summary

Maintainability
D
1 day
Test Coverage

File property.py has 312 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Status: ported, except for tests and --abbreviate-paths.
# Base revision: 64070
#
# Copyright 2001, 2002, 2003 Dave Abrahams 
# Copyright 2006 Rene Rivera 
Severity: Minor
Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.py - About 3 hrs to fix

    Function create_from_string has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def create_from_string(s, allow_condition=False,allow_missing_value=False):
    
        condition = []
        import types
        if not isinstance(s, types.StringType):
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.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 translate_dependencies has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def translate_dependencies(properties, project_id, location):
    
        result = []
        for p in properties:
    
    
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.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 expand_subfeatures_in_conditions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def expand_subfeatures_in_conditions (properties):
    
        result = []
        for p in properties:
    
    
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.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 refine has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def refine (properties, requirements):
        """ Refines 'properties' by overriding any non-free properties 
            for which a different value is specified in 'requirements'. 
            Conditional requirements are just added without modification.
            Returns the resulting list of properties.
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.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 path_order has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def path_order (x, y):
        """ Helper for as_path, below. Orders properties with the implicit ones
            first, and within the two sections in alphabetical order of feature
            name.
        """
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.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 remove has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def remove(attributes, properties):
        """Returns a property sets which include all the elements
        in 'properties' that do not have attributes listed in 'attributes'."""
        
        result = []
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.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 translate_paths has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def translate_paths (properties, path):
        """ Interpret all path properties in 'properties' as relative to 'path'
            The property values are assumed to be in system-specific form, and
            will be translated into normalized form.
            """
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.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 evaluate_conditionals_in_context has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def evaluate_conditionals_in_context (properties, context):
        """ Removes all conditional properties which conditions are not met
            For those with met conditions, removes the condition. Properies
            in conditions are looked up in 'context'
        """
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.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 change has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def change (properties, feature, value = None):
        """ Returns a modified version of properties with all values of the
            given feature replaced by the given value.
            If 'value' is None the feature will be removed.
        """
    Severity: Minor
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.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 0
    Severity: Major
    Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

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

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

            def find_replace(self, properties, value=None):
                matches = []
                match_ranks = []
                
                for i in range(0, len(self.__properties)):
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/build/v2/build/property.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

        There are no issues that match your filters.

        Category
        Status