Showing 391 of 2,652 total issues
Function gooderp_statistics
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
openerp.gooderp_statistics = function(instance) {
instance.web.ActionManager.include({
do_action: function(action, options) {
var return_var = this._super.apply(this, arguments);
Function _initEvents
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initEvents: function (remove) {
var eventType = remove ? utils.removeEvent : utils.addEvent,
target = this.options.bindToWrapper ? this.wrapper : window;
eventType(window, 'orientationchange', this);
Function getWidth
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
base.getWidth = function ($clonedHeaders) {
var widths = [];
$clonedHeaders.each(function (index) {
var width, $this = $(this);
Function _get_sell_money_state
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _get_sell_money_state(self):
'''返回收款状态'''
if not self.is_return:
if self.invoice_id.reconciled == 0:
self.money_state = 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 create_product
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create_product(self):
for mx in self.line_ids:
goods = mx.product_name
uom = mx.product_unit
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 unlink
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def unlink(self):
"""
删除发货单时,删除对应的拣货单行
"""
for move 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 partner_statements_without_goods
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def partner_statements_without_goods(self):
"""
业务伙伴对账单: 不带商品明细
:return: action
"""
- 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_voucher
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create_voucher(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 update_record_value
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_record_value(self, value, record, sql_type='out'):
tag = sql_type == 'out' and -1 or 1
value.update({
'goods_qty_begain': value.get('goods_qty_begain', 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_money_order_pay_voucher
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create_money_order_pay_voucher(self, line_ids, source_ids, partner, name, note):
"""
为付款单创建凭证
:param line_ids: 付款单明细
:param source_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 _compute_domain_util
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _compute_domain_util(self, result, domains):
index = 0
while index < len(domains):
domain = domains[index]
index += 1
- 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 good_process_approve
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def good_process_approve(self, active_id, active_model):
return_vals = []
message = ''
manger_row = self.__has_manager__(active_id, active_model)
model_row = self.env[active_model].browse(active_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 delete_confirmed_wh
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def delete_confirmed_wh(self):
for inventory in self:
if inventory.state == 'confirmed':
if (inventory.out_id and inventory.out_id.state == 'done') \
or (inventory.in_id and inventory.in_id.state == 'done'):
- 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_voucher
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create_voucher(self):
"""创建凭证并审核"""
vouch_obj = self.env['voucher'].create({'date': self.date, 'ref': '%s,%s' % (self._name, self.id)})
vals = {}
for line in self.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"
Further reading
Function inherits
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def inherits(res_back=True):
def wrapper(method):
@functools.wraps(method)
def func(self, *args, **kwargs):
- 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_availability
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_availability(self):
if self.warehouse_dest_id == self.warehouse_id:
# 如果是 商品库位转移生成的内部移库,则不用约束调入仓和调出仓是否相同;否则需要约束
if not (self.move_id.origin == 'wh.internal' and not self.location_id == False):
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 prepare_move_line_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def prepare_move_line_data(self, att, val, goods, move):
"""
准备移库单明细数据
: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 create_account_exchange_line
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create_account_exchange_line(self, vals):
'''
无partner的汇兑损益
'''
account_id = vals.get('account_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_buy_money_state
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _get_buy_money_state(self):
'''返回付款状态'''
if not self.is_return:
if self.invoice_id.reconciled == 0:
self.money_state = 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 init_asset
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def init_asset(self):
'''删除以前引入的固定资产内容'''
for line in self.line_ids:
if line.init_obj == 'asset':
line.unlink()
- 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"