osbzr/gooderp_addons

View on GitHub

Showing 2,652 of 2,652 total issues

File iscroll-probe.5.2.0.js has 1676 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */
(function (window, document, Math) {
var rAF = window.requestAnimationFrame    ||
    window.webkitRequestAnimationFrame    ||
    window.mozRequestAnimationFrame        ||
Severity: Major
Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 4 days to fix

    File production.py has 1371 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    
    from odoo.osv import osv
    from utils import inherits, inherits_after, \
        create_name, safe_division, create_origin
    Severity: Major
    Found in warehouse/models/production.py - About 3 days to fix

      File money_order.py has 1098 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      ##############################################################################
      #
      #    OpenERP, Open Source Management Solution
      #    Copyright (C) 2016  开阖软件(<http://osbzr.com>).
      Severity: Major
      Found in money/models/money_order.py - About 2 days to fix

        Function button_checkout has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring.
        Open

            def button_checkout(self):
                ''' 月末结账:结账 按钮 '''
                for balance in self:
                    if balance.period_id:
                        if balance.period_id.is_closed:
        Severity: Minor
        Found in finance/wizard/checkout_wizard.py - About 2 days 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 trial_balance.py has 942 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        from odoo import models, fields, api
        from odoo.exceptions import UserError
        from math import fabs
        import copy
        Severity: Major
        Found in finance/models/trial_balance.py - About 2 days to fix

          File finance.py has 889 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          import calendar
          from datetime import datetime
          import odoo.addons.decimal_precision as dp
          from odoo import api, fields, models
          Severity: Major
          Found in finance/models/finance.py - About 2 days to fix

            Function stock_query has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
            Open

                def stock_query(self):
                    ''' 点击 查询库存 按钮 生成补货申请行
                                                每行一个商品一个属性的 数量,补货数量
                     '''
                    goods = self.env['goods'].search([('no_stock', '=', False)])
            Severity: Minor
            Found in scm/models/stock_request.py - About 2 days 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 asset.py has 657 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            
            from datetime import datetime
            
            import odoo.addons.decimal_precision as dp
            Severity: Major
            Found in asset/models/asset.py - About 1 day to fix

              File buy_order.py has 653 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              ##############################################################################
              #
              #    OpenERP, Open Source Management Solution
              #    Copyright (C) 2016  开阖软件(<http://www.osbzr.com>).
              Severity: Major
              Found in buy/models/buy_order.py - About 1 day to fix

                File sell_order.py has 607 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                
                from odoo import fields, models, api
                import odoo.addons.decimal_precision as dp
                from odoo.exceptions import UserError
                Severity: Major
                Found in sell/models/sell_order.py - About 1 day to fix

                  File sell_delivery.py has 586 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  
                  from odoo import fields, models, api
                  import odoo.addons.decimal_precision as dp
                  import datetime
                  Severity: Major
                  Found in sell/models/sell_delivery.py - About 1 day to fix

                    Function stock_request_done has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def stock_request_done(self):
                            if self.state == 'done':
                                raise UserError(u'请不要重复确认')
                            todo_buy_lines = []  # 待生成购货订单
                            todo_produce_lines = []  # 待生成组装单
                    Severity: Minor
                    Found in scm/models/stock_request.py - About 1 day 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 Plugin has 220 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function Plugin (el, options) {
                            // To avoid scope issues, use 'base' instead of 'this'
                            // to reference this class from internal events and functions.
                            var base = this;
                    
                    
                    Severity: Major
                    Found in fixed_header/static/src/lib/jquery.stickytableheaders.js - About 1 day to fix

                      Function utils has 213 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var utils = (function () {
                          var me = {};
                      
                          var _elementStyle = document.createElement('div').style;
                          var _vendor = (function () {
                      Severity: Major
                      Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 day to fix

                        File buy_receipt.py has 512 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        
                        from odoo import fields, models, api
                        import odoo.addons.decimal_precision as dp
                        from odoo.exceptions import UserError
                        Severity: Major
                        Found in buy/models/buy_receipt.py - About 1 day to fix

                          File staff_wages.py has 486 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          from odoo import fields, models, api
                          from odoo.exceptions import UserError
                          
                          READONLY_STATES = {
                          Severity: Minor
                          Found in staff_wages/models/staff_wages.py - About 7 hrs to fix

                            Function from_data_excel has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def from_data_excel(self, fields, rows_file_address):
                                    rows, file_address = rows_file_address
                                    if file_address:
                                        bk = xlrd.open_workbook(misc.file_open(
                                            file_address).name, formatting_info=True)
                            Severity: Minor
                            Found in web_export_view_good/controllers/controllers.py - About 7 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 recreate_voucher_name has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def recreate_voucher_name(self, period_id):
                                    # 取重排凭证设置
                                    # 是否重置凭证号
                                    context = dict(self.env.context or {})
                                    context['call_module'] = "checkout_wizard"
                            Severity: Minor
                            Found in finance/wizard/checkout_wizard.py - About 7 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 money_order_done has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def money_order_done(self):
                                    '''对收付款单的审核按钮'''
                                    for order in self:
                                        if order.state == 'done':
                                            raise UserError(u'请不要重复确认')
                            Severity: Minor
                            Found in money/models/money_order.py - About 7 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 wave.py has 438 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            # -*- coding: utf-8 -*-
                            from odoo import api, fields, models
                            from odoo.exceptions import UserError
                            
                            
                            
                            Severity: Minor
                            Found in warehouse_wave/models/wave.py - About 6 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language