Showing 341 of 1,161 total issues
Function _BuildAutomaton_38
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_38 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_38
del _BuildAutomaton_38
import pyxb.utils.fac as fac
Function check_tax
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def check_tax(self, cr, uid, tax, context=None):
"""
This is used to check that every (purchase) tax code is linked to
only one (main) tax.
This allows to print a VAT register summary where
- 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_company_id
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def onchange_company_id(self, cr, uid, ids, company_id, context=None):
res = super(AccountConfigSettings, self).onchange_company_id(
cr, uid, ids, company_id, context=context)
if company_id:
company = self.pool.get('res.company').browse(
- 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_move
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def create_move(self, cr, uid, ids, context=None):
if context is None:
context = {}
# wf_service = netsvc.LocalService("workflow")
active_id = context and context.get('active_id', False) or False
- 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 wizard_riba_file_export.py
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2011-2012 Associazione OpenERP Italia
# (<http://www.odoo-italia.org>).
Function _BuildAutomaton_9
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_9 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_9
del _BuildAutomaton_9
import pyxb.utils.fac as fac
File export_sepa_cbi_estero.py
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
##############################################################################
#
# SEPA Direct Debit module for Odoo
# Copyright (C) 2013-2015 Akretion (http://www.akretion.com)
Function _BuildAutomaton_11
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_11 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_11
del _BuildAutomaton_11
import pyxb.utils.fac as fac
Function get_tax_by_tax_code
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def get_tax_by_tax_code(self):
"""
Get account.tax linked to current tax code.
If the account.tax has a parent, the parent account.tax is returned.
"""
- 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_opening_move
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def create_opening_move(self, cr, uid, operation, fyc, context):
"""
Create an opening move (based on the closing one)
"""
pool = self.pool
- 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 split_communication
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def split_communication(self):
self.ensure_one()
if self.dati_trasmissione == 'DTE':
if not self.check_fatture_emesse_partners():
fatture_emesse = self.mapped(
- 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_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
AccountVatPeriodEndStatement
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class AccountVatPeriodEndStatement(orm.Model):
def _compute_authority_vat_amount(
self, cr, uid, ids, field_name, arg, context
):
Consider simplifying this complex logical expression. Open
if not ct.notes:
nc = ct.national_code
elif (ct.notes == 'ORA' and
(not dtcostvar or not ct.var_date or
dtcostvar < ct.var_date)):
Function run
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def run(self, cr, uid, ids, context=None):
"""
Creates / removes FYC entries
"""
- 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 setDatiPagamento
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def setDatiPagamento(self, invoice, body):
if invoice.payment_term:
payment_line_ids = invoice.move_line_id_payment_get()
if not payment_line_ids:
return True
- 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 _BuildAutomaton_19
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_19 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_19
del _BuildAutomaton_19
import pyxb.utils.fac as fac
Function _BuildAutomaton_17
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_17 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_17
del _BuildAutomaton_17
import pyxb.utils.fac as fac
Function _compute_e_invoice_validation_error
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _compute_e_invoice_validation_error(self):
bills_to_check = self.filtered(
lambda inv:
inv.type in ['in_invoice', 'in_refund'] and
inv.state in ['draft', 'open', 'paid'] and
- 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 _addGlobalDiscount
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _addGlobalDiscount(self, invoice_id, DatiGeneraliDocumento):
discount = 0.0
if (
DatiGeneraliDocumento.ScontoMaggiorazione and
self.e_invoice_detail_level == '2'
- 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"