osbzr/gooderp_addons

View on GitHub

Showing 2,652 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: 
        """
Severity: Minor
Found in money/models/generate_accounting.py - About 4 hrs to fix

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'))
Severity: Minor
Found in tax_invoice_out/models/tax_invoice_out.py - About 3 hrs to fix

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'请不要重复撤销')
        # 查找产生的收款单
Severity: Minor
Found in sell/models/sell_delivery.py - About 3 hrs to fix

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'请不要重复撤销')
        # 查找产生的付款单
Severity: Minor
Found in buy/models/buy_receipt.py - About 3 hrs to fix

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 = []
Severity: Minor
Found in asset/models/asset.py - About 3 hrs to fix

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:
Severity: Minor
Found in finance/models/trial_balance.py - About 3 hrs to fix

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>).
#
Severity: Minor
Found in money/models/other_money_order.py - About 3 hrs to fix

    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('请先输入转账金额')
    Severity: Minor
    Found in money/models/money_transfer_order.py - About 3 hrs to fix

    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);
    Severity: Major
    Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 3 hrs to fix

      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':
      Severity: Minor
      Found in money/models/money_order.py - About 3 hrs to fix

      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
      Severity: Minor
      Found in warehouse/models/warehouse_order.py - About 3 hrs to fix

        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;
        Severity: Major
        Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 3 hrs to fix

          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:
          Severity: Minor
          Found in money/models/money_transfer_order.py - About 3 hrs to fix

          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)
          Severity: Minor
          Found in finance/wizard/checkout_wizard.py - About 3 hrs to fix

          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'其他收支'),
          Severity: Minor
          Found in money/wizard/cash_flow_wizard.py - About 3 hrs to fix

          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):
                  '''
                  查看原始单据,有以下情况:销售发货单、销售退货单、采购退货单、采购入库单、
                  项目、委外加工单、核销单、购货订单、固定资产、固定资产变更以及期初应收应付。
                  '''
          Severity: Minor
          Found in money/models/money_order.py - About 3 hrs to fix

          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)
          Severity: Minor
          Found in finance/models/trial_balance.py - About 3 hrs to fix

          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
          Severity: Minor
          Found in scm/models/stock_request.py - About 3 hrs to fix

            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;
                    }
            
            
            Severity: Major
            Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 3 hrs to fix

              Function _wheel has 75 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _wheel: function (e) {
                      if ( !this.enabled ) {
                          return;
                      }
              
              
              Severity: Major
              Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language