phodal/congee

View on GitHub

Showing 200 of 421 total issues

Avoid deeply nested control flow statements.
Open

                            if (req.onResourceLoad) {
                                req.onResourceLoad(context, this.map, this.depMaps);
                            }
Severity: Major
Found in scripts/libs/require.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                    if ( dist < sorted[ i ].dist ) {
                                        sorted.splice( i, 0, { uid: +uid, type: type, dist: dist } );
                                        break;
                                    }
    Severity: Major
    Found in ckeditor/plugins/lineutils/plugin.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if ((this.events.error && this.map.isDefine) ||
                                      req.onError !== defaultOnError) {
                                      try {
                                          exports = context.execCb(id, factory, depExports, exports);
                                      } catch (e) {
      Severity: Major
      Found in scripts/libs/require.js - About 45 mins to fix

        Function __ntuplecomp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            __ntuplecomp: function (a, b) {
                var mlen = Math.max(a.length, b.length);
                for (var i = 0; i < mlen; i++) {
                    if (a[i] < b[i]) return -1;
                    if (a[i] > b[i]) return 1;
        Severity: Minor
        Found in ckeditor/plugins/autosave/js/difflib.js - About 45 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

        Avoid deeply nested control flow statements.
        Open

                            if (headers.hasOwnProperty(header)) {
                                xhr.setRequestHeader(header.toLowerCase(), headers[header]);
                            }
        Severity: Major
        Found in scripts/libs/text.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (context_data_position == bitsPerChar - 1) {
                                      context_data_position = 0;
                                      context_data.push(getCharFromInt(context_data_val));
                                      context_data_val = 0;
                                  } else {
          Severity: Major
          Found in ckeditor/plugins/autosave/js/lz-string-1.3.3.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                            if ( !groupStarted ) {
                                                output.push( '<span class="cke_toolgroup" role="presentation">' );
                                                groupStarted = 1;
                                            }
            Severity: Major
            Found in ckeditor/plugins/floating-tools/plugin.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      for (i = 0 ; i < 16 ; i++) {
                                          context_data_val = (context_data_val << 1) | (value & 1);
                                          if (context_data_position == bitsPerChar - 1) {
                                              context_data_position = 0;
                                              context_data.push(getCharFromInt(context_data_val));
              Severity: Major
              Found in ckeditor/plugins/autosave/js/lz-string-1.3.3.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        for (i = 0 ; i < 8 ; i++) {
                                            context_data_val = (context_data_val << 1) | (value & 1);
                                            if (context_data_position == bitsPerChar - 1) {
                                                context_data_position = 0;
                                                context_data.push(getCharFromInt(context_data_val));
                Severity: Major
                Found in ckeditor/plugins/autosave/js/lz-string-1.3.3.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (context_data_position == bitsPerChar - 1) {
                                              context_data_position = 0;
                                              context_data.push(getCharFromInt(context_data_val));
                                              context_data_val = 0;
                                          } else {
                  Severity: Major
                  Found in ckeditor/plugins/autosave/js/lz-string-1.3.3.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for (i = 0 ; i < context_numBits ; i++) {
                                                context_data_val = (context_data_val << 1);
                                                if (context_data_position == bitsPerChar - 1) {
                                                    context_data_position = 0;
                                                    context_data.push(getCharFromInt(context_data_val));
                    Severity: Major
                    Found in ckeditor/plugins/autosave/js/lz-string-1.3.3.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (b < be) addCellsInline(node, b++, null, baseTextLines, "delete");
                      Severity: Major
                      Found in ckeditor/plugins/autosave/js/diffview.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            } else if (change == "delete") {
                                                addCellsInline(node, b++, null, baseTextLines, change);
                                            } else {
                                                // equal
                                                addCellsInline(node, b++, n++, baseTextLines, change);
                        Severity: Major
                        Found in ckeditor/plugins/autosave/js/diffview.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if (n < ne) addCellsInline(node2, null, n++, newTextLines, "insert");
                          Severity: Major
                          Found in ckeditor/plugins/autosave/js/diffview.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if (idx + 1 == opcodes.length) {
                                                        break;
                                                    } else {
                                                        continue;
                                                    }
                            Severity: Major
                            Found in ckeditor/plugins/autosave/js/diffview.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if (!inline) node.appendChild(ctelt("td", "skip", ""));
                              Severity: Major
                              Found in ckeditor/plugins/autosave/js/diffview.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                            if ( upcasted instanceof CKEDITOR.htmlParser.element )
                                                                element = upcasted;
                                Severity: Major
                                Found in ckeditor/plugins/widget/plugin.js - About 45 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                          if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
                                                  (milliseconds <= 0 && days <= 0 && months <= 0))) {
                                              milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
                                              days = 0;
                                              months = 0;
                                  Severity: Major
                                  Found in ckeditor/plugins/autosave/js/moment.js - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                        if (deepStringMixin && typeof value === 'object' && value &&
                                                            !isArray(value) && !isFunction(value) &&
                                                            !(value instanceof RegExp)) {
                                    
                                                            if (!target[prop]) {
                                    Severity: Major
                                    Found in scripts/libs/require.js - About 40 mins to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                                  if ((config.maxWordCount > -1 && wordCount > config.maxWordCount && deltaWord > 0) ||
                                                      (config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0)) {
                                      
                                                      limitReached(editorInstance, limitReachedNotified);
                                                  } else if (!limitRestoredNotified &&
                                      Severity: Major
                                      Found in ckeditor/plugins/wordcount/plugin.js - About 40 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language