Showing 391 of 2,652 total issues
Function money_invoice_done
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def money_invoice_done(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 create_sale_invoice
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def create_sale_invoice(self):
"""
通过Excel文件导入信息到tax.invoice
"""
invoice_out = self.env['tax.invoice.out'].browse(self.env.context.get('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 sell_delivery_draft
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def sell_delivery_draft(self):
'''反审核销售发货单/退货单,更新本单的收款状态/退款状态,并删除生成的结算单、收款单及凭证'''
if self.state == 'draft':
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 buy_receipt_draft
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def buy_receipt_draft(self):
'''反审核采购入库单/退货单,更新本单的付款状态/退款状态,并删除生成的结算单、付款单及凭证'''
if self.state == 'draft':
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 create_depreciation
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def create_depreciation(self):
''' 资产折旧,生成凭证和折旧明细'''
vouch_obj = self.env['voucher'].create({'date': self.date})
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 create_general_ledger_account
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def create_general_ledger_account(self):
"""创建总账"""
last_period = self.env['create.trial.balance.wizard'].compute_last_period_id(
self.period_begin_id)
if last_period and not last_period.is_closed:
- 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 other_money_order.py
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 开阖软件(<http://www.osbzr.com>).
#
Function money_transfer_done
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def money_transfer_done(self):
'''转账单的审核按钮'''
self.ensure_one()
if not self.line_ids:
raise UserError('请先输入转账金额')
- 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 _initSnap
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initSnap: function () {
this.currentPage = {};
if ( typeof this.options.snap == 'string' ) {
this.options.snap = this.scroller.querySelectorAll(this.options.snap);
Function reconcile_order_done
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def reconcile_order_done(self):
'''核销单的审核按钮'''
# 核销金额不能大于未核销金额
for order in self:
if order.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
File warehouse_order.py
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
from utils import inherits, inherits_after, create_name, create_origin
import odoo.addons.decimal_precision as dp
from odoo import models, fields, api
Function _initIndicators
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initIndicators: function () {
var interactive = this.options.interactiveScrollbars,
customStyle = typeof this.options.scrollbars != 'string',
indicators = [],
indicator;
Function money_transfer_draft
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def money_transfer_draft(self):
'''转账单的反审核按钮,外币要考虑是转入还是转出'''
self.ensure_one()
decimal_amount = self.env.ref('core.decimal_amount')
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 button_counter_checkout
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def button_counter_checkout(self):
for balance in self:
if balance.period_id:
if not balance.period_id.is_closed:
raise UserError(u'期间%s未结账' % balance.period_id.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
Function get_amount
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def get_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 find_source_order
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def find_source_order(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 default_get
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def default_get(self, fields):
res = super(CheckTrialBalanceWizard, self).default_get(fields)
active_id = self.env.context.get('active_id', False)
trial_balance_item = self.env['trial.balance'].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
File stock_request.py
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
from odoo import tools
import odoo.addons.decimal_precision as dp
from odoo import models, fields, api
Function _move
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
_move: function (e) {
if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
return;
}
Function _wheel
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
_wheel: function (e) {
if ( !this.enabled ) {
return;
}