GuilhermeStracini/TCC-SENAC

View on GitHub

Showing 605 of 605 total issues

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

    if (this.event_handlers)
        for (var i=0; i<this.event_handlers.length; i++) {
            Spry.Widget.Utils.removeEventListener(this.event_handlers[i][0], this.event_handlers[i][1], this.event_handlers[i][2], false);
        }
Severity: Major
Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 3 hrs to fix
Src/scripts/spryvalidationselect.js on lines 93..96

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

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 (this.event_handlers)
        for (var i=0; i<this.event_handlers.length; i++) {
            Spry.Widget.Utils.removeEventListener(this.event_handlers[i][0], this.event_handlers[i][1], this.event_handlers[i][2], false);
        }
Severity: Major
Found in Src/scripts/spryvalidationselect.js and 1 other location - About 3 hrs to fix
Src/scripts/spryvalidationtextfield.js on lines 734..737

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

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 getCharacterFromEvent has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

Spry.Widget.Utils.getCharacterFromEvent = function(e){
    var keyDown = e.type == "keydown";

    var code = null;
    var character = null;
Severity: Minor
Found in Src/scripts/spryvalidationtextfield.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 getStyle has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  Element.Methods.getStyle = function(element, style) {
    element = $(element);
    style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
    var value = element.style[style];
    if (!value && element.currentStyle) value = element.currentStyle[style];
Severity: Minor
Found in Src/scripts/prototype.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 filterData has a Cognitive Complexity of 22 (exceeds 5 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 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 addMethods has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Element.addMethods = function(methods) {
  var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;

  if (!methods) {
    Object.extend(Form, Form.Methods);
Severity: Major
Found in Src/scripts/prototype.js - About 3 hrs to fix

    Function createSWF has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function createSWF(attObj, parObj, id) {
            var r, el = getElementById(id);
            if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
                attObj.id = id;
            }
    Severity: Major
    Found in Src/scripts/swfobject_modified.js - About 3 hrs to fix

      Function _attributeTranslations has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        Element._attributeTranslations = (function(){
      
          var classProp = 'className',
              forProp = 'for',
              el = document.createElement('div');
      Severity: Major
      Found in Src/scripts/prototype.js - About 3 hrs to fix

        Function Enumerable has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        var Enumerable = (function() {
          function each(iterator, context) {
            var index = 0;
            try {
              this._each(function(value) {
        Severity: Minor
        Found in Src/scripts/prototype.js - About 2 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 attachBehaviors has a Cognitive Complexity of 21 (exceeds 5 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 2 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 compare has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        BinaryExpr.prototype.compare = function(ctx, cmp) {
          var v1 = this.expr1.evaluate(ctx);
          var v2 = this.expr2.evaluate(ctx);
        
          var ret;
        Severity: Major
        Found in Src/scripts/xpath.js - About 2 hrs to fix

          Function evaluate has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          StepExpr.prototype.evaluate = function(ctx) {
            var input = ctx.node;
            var nodelist = [];
          
            // NOTE(mesch): When this was a switch() statement, it didn't work
          Severity: Major
          Found in Src/scripts/xpath.js - About 2 hrs to fix

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

                    for (var i=0; i<this.event_handlers.length; i++) {
                        Spry.Widget.Utils.addEventListener(this.event_handlers[i][0], this.event_handlers[i][1], this.event_handlers[i][2], false);
                    }
            Severity: Major
            Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 2 hrs to fix
            Src/scripts/spryvalidationselect.js on lines 179..181

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

            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(!mustRevert && this.validation && this.maxValue !== null && continueValidations) {
                    var maxValue = this.validation(this.maxValue.toString(), this.options);
                    if (maxValue !== false) {
                        if( this.typedValue > maxValue) {
                            errors = errors | Spry.Widget.ValidationTextField.ERROR_RANGE_MAX;
            Severity: Major
            Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 2 hrs to fix
            Src/scripts/spryvalidationtextfield.js on lines 1021..1029

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

            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(!mustRevert && this.validation && this.minValue !== null && continueValidations) {
                    var minValue = this.validation(this.minValue.toString(), this.options);
                    if (minValue !== false) {
                        if (this.typedValue < minValue) {
                            errors = errors | Spry.Widget.ValidationTextField.ERROR_RANGE_MIN;
            Severity: Major
            Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 2 hrs to fix
            Src/scripts/spryvalidationtextfield.js on lines 1031..1039

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

            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

              function max(iterator, context) {
                iterator = iterator || Prototype.K;
                var result;
                this.each(function(value, index) {
                  value = iterator.call(context, value, index);
            Severity: Major
            Found in Src/scripts/prototype.js and 1 other location - About 2 hrs to fix
            Src/scripts/prototype.js on lines 930..939

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

            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

              function min(iterator, context) {
                iterator = iterator || Prototype.K;
                var result;
                this.each(function(value, index) {
                  value = iterator.call(context, value, index);
            Severity: Major
            Found in Src/scripts/prototype.js and 1 other location - About 2 hrs to fix
            Src/scripts/prototype.js on lines 919..928

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

            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

                    for (var i=0; i<this.event_handlers.length; i++) {
                        Spry.Widget.Utils.addEventListener(this.event_handlers[i][0], this.event_handlers[i][1], this.event_handlers[i][2], false);
                    }
            Severity: Major
            Found in Src/scripts/spryvalidationselect.js and 1 other location - About 2 hrs to fix
            Src/scripts/spryvalidationtextfield.js on lines 806..808

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

            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 _attributeTranslations has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

              Element._attributeTranslations = (function(){
            
                var classProp = 'className',
                    forProp = 'for',
                    el = document.createElement('div');
            Severity: Minor
            Found in Src/scripts/prototype.js - About 2 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 extend has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            Element.extend = (function() {
            
              function checkDeficiency(tagName) {
                if (typeof window.Element != 'undefined') {
                  var proto = window.Element.prototype;
            Severity: Minor
            Found in Src/scripts/prototype.js - About 2 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

            Severity
            Category
            Status
            Source
            Language