Showing 391 of 2,652 total issues
Function check_done
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def check_done(self):
for inventory in self:
if inventory.state == 'confirmed' and \
(not inventory.out_id or inventory.out_id.state == 'done') and \
(not inventory.in_id or 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 approve_order
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def approve_order(self):
''' 成品入库 '''
for order in self:
if order.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 goto
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def goto(self):
self.ensure_one()
views = self.env['ir.ui.view'].search(
[('model', '=', self.model), ('type', '=', 'form')])
model_obj = self.env[self.model]
- 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 approve_feeding
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def approve_feeding(self):
''' 发料 '''
for order in self:
if order.state == 'feeding':
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 findAdjacentAppLink
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
findAdjacentAppLink: function($appLink, direction) {
var obj = [],
$objs = this.$appLinks;
Function on_invalid
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
on_invalid: function() {
var warnings = _(this.fields).chain()
.filter(function (f) {return !f.is_valid(); })
.map(function (f) {
var field_list = ''
Function _init_source_create
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def _init_source_create(self, name, partner_id, category_id, is_init, date,
Function other_get_create_voucher_line
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def other_get_create_voucher_line(self, vouch_obj, init_obj):
"""
其他收入单生成凭证明细行
:param vouch_obj: 凭证
: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 onchange_goods_id
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def onchange_goods_id(self):
if self.goods_id:
self.uom_id = self.goods_id.uom_id
self.uos_id = self.goods_id.uos_id
self.attribute_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 get_line_detail
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_line_detail(self):
for inventory in self:
sql_text = '''
SELECT wh.id as warehouse_id,
goods.id as 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 scan_barcode_move_in_out_operation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def scan_barcode_move_in_out_operation(self, move, att, conversion, goods, val):
"""
对仓库各种移库单据上扫码的统一处理
: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 scan_barcode_each_model_operation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def scan_barcode_each_model_operation(self, model_name, order_id, att, goods, conversion):
val = {}
create_line = False # 是否创建新的明细行
order = self.env[model_name].browse(order_id)
if model_name in ['wh.out', 'wh.in', 'wh.internal']:
- 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_qty
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def onchange_qty(self):
self.ensure_one()
if self.goods_id and self.goods_id.using_batch:
if self.goods_id.force_batch_one and self.difference_qty:
- 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_mv_cost
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _create_mv_cost(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 compute_balance
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def compute_balance(self, parameter_str, period_id, compute_field_list):
"""根据所填写的 科目的code 和计算的字段 进行计算对应的资产值"""
if parameter_str:
parameter_str_list = parameter_str.split('~')
subject_vals = []
- 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 fill
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def fill(self, period_id):
if self.search([('period_id', '=', period_id.id)]):
return True
- 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 write
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def write(self, vals):
for order in self: # 还需要进一步优化
if self.env.context.get('call_module', False) == "checkout_wizard":
return super(Voucher, self).write(vals)
if order.period_id.is_closed is True:
- 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 _animate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_animate: function (destX, destY, duration, easingFn) {
var that = this,
startX = this.x,
startY = this.y,
startTime = utils.getTime(),
Function get_pie_option
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
get_pie_option: function() {
var self = this;
self.legend_data = this.labels && _.unique(this.labels[1]) || [];
self.xaxis_data = this.labels && _.unique(this.labels[0]) || [];
self.series_data = [];
Function jqprint
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.jqprint = function(options) {
opt = $.extend({}, $.fn.jqprint.defaults, options);
var $element = (this instanceof jQuery) ? this : $(this);