neyric/wireit

View on GitHub

Showing 497 of 497 total issues

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

function xmlImportNode(doc, node) {
  if (node.nodeType == DOM_TEXT_NODE) {
    return domCreateTextNode(doc, node.nodeValue);

  } else if (node.nodeType == DOM_CDATA_SECTION_NODE) {
Severity: Minor
Found in sandbox/grouping/examples/sawire/xml/util.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

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

function ExprContext(node, opt_position, opt_nodelist, opt_parent, opt_caseInsensitive, opt_ignoreAttributesWithoutValue) {
Severity: Minor
Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

        if (this.nodetest.evaluate(ctx).booleanValue()) {
          nodelist.push(input);
        }
    Severity: Major
    Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 45 mins to fix

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

          getValue: function()
          {
          var obj = {modules: [], wires: [], properties: null};
          var layer;
          
      Severity: Minor
      Found in sandbox/grouping/examples/WiringEditor/embedded.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

            else if( t == "ApplyXSLToWorkItem") {
                var workItemXml= module.value.workitemXML;
                if( workItemXml == "[wired]") {
                    var wires = this.wiringConfig.working.wires;
                    var paramValue;
      Severity: Major
      Found in sandbox/grouping/examples/sawire/ExecutionFrame.js - About 45 mins to fix

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

            addWireConfig: function(group, getInternalContainerId, getExternalTerminalName, externalWires, internalWires, groupIndex)
        Severity: Minor
        Found in sandbox/grouping/js/GroupUtils.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if (t.options.name == name)
                              {
                              terminal = t;
                              break;
                              }
          Severity: Major
          Found in sandbox/grouping/js/GroupUtils.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                    if (cmp(s, nn)) {
                      ret = true;
                      break;
                    }
            Severity: Major
            Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                    if (end != -1) {
                      var data = x[i].substring(start, end);
                      var node = domCreateComment(xmldoc, data);
                      domAppendChild(parent, node);
                    } else {
              Severity: Major
              Found in sandbox/grouping/examples/sawire/xml/dom.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if(i==0 || j==0) {
                                       liaisons.push([n,n+1]);
                                       liaisons.push([n,n+c]);
                                    }
                                    else {
                Severity: Major
                Found in sandbox/planar-game/planar-game.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                    if(wire.tgt.moduleId == moduleId) {
                                       id = this.execValues[wire.src.moduleId][wire.src.terminal];
                                       break;
                                    }
                  Severity: Major
                  Found in sandbox/grouping/examples/sawire/ExecutionFrame.js - About 45 mins to fix

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

                    function xsltChoose(input, template, output) {
                      for (var i = 0; i < template.childNodes.length; ++i) {
                        var childNode = template.childNodes[i];
                        if (childNode.nodeType != DOM_ELEMENT_NODE) {
                          continue;
                    Severity: Minor
                    Found in sandbox/grouping/examples/sawire/xml/xslt.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

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

                    UnionExpr.prototype.evaluate = function(ctx) {
                      var nodes1 = this.expr1.evaluate(ctx).nodeSetValue();
                      var nodes2 = this.expr2.evaluate(ctx).nodeSetValue();
                      var I1 = nodes1.length;
                      for (var i2 = 0; i2 < nodes2.length; ++i2) {
                    Severity: Minor
                    Found in sandbox/grouping/examples/sawire/xml/xpath.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 (tagName) skipNodeTest = true;
                    Severity: Major
                    Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                          } else if (v1.type == 'string') {
                            var s = v1.stringValue();
                            var n = v2.nodeSetValue();
                      
                            ret = false;
                      Severity: Major
                      Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                       for(var i = 0 ; i < wires.length ; i++) {
                                          var wire = wires[i];
                                          if(wire.tgt.moduleId == moduleId) {
                                             id = this.execValues[wire.src.moduleId][wire.src.terminal];
                                             break;
                        Severity: Major
                        Found in sandbox/grouping/examples/sawire/ExecutionFrame.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                for (var i = 0;  i < n.length; ++i) {
                                  var nn = xmlValue(n[i]) - 0;
                                  if (cmp(nn, s)) {
                                    ret = true;
                                    break;
                          Severity: Major
                          Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                              } else if (this.axis == xpathAxis.DESCENDANT) {
                                var tagName = xpathExtractTagNameFromNodeTest(this.nodetest);
                                xpathCollectDescendants(nodelist, input, tagName);
                                if (tagName) skipNodeTest = true;
                            
                            
                            Severity: Major
                            Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                  } else if (tag.charAt(0) == '/') {
                                    stack.pop();
                                    parent = stack[stack.length-1];
                              
                                  } else if (tag.charAt(0) == '?') {
                              Severity: Major
                              Found in sandbox/grouping/examples/sawire/xml/dom.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                    } else if (stack[s].tag == pattern[p]) {
                                      match.push(stack[s]);
                                      ds += 1;
                                      match.matchlength += 1;
                                
                                
                                Severity: Major
                                Found in sandbox/grouping/examples/sawire/xml/xpath.js - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language