Showing 2,652 of 2,652 total issues
Function name_search
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def name_search(self, name='', args=None, operator='ilike', limit=100):
''' 让warehouse支持使用code来搜索'''
args = args or []
# 将name当成code搜
if name and not filter(lambda _type: _type[0] == 'code', args):
- 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 unlink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def unlink(self):
for record in self:
if 'state' in record._fields.keys():
if record.state == 'done':
raise UserError(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 construction_action_url_list
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def construction_action_url_list(self, action, action_url_list):
"""
把所有的数据整合,经过深度处理放进 action_url_list
:param action: [home.page]对象,数据的来源。
:param action_url_list: 存放数据的处理结果。
- 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 asset_done
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def asset_done(self):
''' 确认固定资产 '''
self._wrong_asset_done()
# 非初始化固定资产生成入账凭证
if not self.is_init:
- 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 _read_group_process_groupby
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _read_group_process_groupby(self, gb, query):
res = groupby_original(self, gb, query)
split = gb.split(':')
gb_function = split[1] if len(split) == 2 else None
if gb_function and gb_function == 'day':
- 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_buy_payment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _prepare_buy_payment(self, receipt):
'''对于传入的入库单,为创建采购付款一览表准备数据'''
self.ensure_one()
factor = not receipt.is_return and 1 or -1 # 如果是退货则金额均取反
purchase_amount = factor * (receipt.discount_amount + receipt.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 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 buy_receipt_done
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def buy_receipt_done(self):
'''审核采购入库单/退货单,更新本单的付款状态/退款状态,并生成结算单和付款单'''
# 报错
self._wrong_receipt_done()
# 调用wh.move中审核方法,更新审核人和审核状态
- 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 _buy_amount_to_invoice
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _buy_amount_to_invoice(self):
'''采购费用产生结算单'''
if sum(cost_line.amount for cost_line in self.cost_line_ids) > 0:
for line in self.cost_line_ids:
if not float_is_zero(line.amount, 2):
- 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_account_id
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def onchange_account_id(self):
self.currency_id = self.account_id.currency_id
self.rate_silent = self.account_id.currency_id.rate
res = {
'domain': {
- 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
Using width with padding-left can sometimes make elements larger than you expect. Open
padding-left: 20px;
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.nav-stock-query .query {
- Exclude checks
The properties padding-top, padding-bottom, padding-left, padding-right can be replaced by padding. Open
.drawer-hamburger {
- Exclude checks
Adjoining classes: .drawer--sidebar.drawer--right .drawer-contents Open
.drawer--sidebar.drawer--right .drawer-contents {
- Exclude checks
Using width with border can sometimes make elements larger than you expect. Open
border: 1px solid #999999;
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.drawer-brand {
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.sr-only {
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.drawer-hamburger-icon,
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.drawer--sidebar.drawer--left .drawer-nav {
- Exclude checks