krafthaus/bauhaus

View on GitHub

Showing 476 of 1,049 total issues

Avoid deeply nested control flow statements.
Open

                            if ( !(unmatched[i] || setMatched[i]) ) {
                                setMatched[i] = pop.call( results );
                            }
Severity: Major
Found in bower_components/jquery/src/sizzle/dist/sizzle.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
                                    return true;
                                }
    Severity: Major
    Found in bower_components/jquery/src/sizzle/dist/sizzle.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                              if (target.is('.old')) {
                                                  if (month === 0) {
                                                      month = 11;
                                                      year -= 1;
                                                  } else {

        Avoid deeply nested control flow statements.
        Open

                                while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
                                    cur = cur.replace( " " + clazz + " ", " " );
                                }
        Severity: Major
        Found in bower_components/jquery/src/attributes/classes.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if ( name in thisCache ) {
                                  name = [ name ];
                              } else {
                                  name = name.split(" ");
                              }
          Severity: Major
          Found in bower_components/jquery/src/data.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {
                                            e.preventDefault();
            
                                            if (keyCode == VK.LEFT) {
                                                positionCaretOnElement(nonEditableParent, true);
            Severity: Major
            Found in bower_components/tinymce/plugins/noneditable/plugin.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (!isForward && removeList(li.parentNode.nodeName)) {
                                          return true;
                                      }
              Severity: Major
              Found in bower_components/tinymce/plugins/lists/plugin.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if (!dom.hasClass(node, 'mce-item-selected')) {
                                                break;
                                            }
                Severity: Major
                Found in bower_components/tinymce/plugins/table/plugin.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (nonEditableParent && getContentEditable(nonEditableParent) === "false") {
                                                  e.preventDefault();
                  
                                                  if (keyCode == VK.RIGHT) {
                                                      positionCaretOnElement(nonEditableParent, false);
                  Severity: Major
                  Found in bower_components/tinymce/plugins/noneditable/plugin.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if (rowSpan) {
                                                    if (y + rowSpan > maxY) {
                                                        maxY = y + rowSpan;
                                                    }
                                                }
                    Severity: Major
                    Found in bower_components/tinymce/plugins/table/plugin.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  if (!textBlock) {
                                                      textBlock = dom.create(blockName);
                                                      fragment.appendChild(textBlock);
                                                  }
                      Severity: Major
                      Found in bower_components/tinymce/plugins/lists/plugin.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                    if (colSpan) {
                                                        if (x + colSpan > maxX) {
                                                            maxX = x + colSpan;
                                                        }
                                                    }
                        Severity: Major
                        Found in bower_components/tinymce/plugins/table/plugin.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if (listElements[y] === node) {
                                                          listElements.splice(i, 1);
                                                          break;
                                                      }
                          Severity: Major
                          Found in bower_components/tinymce/plugins/lists/plugin.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        for (c = 1; c <= cols; c++) {
                                                            dom.insertAfter(cloneCell(cell), cell);
                                                        }
                            Severity: Major
                            Found in bower_components/tinymce/plugins/table/plugin.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          for (var i = 0; i < groups.length; i++) {
                                                              if (!groups[i].filter || groups[i].filter(selector)) {
                                                                  if (!groups[i].item) {
                                                                      groups[i].item = {text: groups[i].title, menu: []};
                                                                  }
                              Severity: Major
                              Found in bower_components/tinymce/plugins/importcss/plugin.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                if (editor.settings.video_template_callback) {
                                                    html = editor.settings.video_template_callback(data);
                                                } else {
                                                    html = (
                                                        '<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' +
                                Severity: Major
                                Found in bower_components/tinymce/plugins/media/plugin.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              if (value) {
                                                                  attrs.map[name] = value;
                                                                  attr.value = value;
                                                              } else {
                                                                  delete attrs.map[name];
                                  Severity: Major
                                  Found in bower_components/tinymce/plugins/media/plugin.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                if (rowSpan > 1) {
                                                                    setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
                                                                    continue;
                                                                }
                                    Severity: Major
                                    Found in bower_components/tinymce/plugins/table/plugin.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                  if (children.length) {
                                                                      children = Tools.grep(startCell.childNodes);
                                                                      count = 0;
                                                                      each(children, function(node) {
                                                                          if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) {
                                      Severity: Major
                                      Found in bower_components/tinymce/plugins/table/plugin.js - About 45 mins to fix

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

                                            protected function arrayToXml($result, &$xml)
                                            {
                                                foreach ($result as $key => $value) {
                                                    if (is_array($value)) {
                                                        if (!is_numeric($key)) {
                                        Severity: Minor
                                        Found in src/KraftHaus/Bauhaus/Export/Format/XmlFormat.php - 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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language