Showing 341 of 1,161 total issues
Function compute_amounts
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def compute_amounts(self, cr, uid, ids, context=None):
if context is None:
context = {}
statement_generic_account_line_obj = self.pool[
'statement.generic.account.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 _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
Function setDatiDDT
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def setDatiDDT(self, invoice, body):
res = super(WizardExportFatturapa, self).setDatiDDT(
invoice, body)
if self.include_ddt_data == 'dati_ddt':
inv_lines_by_ddt = {}
- 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 _check_ftpa_partner_data
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def _check_ftpa_partner_data(self):
for partner in self:
if partner.electronic_invoice_subjected and partner.customer:
# These checks must be done for customers only, as only
# needed for XML generation
- 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
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def compute(self, cr, uid, invoice_id, context=None):
tax_grouped = super(account_invoice_tax, self).compute(cr, uid, invoice_id, context)
inv_obj = self.pool.get('account.invoice')
tax_obj = self.pool.get('account.tax')
tax_code_obj = self.pool.get('account.tax.code')
- 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_8
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_8 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_8
del _BuildAutomaton_8
import pyxb.utils.fac as fac
Function create_sepa
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def create_sepa(self):
"""Creates the SEPA Credit Transfer file. That's the important code!"""
sepa_export = self[0]
pain_flavor = self.payment_order_ids[0].mode.type.code
convert_to_ascii = \
- 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 set_roundings
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def set_roundings(self, FatturaBody, invoice):
rounding = 0.0
if FatturaBody.DatiBeniServizi.DatiRiepilogo:
for summary in FatturaBody.DatiBeniServizi.DatiRiepilogo:
rounding += float(summary.Arrotondamento or 0.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
File wizard_run.py
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP - Import operations model 347 engine
# Copyright (C) 2009 Asr Oss. All Rights Reserved
Function generate_self_invoice
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def generate_self_invoice(self):
rc_type = self.fiscal_position.rc_type_id
if not rc_type.payment_journal_id.default_credit_account_id:
raise UserError(
_('There is no default credit account defined \n'
- 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_list
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def create_list(self):
def create_rdl(countme, bank_id, rd_id, date_maturity, partner_id,
acceptance_account_id):
rdl = {
'sequence': countme,
- 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 test_fatturapa_wt.py
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
from openerp.addons.l10n_it_fatturapa_out.tests.fatturapa_common import (
FatturaPACommon)
class TestInvoiceWT(FatturaPACommon):
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).
File riba.py
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012 Andrea Cometa.
# Email: info@andreacometa.it
File account.py
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
from openerp import fields, models, api, _
from openerp.exceptions import ValidationError, Warning as UserError
from openerp.tools import float_compare
Function action_move_create
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def action_move_create(self, cr, uid, ids, context=None):
if not context:
context = {}
- 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_invoice.py
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright 2017 Davide Corio
# Copyright 2017 Alex Comba - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
File withholding_tax.py
has 312 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 _BuildAutomaton_18
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_18 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_18
del _BuildAutomaton_18
import pyxb.utils.fac as fac
Function _BuildAutomaton_12
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_12 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_12
del _BuildAutomaton_12
import pyxb.utils.fac as fac