osbzr/gooderp_addons

View on GitHub

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;
        }

Severity: Major
Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 2 hrs to fix

    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'其他收支'),
    Severity: Minor
    Found in money/wizard/cash_flow_wizard.py - About 2 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 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({
    Severity: Minor
    Found in warehouse/models/warehouse_move_line.py - About 2 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 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
    
    
    Severity: Minor
    Found in finance/wizard/checkout_wizard.py - About 2 hrs to fix

      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)
      Severity: Minor
      Found in money/models/money_order.py - About 2 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 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  德清武康开源软件工作室().
      Severity: Minor
      Found in staff_expense/models/hr_expense.py - About 2 hrs to fix

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

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

            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 __ = {
            Severity: Minor
            Found in backend_theme/static/lib/js/drawer.3.2.0.js - About 2 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_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()
                        # 库存不足 生成零的
            Severity: Minor
            Found in sell/models/sell_delivery.py - About 2 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 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)):
            Severity: Minor
            Found in warehouse/report/report_base.py - About 2 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_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')
            Severity: Minor
            Found in finance/models/exchange.py - About 2 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_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 = [];
            Severity: Major
            Found in web_export_view_good/static/src/js/web_export_view_good.js - About 2 hrs to fix

              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,
              Severity: Major
              Found in web_sublist/static/src/js/sublist.js - About 2 hrs to fix

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

                  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)]}
                  Severity: Minor
                  Found in partner_address/models/partner_address.py - About 2 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 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(" ")
                  Severity: Minor
                  Found in warehouse_wave/models/wave.py - About 2 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_voucher has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def create_voucher(self):
                          # 入库单生成入库凭证
                          '''
                          借:商品分类对应的会计科目 一般是库存商品
                          贷:如果入库类型为盘盈,取科目 1901 待处理财产损益(暂时写死)
                  Severity: Minor
                  Found in warehouse/models/warehouse_order.py - About 2 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_voucher has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def create_voucher(self):
                          '''
                          借: 商品分类对应的会计科目 一般是库存商品
                          贷:类型为支出的类别对应的会计科目 一般是材料采购
                  
                  
                  Severity: Minor
                  Found in buy/models/buy_receipt.py - About 2 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

                  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'
                  Severity: Minor
                  Found in sell/models/sell_order.py - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language