Showing 2,652 of 2,652 total issues
Function _key
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
_key: function (e) {
if ( !this.enabled ) {
return;
}
Function get_year_amount
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def get_year_amount(self, tem, report_ids, period_id):
'''
[('get',u'销售收款'),
('pay',u'采购付款'),
('category',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 action_done
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def action_done(self):
for line in self:
line.check_availability()
line.prev_action_done()
line.write({
- 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
File checkout_wizard.py
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
from odoo import models, fields, api
from odoo.exceptions import UserError
Function reconcile_order_draft
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def reconcile_order_draft(self):
''' 核销单的反审核按钮 '''
for order in self:
if order.state == 'draft':
raise UserError(u'核销单%s已撤销,不能再次撤销。' % order.name)
- 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
File hr_expense.py
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
##############################################################################
#
# GOODERP, Open Source Management Solution
# Copyright (C) 2018 德清武康开源软件工作室().
Function refresh
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
refresh: function () {
this.transitionTime();
if ( this.options.listenX && !this.options.listenY ) {
this.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none';
Function _end
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
_end: function (e) {
if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
return;
}
Function Drawer
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
}(function Drawer($) {
'use strict';
var namespace = 'drawer';
var touches = typeof document.ontouchstart != 'undefined';
var __ = {
- 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_delivery_done
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def sell_delivery_done(self):
'''审核销售发货单/退货单,更新本单的收款状态/退款状态,并生成结算单和收款单'''
for record in self:
record._wrong_delivery_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 read_group
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def read_group(self, domain, fields, groupby, offset=0, limit=80, orderby=False, lazy=True):
def dict_plus(collect, values):
for key, value in values.iteritems():
if isinstance(value, (long, int, float)):
- 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_partner_exchange_line
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def create_partner_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 button_export_action
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function button_export_action () {
var self = this;
var view = self;
var export_columns_keys = [];
var export_columns_names = [];
Function render_dataset
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
render_dataset: function (dataset) {
var self = this,
list = new (this.view.options.ListType)(this, {
options: this.options,
columns: this.columns,
Function IScroll
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function IScroll (el, options) {
this.wrapper = typeof el == 'string' ? document.querySelector(el) : el;
this.scroller = this.wrapper.children[0];
this.scrollerStyle = this.scroller.style; // cache style for better performance
Function onchange_province
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def onchange_province(self):
# 为地址填写时方便,当选定省时 ,市区的列表里面只有所选省的
if self.province_id:
domain_dict = {'city_id': [
('province_id', '=', self.province_id.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
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def scan_barcode(self, code_str, pack_id):
"""扫描多个条码,条码的处理 拆分 """
if code_str:
pack_row = self.browse(pack_id)
code_list = code_str.split(" ")
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
def create_voucher(self):
# 入库单生成入库凭证
'''
借:商品分类对应的会计科目 一般是库存商品
贷:如果入库类型为盘盈,取科目 1901 待处理财产损益(暂时写死)
- 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 18 (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
SellOrder
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class SellOrder(models.Model):
_name = 'sell.order'
_description = u'销货订单'
_inherit = ['mail.thread']
_order = 'date desc, id desc'