bmya/odoo-bmya-cl

View on GitHub
l10n_cl_invoice/wizard/journal_config_wizard.py

Summary

Maintainability
B
6 hrs
Test Coverage

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

    def create_journal_document(self, cr, uid, letter_ids, document_type,
                                journal_id, wz, context=None):

        print(document_type, letter_ids)
        if_zf = [] if wz.free_tax_zone else [901, 906, 907]
Severity: Minor
Found in l10n_cl_invoice/wizard/journal_config_wizard.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 create_journals has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def create_journals(self, cr, uid, journal_ids, wz, context=None):
        for journal in self.pool['account.journal'].browse(
                cr, uid, journal_ids, context=context):
            responsability = journal.company_id.responsability_id
            if not responsability.id:
Severity: Minor
Found in l10n_cl_invoice/wizard/journal_config_wizard.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 create_journal_document has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def create_journal_document(self, cr, uid, letter_ids, document_type,
Severity: Major
Found in l10n_cl_invoice/wizard/journal_config_wizard.py - About 50 mins to fix

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

        def create_sequence(self, cr, uid, name, journal, context=None):
    Severity: Minor
    Found in l10n_cl_invoice/wizard/journal_config_wizard.py - About 35 mins to fix

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

          def create_journals(self, cr, uid, journal_ids, wz, context=None):
      Severity: Minor
      Found in l10n_cl_invoice/wizard/journal_config_wizard.py - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status