Showing 341 of 1,161 total issues
File binding.py
has 5427 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# flake8: noqa
# PyXB bindings for NM:32e521a6da5b62d07147ea75b23acb0fb9726893
# Generated 2020-11-18 09:24:57.262943 by PyXB version 1.2.6 using Python 2.7.12.final.0
# By Lorenzo Battistini <lorenzo.battistini@agilebg.com>
File communication.py
has 2209 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
from openerp import api, fields, models, _
from openerp.exceptions import ValidationError
File _ds.py
has 1612 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# flake8: noqa
# -*- coding: utf-8 -*-
# PyXB bindings for NM:f1c343a882e7a65fb879f4ee813309f8231f28c8
# Generated 2020-11-18 09:24:57.262615 by PyXB version 1.2.6 using Python 2.7.12.final.0
File wizard_import_fatturapa.py
has 1302 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
import logging
from openerp import models, api, fields, _
from openerp.tools import float_is_zero
File wizard_export_fatturapa.py
has 849 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright 2014 Davide Corio
# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group
# Copyright 2018 Gianmarco Conte, Marco Calcagni - Dinamiche Aziendali srl
# Copyright 2019 Alex Comba - Agile Business Group
Function action_move_create
has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring. Open
def action_move_create(self, cr, uid, ids, context=None):
res = super(account_invoice,self).action_move_create(cr, uid, ids, context=context)
move_obj = self.pool.get('account.move')
move_line_obj = self.pool.get('account.move.line')
period_obj = self.pool.get('account.period')
- 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_31
has 335 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_31 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_31
del _BuildAutomaton_31
import pyxb.utils.fac as fac
File account.py
has 718 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>).
File test_import_fatturapa_xml.py
has 705 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
from openerp.exceptions import Warning as UserError
from .fatturapa_common import FatturapaCommon
Function parse_pec_response
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
def parse_pec_response(self, message_dict):
message_dict['model'] = self._name
message_dict['res_id'] = 0
regex = re.compile(RESPONSE_MAIL_REGEX)
- 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_closing_move
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
def create_closing_move(self, cr, uid, operation, fyc, context):
"""
Create a closing move (L&P, NL&P or Closing move).
"""
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 _check_errors_dtr
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
def _check_errors_dtr(self):
self.ensure_one()
comunicazione = self
errors = []
# ----- Conta il limite di partner e fatture
- 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 fetch_mail
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
def fetch_mail(self):
for server in self:
if not server.is_fatturapa_pec:
super(Fetchmail, server).fetch_mail()
else:
- 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 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
Function _check_errors_dte
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def _check_errors_dte(self):
self.ensure_one()
comunicazione = self
errors = []
# ----- Conta il limite di partner e fatture
- 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 56 (exceeds 5 allowed). Consider refactoring. Open
def create_move(self, cr, uid, ids, context=None):
move_obj = self.pool.get('account.move')
term_pool = self.pool.get('account.payment.term')
line_obj = self.pool.get('account.move.line')
period_obj = self.pool.get('account.period')
- 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_14
has 214 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _BuildAutomaton_14 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_14
del _BuildAutomaton_14
import pyxb.utils.fac as fac
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 create_ddt
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def create_ddt(self):
values = {
'partner_id': False,
'parcels': 0,
'carriage_condition_id': 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"