Showing 391 of 2,652 total issues
Function updatePosition
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
updatePosition: function () {
var x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0,
y = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0;
if ( !this.options.ignoreBoundaries ) {
Function handleEvent
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleEvent: function (e) {
switch ( e.type ) {
case 'touchstart':
case 'pointerdown':
case 'MSPointerDown':
Function create_buy_partner
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def create_buy_partner(self):
if self.partner_code_in:
partner_id = self.env['partner'].search([
('tax_num', '=', self.partner_code_in)])
if self.partner_name_in:
- 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_is_pack_ok
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def compute_is_pack_ok(self):
"""计算字段, 看看是否打包完成"""
if self.product_line_ids:
self.is_pack = True
for line in self.product_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 get_receiver_goods_message
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_receiver_goods_message(self):
# TODO: 要发货的详细地址字段 (有疑问)
ORIGIN_EXPLAIN = {
'wh.internal': 'wh.internal',
'wh.out.others': 'wh.out',
- 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_tax_rate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_tax_rate(self, goods, partner, type):
"""
获得税率
如果商品上没有税率,则逐级取商品分类上的税率;
商品税率和业务伙伴税率做比较:如果都存在,取小的;其中一个存在取该值;都不存在取公司上的进/销项税
- 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_sell_partner
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def create_sell_partner(self):
if self.partner_code_out:
partner_id = self.env['partner'].search([
('tax_num', '=', self.partner_code_out)])
elif self.partner_name_out:
- 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 schedule_backup_pgtool
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def schedule_backup_pgtool(self):
confs = self.search([])
master_pass = tools.config.get('admin_passwd', False)
res_user_obj = self.env.get('res.users')
if not master_pass:
- 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_trial_balance
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def check_trial_balance(self, period_id):
res = {}
trial_balance_items = self.env['trial.balance'].search([('period_id', '=', period_id.id), ('account_type', '=', 'normal')])
field_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 voucher_done
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def voucher_done(self):
"""
确认 凭证按钮 所调用的方法
:return: 主要是把 凭证的 state改变
"""
- 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 show_stock_query
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
show_stock_query: function() {
var self = this,
$query = $('<ul class="nav navbar-nav navbar-right nav-stock-query"><li><input type="text" placeholder="库存查询"/><a class="query"></a><a class="destroy"></a><div class="stock-query-search-list"/></li></ul>'),
$input = $query.find('input'),
$destroy = $query.find('.destroy');
Function start
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function() {
var self = this,
res = this._super.apply(this, arguments);
self.$el.on('keydown', '.do_pack_scan_code', function(event) {
Function _start
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
_start: function (e) {
// React to left mouse button only
if ( utils.eventType[e.type] != 1 ) {
// for button property
// http://unixpapa.com/js/mouse.html
Function toggleHeaders
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
base.toggleHeaders = base.debounce(function () {
if (base.$el) {
base.$el.each(function () {
var $this = $(this),
newLeft,
Function draw_rows
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw_rows: function ($tbody, rows) {
var self = this,
i, j, value, $row, $cell, $header,
nbr_measures = this.active_measures.length,
length = rows[0].values.length,
Function create_category
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def create_category(self):
for mx in self.line_ids:
category = mx.tax_type
if category:
category_id = self.env['core.category'].search([
- 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_statements_report_with_goods
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def _create_statements_report_with_goods(self, partner_id, name, date, done_date, order_amount,
Function scan_one_barcode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def scan_one_barcode(self, code, pack_row):
"""对于一个条码的处理"""
if pack_row.is_pack:
raise UserError(u'已经打包完成!')
if not pack_row.odd_numbers:
- 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_partner_id
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def onchange_partner_id(self):
''' 选择客户带出其默认地址信息 '''
if self.partner_id:
self.contact = self.partner_id.contact
self.mobile = self.partner_id.mobile
- 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_partner_id
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def onchange_partner_id(self):
'''选择客户带出其默认地址信息'''
if self.partner_id:
self.contact = self.partner_id.contact
self.mobile = self.partner_id.mobile
- 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"