osbzr/gooderp_addons

View on GitHub
core/static/src/js/core.js

Summary

Maintainability
C
1 day
Test Coverage

File core.js has 391 lines of code (exceeds 250 allowed). Consider refactoring.
Open

odoo.define('core.core', function (require) {
    "use strict";
    var ListView = require('web.ListView');
    var common = require('web.list_common');
    var form_relational = require('web.form_relational');
Severity: Minor
Found in core/static/src/js/core.js - About 5 hrs to fix

    Function draw_rows has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            draw_rows: function ($tbody, rows) {
                var self = this,
                    i, j, value, $row, $cell, $header,
                    nbr_measures = this.active_measures.length,
                    length = rows[0].values.length,
    Severity: Minor
    Found in core/static/src/js/core.js - About 1 hr to fix

      Function on_invalid has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

               on_invalid: function() {
                  var warnings = _(this.fields).chain()
                      .filter(function (f) {return !f.is_valid(); })
                      .map(function (f) {
                          var  field_list = ''
      Severity: Minor
      Found in core/static/src/js/core.js - About 1 hr to fix

        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 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 change_color has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    change_color: function (rows, $cell, i, j, nbr_measures,field_index) {
            Severity: Minor
            Found in core/static/src/js/core.js - About 45 mins to fix

              There are no issues that match your filters.

              Category
              Status