GuilhermeStracini/TCC-SENAC

View on GitHub

Showing 605 of 605 total issues

Function menu has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function menu(){
    var menu = document.getElementById("menu");
    var menuCE = document.getElementById("canto_menu_esquerdo");
    var menuCC = document.getElementById("menu_centro");
    var menuCD = document.getElementById("canto_menu_direito");
Severity: Minor
Found in Src/scripts/scripts.js - About 1 hr 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 setStyle has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  setStyle: function(element, styles) {
    element = $(element);
    var elementStyle = element.style, match;
    if (Object.isString(styles)) {
      element.style.cssText += ';' + styles;
Severity: Minor
Found in Src/scripts/prototype.js - About 1 hr 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 setRequestHeaders has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  setRequestHeaders: function() {
    var headers = {
      'X-Requested-With': 'XMLHttpRequest',
      'X-Prototype-Version': Prototype.Version,
      'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
Severity: Minor
Found in Src/scripts/prototype.js - About 1 hr 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 getElementsByClassName has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
  function iter(name) {
    return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
  }

Severity: Minor
Found in Src/scripts/prototype.js - About 1 hr 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 xpathGrammarPrecedence has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function xpathGrammarPrecedence(frame) {
  var ret = 0;

  if (frame.rule) { /* normal reduce */
    if (frame.rule.length >= 3 && frame.rule[2] >= 0) {
Severity: Minor
Found in Src/scripts/xpath.js - About 1 hr 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 fixUpIEInnerHTML has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

Spry.Utils.fixUpIEInnerHTML = function(inStr)
{
    var outStr = "";

    // Create a regular expression that will match:
Severity: Minor
Found in Src/scripts/sprydata.js - About 1 hr 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 setAttribute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

Spry.Utils.setAttribute = function(ele, name, value)
{
    ele = Spry.$(ele);
    if (!ele || !name)
        return;
Severity: Minor
Found in Src/scripts/sprydata.js - About 1 hr 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 compilePattern has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Spry.Widget.ValidationTextField.prototype.compilePattern = function() {
    if (!this.pattern) {
        return;
    }
    var compiled = [];
Severity: Minor
Found in Src/scripts/spryvalidationtextfield.js - About 1 hr to fix

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

    Spry.Widget.ValidationTextField.prototype.isPositionAtEndOfGroup = function (value, pos, group)
    {
        var test_value = value.substring(0, pos);
        return this.getRegExpForFullGroup(group).test(test_value);
    };
    Severity: Major
    Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 1 hr to fix
    Src/scripts/spryvalidationtextfield.js on lines 1204..1208

    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 66.

    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.prototype.isValueValid = function(value, pos, group) 
    {
        var test_value = value.substring(0, pos);
        return this.getRegExpForGroup(group).test(test_value);
    };
    Severity: Major
    Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 1 hr to fix
    Src/scripts/spryvalidationtextfield.js on lines 1211..1215

    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 66.

    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 attachBehaviors has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Spry.Widget.ValidationSelect.prototype.attachBehaviors = function()
    {
        // find the SELECT element inside current container
        if (this.element.nodeName == "SELECT") {
            this.selectElement = this.element;
    Severity: Minor
    Found in Src/scripts/spryvalidationselect.js - About 1 hr to fix

      Function loadData has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Spry.Data.HTTPSourceDataSet.prototype.loadData = function()
      {
          if (!this.url)
              return;
      
      
      Severity: Minor
      Found in Src/scripts/sprydata.js - About 1 hr to fix

        Function regions has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var regions = Spry.Utils.getNodesByFunc(rootNode, function(node)
            {
                try
                {
                    if (node.nodeType != 1 /* Node.ELEMENT_NODE */)
        Severity: Minor
        Found in Src/scripts/sprydata.js - About 1 hr to fix

          Function getValue has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Spry.Data.DataSet.prototype.getValue = function(valueName, rowContext)
          {
              var result = undefined;
          
              // If a rowContext is not defined, we default to
          Severity: Minor
          Found in Src/scripts/sprydata.js - About 1 hr to fix

            Function recalculateDataSetDependencies has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Spry.Data.HTTPSourceDataSet.prototype.recalculateDataSetDependencies = function()
            {
                this.hasDataRefStrings = false;
            
                // Clear all old callbacks that may have been registered.
            Severity: Minor
            Found in Src/scripts/sprydata.js - About 1 hr to fix

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

              Spry.Data.Region.PI.buildOpenTag = function(ele, piName)
              {
                  return "<" + Spry.Data.Region.PI.instructions[piName].tagName + ">";
              };
              Severity: Major
              Found in Src/scripts/sprydata.js and 1 other location - About 1 hr to fix
              Src/scripts/sprydata.js on lines 4340..4343

              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 65.

              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

                    'border-box-height': function(element) {
                      if (!this._preComputing) this._begin();
                      var height = element.offsetHeight;
                      if (!this._preComputing) this._end();
                      return height;
              Severity: Major
              Found in Src/scripts/prototype.js and 1 other location - About 1 hr to fix
              Src/scripts/prototype.js on lines 3493..3498

              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 65.

              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

                    'border-box-width': function(element) {
                      if (!this._preComputing) this._begin();
                      var width = element.offsetWidth;
                      if (!this._preComputing) this._end();
                      return width;
              Severity: Major
              Found in Src/scripts/prototype.js and 1 other location - About 1 hr to fix
              Src/scripts/prototype.js on lines 3486..3491

              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 65.

              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.Data.Region.PI.buildCloseTag = function(ele, piName)
              {
                  return "</" + Spry.Data.Region.PI.instructions[piName].tagName + ">";
              };
              Severity: Major
              Found in Src/scripts/sprydata.js and 1 other location - About 1 hr to fix
              Src/scripts/sprydata.js on lines 4335..4338

              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 65.

              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 CHILD has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      CHILD: function(elem, match){
                          var type = match[1], node = elem;
                          switch (type) {
                              case 'only':
                              case 'first':
              Severity: Minor
              Found in Src/scripts/prototype.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language