ilscipio/scipio-erp

View on GitHub
themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js

Summary

Maintainability
C
7 hrs
Test Coverage

Function fromFtlStd has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    this.fromFtlStd = function(k, v, linkType, argDefs, ftlDir, initValues) {
Severity: Minor
Found in themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js - About 45 mins to fix

    Function buildSelectFieldHtml has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        this.buildSelectFieldHtml = function (fieldName, fieldValue, fieldLabel, attr, valueStrict, selectOptions) {
    Severity: Minor
    Found in themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (endPos != -1) {
                                  var strLit = str.substring(0, endPos + 1);
                                  var strValue = this.unescapeStringLit(str.substring(rawStr ? 2 : 1, endPos));
                                  dir.args[argName] = {value: strValue, strValue: strValue, strLit: strLit, rawStr: rawStr};
                                  str = str.substring(endPos + 1);
      Severity: Major
      Found in themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (m) {
                                    var strValue = m[1];
                                    dir.args[argName] = {value: (strValue == 'true'), strValue: strValue, strLit: m[1]};
                                    str = m[2] || '';
                                } else {
        Severity: Major
        Found in themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js - About 45 mins to fix

          Consider simplifying this complex logical expression.
          Open

                          if (opt.selected === true || (typeof fieldValue !== 'undefined' && fieldValue != null && ((opt.value || '') == (fieldValue || '')))) {
                              optHtml += ' selected="selected"';
                              valFound = true;
                          }
          Severity: Major
          Found in themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                                    if (opt.selected === true || (typeof field.value !== 'undefined' && field.value != null && ((opt.value || '') == (field.value || '')))) {
                                        optHtml += ' selected="selected"';
                                        valFound = true;
                                    }
            Severity: Major
            Found in themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js - About 40 mins to fix

              Function putFieldInitValues has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  this.putFieldInitValues = function(t, linkType, argDefs, ftlDir, initValues) {
              Severity: Minor
              Found in themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js - About 35 mins to fix

                Function buildInputFieldHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    this.buildInputFieldHtml = function (fieldType, fieldName, fieldValue, fieldLabel, attr) {
                Severity: Minor
                Found in themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js - About 35 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return dir;
                  Severity: Major
                  Found in themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return -1;
                    Severity: Major
                    Found in themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                              return i;
                      Severity: Major
                      Found in themes/base/webapp/base/js/cms/trumbowyg/trumbowyg.scipio_common.js - About 30 mins to fix

                        There are no issues that match your filters.

                        Category
                        Status