osbzr/gooderp_addons

View on GitHub

Showing 391 of 2,652 total issues

Function get_next_char has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def get_next_char(self, number_next):
        def _interpolation_dict():
            now = range_date = effective_date = datetime.now(
                pytz.timezone(self._context.get('tz') or 'UTC'))
            if self._context.get('ir_sequence_date'):
Severity: Minor
Found in ir_sequence_autoreset/ir_sequence.py - About 1 hr 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 render_value has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render_value: function() {
        var $pdf_viewer = this.$('.o_form_pdf_controls').children().add(this.$('.o_pdfview_iframe')),
            $select_upload_el = this.$('.o_select_file_button').first(),
            $iFrame = this.$('.o_pdfview_iframe'),
            value = this.get('value'),
Severity: Minor
Found in core/static/src/js/core.js - About 1 hr to fix

    Function _initKeys has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _initKeys: function (e) {
            // default key bindings
            var keys = {
                pageUp: 33,
                pageDown: 34,
    Severity: Minor
    Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 hr to fix

      Function get_condition has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def get_condition(self, args):
              """
              返回定价策略的各种条件及报错信息
              :param args: 传入的参数字典
              :return: 取数的条件和按此条件取到多条策略时的报错信息,返回一个有序列表,
      Severity: Minor
      Found in core/models/pricing.py - About 1 hr to fix

        Function pad_table_to has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                pad_table_to: function (count) {
                    count -=3;    /* 表格预留空行太多很难看 */
                    if (this.records.length >= count ||
                        _(this.columns).any(function (column) { return column.meta; })) {
                        return;
        Severity: Minor
        Found in core/static/src/js/core.js - About 1 hr to fix

          Function _end has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _end: function (e) {
                  if ( !this.initiated ) {
                      return;
                  }
          
          
          Severity: Minor
          Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 hr to fix

            Function start has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                start: function() {
                    var self = this,
                        res = this._super.apply(this, arguments);
            
                    self.$el.on('keydown', '.ge_scan_barcode', function(event) {
            Severity: Minor
            Found in warehouse/static/src/js/warehouse_widget.js - About 1 hr to fix

              Function format has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      format: function (row_data, options) {
                          /* Return a valid img tag. For image fields, test if the
                           field's value contains just the binary size and retrieve
                          the image from the dedicated controller in that case.
                          Otherwise, assume a character field containing either a
              Severity: Minor
              Found in top_tree_widget/static/src/js/web_tree_image.js - About 1 hr to fix

                Function createDefaultScrollbar has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function createDefaultScrollbar (direction, interactive, type) {
                    var scrollbar = document.createElement('div'),
                        indicator = document.createElement('div');
                
                    if ( type === true ) {
                Severity: Minor
                Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 1 hr to fix

                  Function start has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      start: function() {
                          var self = this,
                              res = this._super.apply(this, arguments);
                  
                          self.$el.on('keydown', '.do_input_invoice_code', function(event) {
                  Severity: Minor
                  Found in staff_expense/static/src/js/input_invoice_code.js - About 1 hr to fix

                    Function compute_footer_data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function compute_footer_data(amount,export_columns_keys) {
                        var export_rows = []
                        var footer = 0;
                        $.each(amount, function () {
                            var $row = $(this);
                    Severity: Minor
                    Found in web_export_view_good/static/src/js/web_export_view_good.js - About 1 hr to fix

                      Function _create_voucher_line has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def _create_voucher_line(self, line, name, account_id, debit, credit, voucher_id, partner_id, currency_id):
                      Severity: Major
                      Found in money/models/money_order.py - About 1 hr to fix

                        Function _prepare_vouch_line_data has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def _prepare_vouch_line_data(self, line, name, account_id, debit, credit, voucher_id, partner_id, currency_id):
                        Severity: Major
                        Found in money/models/money_order.py - About 1 hr to fix

                          Function calc_length has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def calc_length(s):
                              """
                              把字符串,数字类型的参数转化为docx的长度对象,如:
                              12 => Pt(12)
                              '12' => Pt(12)
                          Severity: Minor
                          Found in report_docx/report/report_helper.py - About 55 mins 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_context has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def get_context(self, sql_type='out', context=None):
                                  date_end = datetime.datetime.strptime(
                                      context.get('date_end'), '%Y-%m-%d') + datetime.timedelta(days=1)
                                  date_end = date_end.strftime('%Y-%m-%d')
                                  return {
                          Severity: Minor
                          Found in sell/report/sell_summary_partner.py - About 55 mins 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 other_money_draft has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def other_money_draft(self):
                                  '''其他收支单的反审核按钮'''
                                  self.ensure_one()
                                  # 根据单据类型更新账户余额
                                  if self.type == 'other_pay':
                          Severity: Minor
                          Found in money/models/other_money_order.py - About 55 mins 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 _compute_partner_address has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def _compute_partner_address(self):
                                  '''如果业务伙伴地址中有默认地址,则显示在业务伙伴列表上'''
                                  if not self.child_ids:
                                      return {}
                                  for child in self.child_ids:
                          Severity: Minor
                          Found in partner_address/models/partner_address.py - About 55 mins 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 onchange_warehouse_id has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def onchange_warehouse_id(self):
                                  '''当订单行的仓库变化时,带出定价策略中的折扣率'''
                                  if self.warehouse_id and self.goods_id:
                                      partner_id = self.env.context.get('default_partner')
                                      partner = self.env['partner'].browse(
                          Severity: Minor
                          Found in sell/models/sell_delivery.py - About 55 mins 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_context has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def get_context(self, sql_type='out', context=None):
                                  date_end = datetime.datetime.strptime(
                                      context.get('date_end'), '%Y-%m-%d') + datetime.timedelta(days=1)
                                  date_end = date_end.strftime('%Y-%m-%d')
                                  return {
                          Severity: Minor
                          Found in sell/report/sell_summary_staff.py - About 55 mins 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 to_other_money_order has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def to_other_money_order(self):
                                  other_money_order = self.with_context(type='other_pay').env['other.money.order'].create({
                                      'state': 'draft',
                                      'partner_id': self.partner_id and self.partner_id.id or '',
                                      'date': self.date,
                          Severity: Minor
                          Found in staff_expense/models/hr_expense.py - About 55 mins 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

                          Severity
                          Category
                          Status
                          Source
                          Language