Showing 2,652 of 2,652 total issues
Function _get_or_pay
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_or_pay(self, line, business_type,
Function search_read
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def search_read(self, domain=None, fields=None, offset=0, limit=80, order=None):
Function supplier_statement_report
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def supplier_statement_report(self, cr, uid, ids, report_id, context=None):
Function _get_invoice_vals
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_invoice_vals(self, partner_id, category_id, date, amount, tax_amount):
Function _compute_by_selection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _compute_by_selection(self, field, temp):
if field and field.type == 'selection':
selection = field.selection
if isinstance(selection, basestring):
selection = getattr(self.data, selection)()
- 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 hr_expense_draft
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def hr_expense_draft(self):
'''删掉其他应付款单'''
if self.state == 'draft':
raise UserError(u'请不要重复撤销')
if self.other_money_order:
- 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_goods_id
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def onchange_goods_id(self):
'''当订单行的商品变化时,带出商品上的零售价,以及公司的销项税'''
self.ensure_one()
is_return = self.env.context.get('default_is_return')
if self.goods_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 auto_reconcile_sell_order
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def auto_reconcile_sell_order(self):
''' 预收款与结算单自动核销 '''
all_delivery_amount = 0
for delivery in self.order_id.delivery_ids:
all_delivery_amount += delivery.amount
- 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 find_source_order
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def find_source_order(self):
# 查看原始单据,三种情况:收款单、销售退货单、销售发货单、核销单
self.ensure_one()
model_view = {
'money.order': {'name': u'收款单',
- 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 find_source_order
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def find_source_order(self):
# 查看原始单据,三种情况:收款单、销售退货单、销售发货单
self.ensure_one()
model_view = {
'money.order': {'name': u'收款单',
- 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 money_invoice_done
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def money_invoice_done(self):
"""
结算单审核方法
:return:
"""
- 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 apportion_cost
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apportion_cost(self, cost):
for assembly in self:
if not assembly.line_in_ids:
continue
- 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_current_rate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _compute_current_rate(self):
date = self._context.get('date') or fields.Datetime.now()
period_id = self.env['finance.period'].get_period(date).id
for currency in self:
currency.rate = 1.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
Function create_vourcher_line_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_vourcher_line_data(self, outsource, voucher_row):
"""
准备入库凭证行数据
借:库存商品(商品上)
贷:生产成本-基本生产成本(核算分类上)
- 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_vourcher_line_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_vourcher_line_data(self, disassembly, voucher_row):
"""
准备入库凭证行数据
借:库存商品(商品上)
贷:生产成本-基本生产成本(核算分类上)
- 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 apportion_cost
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apportion_cost(self, cost):
for assembly in self:
if not assembly.line_in_ids:
continue
- 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 _process_domain
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _process_domain(self, result, domain):
if domain and len(domain) == 3:
field, opto, value = domain
compute_operator = {
- 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_or_pay
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _get_or_pay(self, line, business_type,
partner_id, to_partner_id, name):
"""
核销单 核销时 对具体核销单行进行的操作
:param 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 check_is_child_enable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_is_child_enable(self):
for child_line in self.line_out_ids:
for parent_line in self.line_in_ids:
if child_line.goods_id.id == parent_line.goods_id.id and child_line.attribute_id.id == parent_line.attribute_id.id:
raise UserError(u'子件中不能包含与组合件中相同的 产品+属性,%s' % parent_line.goods_id.name)
- 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_is_child_enable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_is_child_enable(self):
for child_line in self.line_in_ids:
for parent_line in self.line_out_ids:
if child_line.goods_id.id == parent_line.goods_id.id and child_line.attribute_id.id == parent_line.attribute_id.id:
raise UserError(u'子件中不能包含与组合件中相同的 产品+属性,%s' % parent_line.goods_id.name)
- 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"