GuilhermeStracini/TCC-SENAC

View on GitHub

Showing 605 of 605 total issues

Function loadData has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

Spry.Data.HTTPSourceDataSet.LoadManager.loadData = function(reqInfo, ds, useCache)
{
    if (!reqInfo)
        return null;

Severity: Minor
Found in Src/scripts/sprydata.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 Grow has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Effect.Grow = function(element) {
  element = $(element);
  var options = Object.extend({
    direction: 'center',
    moveTransition: Effect.Transitions.sinoidal,
Severity: Major
Found in Src/scripts/effects.js - About 2 hrs to fix

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

    Spry.Widget.Utils.removeEventListener = function(element, eventType, handler, capture)
    {
        try
        {
            if (element.removeEventListener)
    Severity: Major
    Found in Src/scripts/spryvalidationselect.js and 3 other locations - About 2 hrs to fix
    Src/scripts/spryvalidationselect.js on lines 456..466
    Src/scripts/spryvalidationtextfield.js on lines 2292..2302
    Src/scripts/spryvalidationtextfield.js on lines 2304..2314

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

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

    Spry.Widget.Utils.removeEventListener = function(element, eventType, handler, capture)
    {
        try
        {
            if (element.removeEventListener)
    Severity: Major
    Found in Src/scripts/spryvalidationtextfield.js and 3 other locations - About 2 hrs to fix
    Src/scripts/spryvalidationselect.js on lines 456..466
    Src/scripts/spryvalidationselect.js on lines 468..478
    Src/scripts/spryvalidationtextfield.js on lines 2292..2302

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

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

    Spry.Widget.Utils.addEventListener = function(element, eventType, handler, capture)
    {
        try
        {
            if (element.addEventListener)
    Severity: Major
    Found in Src/scripts/spryvalidationtextfield.js and 3 other locations - About 2 hrs to fix
    Src/scripts/spryvalidationselect.js on lines 456..466
    Src/scripts/spryvalidationselect.js on lines 468..478
    Src/scripts/spryvalidationtextfield.js on lines 2304..2314

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

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

    Spry.Widget.Utils.addEventListener = function(element, eventType, handler, capture)
    {
        try
        {
            if (element.addEventListener)
    Severity: Major
    Found in Src/scripts/spryvalidationselect.js and 3 other locations - About 2 hrs to fix
    Src/scripts/spryvalidationselect.js on lines 468..478
    Src/scripts/spryvalidationtextfield.js on lines 2292..2302
    Src/scripts/spryvalidationtextfield.js on lines 2304..2314

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

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

    Spry.Widget.ValidationTextField.validateIP = function (value, format)
    {
        var validIPv6Addresses = [
            //preferred
            /^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}(?:\/\d{1,3})?$/i,
    Severity: Major
    Found in Src/scripts/spryvalidationtextfield.js - About 2 hrs to fix

      Function punycode_encode has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Spry.Widget.Utils.punycode_encode = function (input, max_out) {
          var inputc = input.split("");
          input = [];
          for(var i=0; i<inputc.length; i++) {
              input.push(inputc[i].charCodeAt(0));
      Severity: Major
      Found in Src/scripts/spryvalidationtextfield.js - About 2 hrs to fix

        Function filter has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        Spry.Data.DataSet.prototype.filter = function(filterFunc, filterOnly)
        {
            // This is a non-destructive filter function.
        
            var dataChanged = false;
        Severity: Minor
        Found in Src/scripts/sprydata.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 recalculateDataSetDependencies has a Cognitive Complexity of 19 (exceeds 5 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 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 validation has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                validation: function(value, options) {
                    var formatRegExp = /^([mdy]+)[\.\-\/\\\s]+([mdy]+)[\.\-\/\\\s]+([mdy]+)$/i;
                    var valueRegExp = this.dateValidationPattern;
                    var formatGroups = options.format.match(formatRegExp);
                    var valueGroups = value.match(valueRegExp);
        Severity: Major
        Found in Src/scripts/spryvalidationtextfield.js - About 2 hrs to fix

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

                  validation: function(value, options) {
                      //    HH:MM:SS T
                      var formatRegExp = /([hmst]+)/gi;
                      var valueRegExp = /(\d+|AM?|PM?)/gi;
                      var formatGroups = options.format.match(formatRegExp);
          Severity: Major
          Found in Src/scripts/spryvalidationtextfield.js - About 2 hrs to fix

            Function init has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Spry.Widget.ValidationTextField.prototype.init = function(element, options)
            {
                this.element = this.getElement(element);
                this.errors = 0;
                this.flags = {locked: false, restoreSelection: true};
            Severity: Major
            Found in Src/scripts/spryvalidationtextfield.js - About 2 hrs to fix

              Function findRowsWithColumnValues has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              Spry.Data.DataSet.prototype.findRowsWithColumnValues = function(valueObj, firstMatchOnly, unfiltered)
              {
                  var results = [];
                  var rows = this.getData(unfiltered);
                  if (rows)
              Severity: Minor
              Found in Src/scripts/sprydata.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 parseColor has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              String.prototype.parseColor = function() {
                var color = '#';
                if (this.slice(0,4) == 'rgb(') {
                  var cols = this.slice(4,this.length-1).split(',');
                  var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
              Severity: Minor
              Found in Src/scripts/effects.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 setDimensions has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                setDimensions: function(height, width) {
                  var d = { };
                  if (this.options.scaleX) d.width = width.round() + 'px';
                  if (this.options.scaleY) d.height = height.round() + 'px';
                  if (this.options.scaleFromCenter) {
              Severity: Minor
              Found in Src/scripts/effects.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 setup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                setup: function(){
                  function parseColor(color){
                    if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
                    color = color.parseColor();
                    return $R(0,2).map(function(i){
              Severity: Minor
              Found in Src/scripts/effects.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 Serializers has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Form.Element.Serializers = (function() {
                function input(element, value) {
                  switch (element.type.toLowerCase()) {
                    case 'checkbox':
                    case 'radio':
              Severity: Major
              Found in Src/scripts/prototype.js - About 2 hrs to fix

                Function piRegions has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        var piRegions = Spry.Utils.getNodesByFunc(rgn, function(node)
                        {
                            try
                            {
                                if (node.nodeType == 1 /* ELEMENT_NODE */)
                Severity: Major
                Found in Src/scripts/sprydata.js - About 2 hrs to fix

                  Function Class has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var Class = (function() {
                  
                    var IS_DONTENUM_BUGGY = (function(){
                      for (var p in { toString: 1 }) {
                        if (p === 'toString') return false;
                  Severity: Major
                  Found in Src/scripts/prototype.js - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language