Function recompute_voucher_lines
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
def recompute_voucher_lines(self, cr, uid, ids, partner_id, journal_id,
price, currency_id, ttype, date, context=None):
"""
Compute original amount of WT of rate
"""
- 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 voucher_move_line_create
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
def voucher_move_line_create(
self, cr, uid, voucher_id, line_total, move_id, company_currency,
current_currency, context=None):
"""
Add WT line to registration and change amount on debit/credit line of
- 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
File voucher.py
has 488 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright © 2015 Alessandro Camilli (<http://www.openforce.it>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.osv import orm, fields
Function recompute_withholding_tax_voucher_line
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def recompute_withholding_tax_voucher_line(
self, cr, uid, voucher_line_id, context=None):
"""
Split amount voucher line second WT lines invoice
"""
- 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 _compute_balance
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _compute_balance(self, cr, uid, ids, name, args, context=None):
"""
Extends the compute of original amounts for exclude from total the WT
amount
"""
- 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 recompute_voucher_lines
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def recompute_voucher_lines(self, cr, uid, ids, partner_id, journal_id,
Function _align_wt_move
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _align_wt_move(self, cr, uid, ids, context=None):
"""
Align with wt move lines
"""
wt_statement_obj = self.pool['withholding.tax.statement']
- 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 onchange_reconcile
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def onchange_reconcile(self, cr, uid, ids, reconcile, amount,
Function voucher_move_line_create
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def voucher_move_line_create(
Function onchange_amount
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def onchange_amount(self, cr, uid, ids, amount, amount_unreconciled,
Function _amount_withholding_tax
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _amount_withholding_tax(self, cr, uid, ids, name, args, context=None):
Avoid deeply nested control flow statements. Open
if (
(line['amount'] + amount_overflow_residual) <=
(
line['amount_unreconciled'] -
line['amount_residual_withholding_tax']
Avoid deeply nested control flow statements. Open
for wt_invoice_line in inv.withholding_tax_line.\
filtered(lambda x: x == wt_tax):
i += 1
if i == rate_num:
wt_amount = wt_residual
Function compute_amount_withholdin_tax
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def compute_amount_withholdin_tax(
Avoid deeply nested control flow statements. Open
if debit:
p_debit = payment_line[1]
else:
p_credit = payment_line[1]
val_move_line = {
Function _compute_balance
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _compute_balance(self, cr, uid, ids, name, args, context=None):
Function write
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write(self, cr, uid, ids, vals, context=None):
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(self, cr, uid, vals, *args, **kwargs):
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(self, cr, uid, vals, *args, **kwargs):
Function write
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write(self, cr, uid, ids, vals, context=None):
Function action_move_line_create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def action_move_line_create(self, cr, uid, ids, context=None):
"""
Assign payment move to wt lines
"""
res = super(AccountVoucher, self).action_move_line_create(
- 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"