Function _prepare_wt_values
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def _prepare_wt_values(self):
partner = False
wt_competence = {}
# First : Partner and WT competence
- 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 account.py
has 337 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).
Function action_move_create
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def action_move_create(self):
'''
Split amount withholding tax on account move lines
'''
dp_obj = self.env['decimal.precision']
- 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 get_wt_taxes_values
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_wt_taxes_values(self):
tax_grouped = {}
for invoice in self:
for line in invoice.invoice_line:
taxes = []
- 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 product_id_change
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def product_id_change(self, product, uom_id, qty=0, name='',
Function _amount_withholding_tax
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _amount_withholding_tax(self):
dp_obj = self.env['decimal.precision']
for invoice in self:
withholding_tax_amount = 0.0
for wt_line in invoice.withholding_tax_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 compute_amount_withholding_excluded
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compute_amount_withholding_excluded(self):
total_withholding_tax_excluded = 0.0
for invoice in self:
for line in invoice.invoice_line:
if line.withholding_tax_exclude:
- 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"