CollageLabs/candyshop

View on GitHub
candyshop/bundle.py

Summary

Maintainability
A
2 hrs
Test Coverage

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 __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 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

There are no issues that match your filters.

Category
Status