GuilhermeStracini/TCC-SENAC

View on GitHub

Showing 605 of 605 total issues

Function getNodeText has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

Spry.Data.XMLDataSet.getNodeText = function(node, encodeText, encodeCData)
{
    var txt = "";

    if (!node)
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

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

    if (this.errors & Spry.Widget.ValidationTextField.ERROR_CHARS_MAX) {
        this.addClassName(this.element, this.invalidCharsMaxClass);
        this.addClassName(this.additionalError, this.invalidCharsMaxClass);
        return false;
    }
Severity: Major
Found in Src/scripts/spryvalidationtextfield.js and 4 other locations - About 1 hr to fix
Src/scripts/spryvalidationtextfield.js on lines 1769..1773
Src/scripts/spryvalidationtextfield.js on lines 1775..1779
Src/scripts/spryvalidationtextfield.js on lines 1781..1785
Src/scripts/spryvalidationtextfield.js on lines 1787..1791

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

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 5 locations. Consider refactoring.
Open

    if (this.errors & Spry.Widget.ValidationTextField.ERROR_CHARS_MIN) {
        this.addClassName(this.element, this.invalidCharsMinClass);
        this.addClassName(this.additionalError, this.invalidCharsMinClass);
        return false;
    }
Severity: Major
Found in Src/scripts/spryvalidationtextfield.js and 4 other locations - About 1 hr to fix
Src/scripts/spryvalidationtextfield.js on lines 1769..1773
Src/scripts/spryvalidationtextfield.js on lines 1775..1779
Src/scripts/spryvalidationtextfield.js on lines 1781..1785
Src/scripts/spryvalidationtextfield.js on lines 1793..1797

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

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 5 locations. Consider refactoring.
Open

    if (this.errors & Spry.Widget.ValidationTextField.ERROR_FORMAT) {
        this.addClassName(this.element, this.invalidFormatClass);
        this.addClassName(this.additionalError, this.invalidFormatClass);
        return false;
    }
Severity: Major
Found in Src/scripts/spryvalidationtextfield.js and 4 other locations - About 1 hr to fix
Src/scripts/spryvalidationtextfield.js on lines 1775..1779
Src/scripts/spryvalidationtextfield.js on lines 1781..1785
Src/scripts/spryvalidationtextfield.js on lines 1787..1791
Src/scripts/spryvalidationtextfield.js on lines 1793..1797

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

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

  var options = Object.extend({
    direction: 'center',
    moveTransition: Effect.Transitions.sinoidal,
    scaleTransition: Effect.Transitions.sinoidal,
    opacityTransition: Effect.Transitions.full
Severity: Major
Found in Src/scripts/effects.js and 1 other location - About 1 hr to fix
Src/scripts/effects.js on lines 827..832

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

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 5 locations. Consider refactoring.
Open

    if (this.errors & Spry.Widget.ValidationTextField.ERROR_RANGE_MAX) {
        this.addClassName(this.element, this.invalidRangeMaxClass);
        this.addClassName(this.additionalError, this.invalidRangeMaxClass);
        return false;
    }
Severity: Major
Found in Src/scripts/spryvalidationtextfield.js and 4 other locations - About 1 hr to fix
Src/scripts/spryvalidationtextfield.js on lines 1769..1773
Src/scripts/spryvalidationtextfield.js on lines 1775..1779
Src/scripts/spryvalidationtextfield.js on lines 1787..1791
Src/scripts/spryvalidationtextfield.js on lines 1793..1797

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

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

Spry.Data.XMLDataSet.getRecordSetFromXMLDoc = function(xmlDoc, path, suppressColumns, entityEncodeStrings)
{
    if (!xmlDoc || !path)
        return null;

Severity: Minor
Found in Src/scripts/sprydata.js - About 1 hr to fix

    Function menu has 42 lines of code (exceeds 25 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

      Function validation has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              validation: function(value, options) {
                  //fix for ?ID=223429 and ?ID=223387
                  /* the following regexp matches components of an URI as specified in http://tools.ietf.org/html/rfc3986#page-51 page 51, Appendix B.
                      scheme    = $2
                      authority = $4
      Severity: Minor
      Found in Src/scripts/spryvalidationtextfield.js - About 1 hr to fix

        Function stopObserving has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function stopObserving(element, eventName, handler) {
            element = $(element);
        
            var registry = Element.retrieve(element, 'prototype_event_registry');
            if (!registry) return element;
        Severity: Minor
        Found in Src/scripts/prototype.js - About 1 hr to fix

          Function validate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Spry.Widget.ValidationTextField.prototype.validate = function() {
          
              this.resetClasses();
              //possible states: required, format, rangeMin, rangeMax, charsMin, charsMax
              if (this.validateOn & Spry.Widget.ValidationTextField.ONSUBMIT) {
          Severity: Minor
          Found in Src/scripts/spryvalidationtextfield.js - About 1 hr to fix

            Function embedSWF has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {
                        if (!ua.w3cdom || !swfUrlStr || !replaceElemIdStr || !widthStr || !heightStr || !swfVersionStr) {
                            return;
                        }
                        widthStr += ""; // Auto-convert to string to make it idiot proof
            Severity: Minor
            Found in Src/scripts/swfobject_modified.js - About 1 hr to fix

              Function filterData has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Spry.Data.DataSet.prototype.filterData = function(filterFunc, filterOnly)
              {
                  // This is a destructive filter function.
              
                  var dataChanged = false;
              Severity: Minor
              Found in Src/scripts/sprydata.js - About 1 hr to fix

                Function distinct has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Spry.Data.DataSet.prototype.distinct = function(columnNames)
                {
                    if (this.data)
                    {
                        var oldData = this.data;
                Severity: Minor
                Found in Src/scripts/sprydata.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if (this.input) {
                          if (this.maxChars) {
                              this.input.removeAttribute("maxLength");
                          }
                          this.putHint();
                  Severity: Critical
                  Found in Src/scripts/spryvalidationtextfield.js - About 1 hr to fix

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

                        if (str && str.search(/[&<>"]/) != -1)
                        {
                            str = str.replace(/&/g, "&amp;");
                            str = str.replace(/</g, "&lt;");
                            str = str.replace(/>/g, "&gt;");
                    Severity: Major
                    Found in Src/scripts/sprydata.js and 1 other location - About 1 hr to fix
                    Src/scripts/sprydata.js on lines 422..428

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

                    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

                        if (str)
                        {
                            str = str.replace(/\\/g, "\\\\");
                            str = str.replace(/["']/g, "\\$&");
                            str = str.replace(/\n/g, "\\n");
                    Severity: Major
                    Found in Src/scripts/sprydata.js and 1 other location - About 1 hr to fix
                    Src/scripts/sprydata.js on lines 434..440

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

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

                        function update(element, content) {
                          element = $(element);
                          var purgeElement = Element._purgeElement;
                    
                          var descendants = element.getElementsByTagName('*'),
                    Severity: Minor
                    Found in Src/scripts/prototype.js - About 1 hr to fix

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

                                  if (Spry.Widget.Utils.specialCharacters.indexOf("," + code + ",") != -1) {
                                      character = null;
                                  } else {
                                      character = String.fromCharCode(code);
                                  }
                      Severity: Major
                      Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 1 hr to fix
                      Src/scripts/spryvalidationtextfield.js on lines 2227..2231

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

                      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

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

                              if (Spry.Widget.Utils.specialCharacters.indexOf("," + code + ",") != -1) {
                                  character = null;
                              } else {
                                  character = String.fromCharCode(code);
                              }
                      Severity: Major
                      Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 1 hr to fix
                      Src/scripts/spryvalidationtextfield.js on lines 2218..2222

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

                      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