Showing 30 of 71 total issues
File invoice.py
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
Function l10n_cl_pos_credit_card_voucher
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
openerp.l10n_cl_pos_credit_card_voucher = function(instance){
var module = instance.point_of_sale;
var QWeb = instance.web.qweb;
var _t = instance.web._t;
- 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 do_dte_send_invoice
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def do_dte_send_invoice(self):
cant_doc_batch = 0
for inv in self.with_context(lang='es_CL'):
# control de DTE
if inv.sii_document_class_id.dte == 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
Function l10n_cl_pos_credit_card_voucher
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
openerp.l10n_cl_pos_credit_card_voucher = function(instance){
var module = instance.point_of_sale;
var QWeb = instance.web.qweb;
var _t = instance.web._t;
File invoice.py
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
from openerp import osv, models, fields, api, _
from openerp.osv import fields as old_fields
from openerp.exceptions import except_orm, Warning
from openerp.addons import decimal_precision as dp
Function create_journal_document
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def create_journal_document(self, cr, uid, letter_ids, document_type,
journal_id, wz, context=None):
print(document_type, letter_ids)
if_zf = [] if wz.free_tax_zone else [901, 906, 907]
- 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_journals
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def create_journals(self, cr, uid, journal_ids, wz, context=None):
for journal in self.pool['account.journal'].browse(
cr, uid, journal_ids, context=context):
responsability = journal.company_id.responsability_id
if not responsability.id:
- 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_available_journal_document_class
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _get_available_journal_document_class(self):
invoice_type = self.type
document_class_ids = []
document_class_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"
Further reading
Function _use_level
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _use_level(self):
for r in self:
if r.status not in ['draft','cancelled']:
try:
r.use_level = 100 * (
- 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 action_number
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def action_number(self):
obj_sequence = self.env['ir.sequence']
# We write document_number field with next invoice number by
# document type
- 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_activities
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _check_activities(self):
# self.ensure_one()
# si entre los giros del diario hay alguno que está excento
# el boolean es True
try:
- 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 _printed_prices
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _printed_prices(self, cr, uid, ids, name, args, context=None):
res = {}
tax_obj = self.pool['account.tax']
cur_obj = self.pool.get('res.currency')
- 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_template_envio
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_template_envio(self, RutEmisor, RutReceptor, FchResol, NroResol,
Function create_journal_document
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_journal_document(self, cr, uid, letter_ids, document_type,
Function _printed_prices
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _printed_prices(self, cr, uid, ids, name, args, context=None):
Function get_valid_document_letters
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_valid_document_letters(
Function _get_parent_sii_code
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_parent_sii_code(self, cr, uid, ids, field_name, args, context=None):
Function generic_connection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def generic_connection(self):
_logger.warning('Entering function "test connection"')
base_url = self.url
# token en el ecabezado (por ejemplo toggl)
- 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_document_data
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_document_data(self, cr, uid, ids, name, arg, context=None):
Function _printed_prices
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _printed_prices(self, cr, uid, ids, name, args, context=None):