GuilhermeStracini/TCC-SENAC

View on GitHub

Showing 605 of 605 total issues

Function update has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  update: (function(){

    var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){
      var el = document.createElement("select"),
          isBuggy = true;
Severity: Major
Found in Src/scripts/prototype.js - About 3 hrs to fix

    xpathfunctions has 30 functions (exceeds 20 allowed). Consider refactoring.
    Open

    FunctionCallExpr.prototype.xpathfunctions = {
      'last': function(ctx) {
        assert(this.args.length == 0);
        // NOTE(mesch): XPath position starts at 1.
        return new NumberValue(ctx.contextSize());
    Severity: Minor
    Found in Src/scripts/xpath.js - About 3 hrs to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        for (var i = 0; i < this.predicate.length; ++i) {
          var nodelist0 = nodelist;
          nodelist = [];
          for (var ii = 0; ii < nodelist0.length; ++ii) {
            var n = nodelist0[ii];
      Severity: Major
      Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
      Src/scripts/xpath.js on lines 1465..1474

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        for (var i = 0; i < this.predicate.length; ++i) {
          var nodes0 = nodes;
          nodes = [];
          for (var j = 0; j < nodes0.length; ++j) {
            var n = nodes0[j];
      Severity: Major
      Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
      Src/scripts/xpath.js on lines 1000..1009

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      Spry.Widget.ValidationTextField.processLoadQueue = function(handler)
      {
          Spry.Widget.ValidationTextField.onloadDidFire = true;
          var q = Spry.Widget.ValidationTextField.loadQueue;
          var qlen = q.length;
      Severity: Major
      Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 3 hrs to fix
      Src/scripts/spryvalidationselect.js on lines 122..129

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      Spry.Widget.ValidationSelect.processLoadQueue = function(handler)
      {
          Spry.Widget.ValidationSelect.onloadDidFire = true;
          var q = Spry.Widget.ValidationSelect.loadQueue;
          var qlen = q.length;
      Severity: Major
      Found in Src/scripts/spryvalidationselect.js and 1 other location - About 3 hrs to fix
      Src/scripts/spryvalidationtextfield.js on lines 849..856

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      Spry.Widget.ValidationSelect.addLoadListener = function(handler)
      {
          if (typeof window.addEventListener != 'undefined')
              window.addEventListener('load', handler, false);
          else if (typeof document.addEventListener != 'undefined')
      Severity: Major
      Found in Src/scripts/spryvalidationselect.js and 1 other location - About 3 hrs to fix
      Src/scripts/spryvalidationtextfield.js on lines 839..847

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 107.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      Spry.Widget.ValidationTextField.addLoadListener = function(handler)
      {
          if (typeof window.addEventListener != 'undefined')
              window.addEventListener('load', handler, false);
          else if (typeof document.addEventListener != 'undefined')
      Severity: Major
      Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 3 hrs to fix
      Src/scripts/spryvalidationselect.js on lines 131..139

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 107.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function createObjectForNode has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

      Spry.Data.XMLDataSet.createObjectForNode = function(node, encodeText, encodeCData)
      {
          if (!node)
              return null;
      
      
      Severity: Minor
      Found in Src/scripts/sprydata.js - About 3 hrs 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          if (v1.type == 'number') {
            var s = v1.numberValue();
            var n = v2.nodeSetValue();
      
            ret = false;
      Severity: Major
      Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
      Src/scripts/xpath.js on lines 1597..1638

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 105.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          } else if (v2.type == 'number') {
            var n = v1.nodeSetValue();
            var s = v2.numberValue();
      
            ret = false;
      Severity: Major
      Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
      Src/scripts/xpath.js on lines 1584..1638

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 105.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function getNodesByFunc has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

      Spry.Utils.getNodesByFunc = function(root, func)
      {
          var nodeStack = new Array;
          var resultArr = new Array;
          var node = root;
      Severity: Minor
      Found in Src/scripts/sprydata.js - About 3 hrs 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 xpathParse has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

      function xpathParse(expr) {
        xpathLog('parse ' + expr);
        xpathParseInit();
      
        var cached = xpathCacheLookup(expr);
      Severity: Minor
      Found in Src/scripts/xpath.js - About 3 hrs 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          } else if (v1.type == 'string') {
            var s = v1.stringValue();
            var n = v2.nodeSetValue();
      
            ret = false;
      Severity: Major
      Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
      Src/scripts/xpath.js on lines 1623..1638

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 101.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          } else if (v2.type == 'string') {
            var n = v1.nodeSetValue();
            var s = v2.stringValue();
      
            ret = false;
      Severity: Major
      Found in Src/scripts/xpath.js and 1 other location - About 3 hrs to fix
      Src/scripts/xpath.js on lines 1610..1638

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 101.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function xpathParse has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function xpathParse(expr) {
        xpathLog('parse ' + expr);
        xpathParseInit();
      
        var cached = xpathCacheLookup(expr);
      Severity: Major
      Found in Src/scripts/xpath.js - About 3 hrs to fix

        Function xpathMatchStack has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

        function xpathMatchStack(stack, pattern) {
        
          // NOTE(mesch): The stack matches for variable cardinality are
          // greedy but don't do backtracking. This would be an issue only
          // with rules of the form A* A, i.e. with an element with variable
        Severity: Minor
        Found in Src/scripts/xpath.js - About 3 hrs 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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        Spry.Utils.addEventListener = function(element, eventType, handler, capture)
        {
            try
            {
                element = Spry.$(element);
        Severity: Major
        Found in Src/scripts/sprydata.js and 1 other location - About 3 hrs to fix
        Src/scripts/sprydata.js on lines 239..250

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 99.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function flattenSubPaths has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Spry.Data.XMLDataSet.prototype.flattenSubPaths = function(rs, subPaths)
        {
            if (!rs || !subPaths)
                return;
        
        
        Severity: Major
        Found in Src/scripts/sprydata.js - About 3 hrs to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          Spry.Utils.removeEventListener = function(element, eventType, handler, capture)
          {
              try
              {
                  element = Spry.$(element);
          Severity: Major
          Found in Src/scripts/sprydata.js and 1 other location - About 3 hrs to fix
          Src/scripts/sprydata.js on lines 226..237

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 99.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language