File account.py
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012 Andrea Cometa.
# Email: info@andreacometa.it
Function action_move_create
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def action_move_create(self):
for invoice in self:
# ---- Add a line with payment cost for each due only for fist due
# ---- of the month
if invoice.type != 'out_invoice' or not invoice.payment_term \
- 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 unreconcile_riba_lines
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def unreconcile_riba_lines(self, riba_lines):
for riba_line in riba_lines:
# allowed transitions:
# paid_to_cancel and unsolved_to_cancel. See workflow
if riba_line.state in ['paid', 'unsolved']:
- 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 update_paid_riba_lines
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_paid_riba_lines(self):
# set paid only if not unsolved
if not self.env.context.get('unsolved_reconciliation'):
riba_lines = self.get_riba_lines()
for riba_line in riba_lines:
- 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 action_cancel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def action_cancel(self):
for invoice in self:
# we get move_lines with date_maturity and check if they are
# present in some riba_distinta_line
move_line_model = self.env['account.move.line']
- 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 fields_view_get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def fields_view_get(
Function _get_is_unsolved
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_is_unsolved(self, cr, uid, ids, name, arg, context=None):
Function _get_is_unsolved
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_is_unsolved(self, cr, uid, ids, name, arg, context=None):
res = {}
for invoice in self.browse(cr, uid, ids, context=context):
res[invoice.id] = False
reconciled_unsolved = 0
- 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 action_cancel_draft
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def action_cancel_draft(self):
# ---- Delete Due Cost Line of invoice when set Back to Draft
# ---- line was added on new validate
for invoice in self:
for line in invoice.invoice_line:
- 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 copy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def copy(self, default=None):
# Delete Due Cost Line of invoice when copying
res = super(AccountInvoice, self).copy(default)
if res:
for line in res.invoice_line:
- 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"