l10n_cl_invoice/wizard/journal_config_wizard.py
Function create_journal_document
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
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]
- Read upRead up
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
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:
- Read upRead up
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
Open
def create_journal_document(self, cr, uid, letter_ids, document_type,
Function create_sequence
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_sequence(self, cr, uid, name, journal, context=None):
Function create_journals
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_journals(self, cr, uid, journal_ids, wz, context=None):