GuilhermeStracini/TCC-SENAC

View on GitHub

Showing 390 of 605 total issues

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 Src/scripts/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 (stack[s].tag == pattern[p]) {
        while (s - ds >= 0 && stack[s - ds].tag == pattern[p]) {
          qmatch.push(stack[s - ds]);
          ds += 1;
          match.matchlength += 1;
Severity: Major
Found in Src/scripts/xpath.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (l != "movie") { // Filter out IE specific param element
                            e.setAttribute(l, parObj[l]);
                        }
    Severity: Major
    Found in Src/scripts/swfobject_modified.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 Src/scripts/xpath.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if (k == "data") {
                                e.setAttribute("src", attObj[k]);
                            }
                            else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
                                e.setAttribute("class", attObj[k]);
        Severity: Major
        Found in Src/scripts/swfobject_modified.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

              for (var n = input.nextSibling; n; n = n.nextSibling) {
                nodelist.push(n);
              }
          Severity: Major
          Found in Src/scripts/xpath.js - About 45 mins to fix

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

            Spry.Widget.Utils.contains = function (who, what)
            {
                if (typeof who.contains == 'object') {
                    return what && who && (who == what || who.contains(what));
                } else {
            Severity: Minor
            Found in Src/scripts/spryvalidationselect.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 (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements
                                        fixParams(obj);
                                    }
            Severity: Major
            Found in Src/scripts/swfobject_modified.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            for(attr in arguments[1])
                              element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
              Severity: Major
              Found in Src/scripts/builder.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
                                        o.setAttribute("class", attObj[m]);
                                    }
                                    else if (m != "classid") { // Filter out IE specific attribute
                                        o.setAttribute(m, attObj[m]);
                Severity: Major
                Found in Src/scripts/swfobject_modified.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (typeof par.flashvars != UNDEF) {
                                                  par.flashvars += "&" + i + "=" + flashvarsObj[i];
                                              }
                                              else {
                                                  par.flashvars = i + "=" + flashvarsObj[i];
                  Severity: Major
                  Found in Src/scripts/swfobject_modified.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 Src/scripts/xpath.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if (spType == "string")
                                              sp = [ sp ];
                                          else if (spType == "object" && spType.constructor == Object)
                                              sp = [ sp ];
                      Severity: Major
                      Found in Src/scripts/sprydata.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            for (var l = 0; l < numRSRows; l++)
                                            {
                                                // Create a new row that will house the join result.
                        
                                                var newRowObj = new Object;
                        Severity: Major
                        Found in Src/scripts/sprydata.js - About 45 mins to fix

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

                          Spry.Data.XMLDataSet.prototype.sessionExpiredChecker = function(req)
                          {
                              if (req.xhRequest.responseText == 'session expired')
                                  return true;
                              else
                          Severity: Minor
                          Found in Src/scripts/sprydata.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 (!lastStartComment)
                                                              node.insertBefore(oComment, node.firstChild);
                                                          else
                                                              node.insertBefore(oComment, lastStartComment.nextSibling);
                          Severity: Major
                          Found in Src/scripts/sprydata.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                            if (tokenStack[tokenStack.length - 1].tokenType != Spry.Data.Region.Token.PROCESSING_INSTRUCTION_TOKEN)
                                            {
                                                Spry.Debug.reportError("Invalid processing instruction close tag: " + piName + " -- " + results[0] + "\n");
                                                return null;
                                            }
                            Severity: Major
                            Found in Src/scripts/sprydata.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if (a_l_c > b_l_c)
                                                      return 1;
                                                  else if (a_l_c < b_l_c)
                                                      return -1;
                                                  else if (a_c > b_c)
                              Severity: Major
                              Found in Src/scripts/sprydata.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                            else if (token.data.name == "spry:state")
                                            {
                                                var testVal = true;
                                
                                                if (!token.data.regionState || token.data.regionState == this.currentState)
                                Severity: Major
                                Found in Src/scripts/sprydata.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if (pdsc) pdsc.addChild(dsc);
                                  Severity: Major
                                  Found in Src/scripts/sprydata.js - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language