Showing 2,652 of 2,652 total issues
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
Avoid too many return
statements within this function. Open
return docx.shared.Twips(float(s[:-5]))
Avoid too many return
statements within this function. Open
return docx.shared.Emu(float(s[:-3]))
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return docx.shared.Pt(float(s))
Avoid too many return
statements within this function. Open
return self.env.user.company_id.import_tax_rate
Avoid too many return
statements within this function. Open
return docx.shared.Pt(float(s[:-2]))
Avoid too many return
statements within this function. Open
return partner_tax_rate
Avoid too many return
statements within this function. Open
return self.env.user.company_id.output_tax_rate
Function view_detail
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def view_detail(self):
'''销售汇总表(按商品)查看明细按钮'''
self.ensure_one()
line_ids = []
res = []
- 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 view_detail
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def view_detail(self):
'''销售汇总表(按客户)查看明细按钮'''
self.ensure_one()
line_ids = []
res = []
- 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_temp_false
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _compute_temp_false(self, field, temp):
if not temp:
if field and field.type in ('integer', 'float'):
return 0
if field.type == 'float' and int(temp) == temp:
- 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 name_get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def name_get(self):
'''在many2one字段里显示 编号_名称'''
res = []
for adds in self:
- 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_uom
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_uom(self):
for mx in self.line_ids:
uom = mx.product_unit
if uom:
uom_id = self.env['uom'].search([('name', '=', uom)])
- 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 _put_info_to_partner
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _put_info_to_partner(self, child):
self.contact = child.contact
self.mobile = child.mobile
self.phone = child.phone
self.qq = child.qq
- 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 to_money_invoice
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_money_invoice(self):
tax = 0
bill_number = ''
for line in self.line_ids:
if line.invoice_type == 'zy':
- 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 view_detail
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def view_detail(self):
'''销售汇总表(按销售人员)查看明细按钮'''
self.ensure_one()
line_ids = []
res = []
- 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_sell_delivery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_sell_delivery(self, goods_id, attribute_id):
''' 查找缺货发货单 '''
sell_delivery_lists = []
for active_model in self.env[self.active_model].browse(self.env.context.get('active_ids')):
for line in active_model.line_out_ids:
- 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 other_money_done
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def other_money_done(self):
'''其他收支单的审核按钮'''
self.ensure_one()
if float_compare(self.total_amount, 0, 3) <= 0:
raise UserError(u'金额应该大于0。\n金额:%s' % self.total_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 _sell_amount_to_invoice
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _sell_amount_to_invoice(self):
'''销售费用产生结算单'''
invoice_id = False
if sum(cost_line.amount for cost_line in self.cost_line_ids) > 0:
for line in self.cost_line_ids:
- 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"