CollageLabs/candyshop

View on GitHub

Showing 13 of 15 total issues

File environment.py has 271 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
#
# Please refer to AUTHORS.rst for a complete list of Copyright holders.
# Copyright (C) 2016-2022, Candyshop Developers.

Severity: Minor
Found in candyshop/environment.py - About 2 hrs to fix

    Function find_files has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def find_files(path=None, pattern='*'):
        """
        Search for files.
    
        Locate all the files matching the supplied filename pattern in and below
    Severity: Minor
    Found in candyshop/utils.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 get_notmet_record_ids has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_notmet_record_ids(self):
            """
            Public method that informs about missing dependencies in XML files.
    
            :return: (generator) a generator that produces an iterable of
    Severity: Minor
    Found in candyshop/environment.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 get_record_ids_fromfile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_record_ids_fromfile(self, xmlfile, module=None):
            """
            Get ids from `record` tags of an Odoo XML file.
    
            :param xmlfile: (string) a path pointing to the XML file.
    Severity: Minor
    Found in candyshop/bundle.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 __get_modules has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def __get_modules(self):
            """
            Private method to find and instance all valid modules inside a bundle.
    
            .. versionadded:: 0.1.0
    Severity: Minor
    Found in candyshop/bundle.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 get_notmet_dependencies_report has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_notmet_dependencies_report(self):
            """
            Public method that reports missing dependencies in modules.
    
            :return: (string) a report of human readable output for the
    Severity: Minor
    Found in candyshop/environment.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 get_notmet_record_ids_report has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_notmet_record_ids_report(self):
            """
            Public method that reports missing dependencies in XML files.
    
            :return: (string) a report of human readable output for the
    Severity: Minor
    Found in candyshop/environment.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 __parse_oca_dependencies has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def __parse_oca_dependencies(self):
            """
            Private method to parse (if any) the oca_dependencies.txt file.
    
            .. versionadded:: 0.1.0
    Severity: Minor
    Found in candyshop/bundle.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 __clone_deptree has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def __clone_deptree(self):
            """
            Private method that clones the dependency tree of existing bundles.
    
            It reads the oca_dependencies attribute of each bundle, clones each one
    Severity: Minor
    Found in candyshop/environment.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 get_notmet_dependencies has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_notmet_dependencies(self):
            """
            Public method that informs about missing dependencies in modules.
    
            :return: (generator) a generator that produces an iterable of
    Severity: Minor
    Found in candyshop/environment.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 addbundles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def addbundles(self, locations=None, exclude_tests=True):
            """
            Public method that inserts bundles inside the environment.
    
            This method register a list of bundles and builds the dependency tree
    Severity: Minor
    Found in candyshop/environment.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 get_record_ids_module_references has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_record_ids_module_references(self):
            """
            Get all modules referenced in Odoo XML files.
    
            :return: a generator that returns an iterable of dictionaries
    Severity: Minor
    Found in candyshop/bundle.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 __initialize_odoo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def __initialize_odoo(self, url=DEFAULT_URL, branch=DEFAULT_BRANCH,
                              init_from=None):
            """
            Private method to clone an Odoo codebase inside the Environment path.
    
    
    Severity: Minor
    Found in candyshop/environment.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

    Severity
    Category
    Status
    Source
    Language