GuilhermeStracini/TCC-SENAC

View on GitHub

Showing 605 of 605 total issues

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

Spry.Widget.SelectionDescriptor.prototype.update = function()
{
    if (Spry.is.ie && Spry.is.windows) {
        var sel = this.element.ownerDocument.selection;
        if (this.element.nodeName == "TEXTAREA") {
Severity: Major
Found in Src/scripts/spryvalidationtextfield.js - About 2 hrs to fix

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

      'ceiling': function(ctx) {
        assert(this.args.length == 1);
        var num = this.args[0].evaluate(ctx).numberValue();
        return new NumberValue(Math.ceil(num));
      },
    Severity: Major
    Found in Src/scripts/xpath.js and 2 other locations - About 2 hrs to fix
    Src/scripts/xpath.js on lines 1352..1356
    Src/scripts/xpath.js on lines 1364..1368

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

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

      'round': function(ctx) {
        assert(this.args.length == 1);
        var num = this.args[0].evaluate(ctx).numberValue();
        return new NumberValue(Math.round(num));
      },
    Severity: Major
    Found in Src/scripts/xpath.js and 2 other locations - About 2 hrs to fix
    Src/scripts/xpath.js on lines 1352..1356
    Src/scripts/xpath.js on lines 1358..1362

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

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

      'floor': function(ctx) {
        assert(this.args.length == 1);
        var num = this.args[0].evaluate(ctx).numberValue();
        return new NumberValue(Math.floor(num));
      },
    Severity: Major
    Found in Src/scripts/xpath.js and 2 other locations - About 2 hrs to fix
    Src/scripts/xpath.js on lines 1358..1362
    Src/scripts/xpath.js on lines 1364..1368

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

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

    Spry.Utils.fixupIETagAttributes = function(inStr)
    {
        var outStr = "";
    
        // Break the tag string into 3 pieces.
    Severity: Minor
    Found in Src/scripts/sprydata.js - About 2 hrs to fix

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

            'margin-box-height': function(element) {
              var bHeight = this.get('border-box-height'),
               mTop = this.get('margin-top'),
               mBottom = this.get('margin-bottom');
      
      
      Severity: Major
      Found in Src/scripts/prototype.js and 1 other location - About 1 hr to fix
      Src/scripts/prototype.js on lines 3510..3518

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

      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

            'margin-box-width': function(element) {
              var bWidth = this.get('border-box-width'),
               mLeft = this.get('margin-left'),
               mRight = this.get('margin-right');
      
      
      Severity: Major
      Found in Src/scripts/prototype.js and 1 other location - About 1 hr to fix
      Src/scripts/prototype.js on lines 3500..3508

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

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

        function Str(key, holder, stack) {
          var value = holder[key],
              type = typeof value;
      
          if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
      Severity: Minor
      Found in Src/scripts/prototype.js - About 1 hr to fix

        Function Shrink has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function request has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

            request: function(url) {
              this.url = url;
              this.method = this.options.method;
              var params = Object.isString(this.options.parameters) ?
                    this.options.parameters :
          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 setOpacity has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

            Element.Methods.setOpacity = function(element, value) {
              element = $(element);
              element.style.opacity = (value == 1 || value === '') ? '' :
                (value < 0.00001) ? 0 : value;
          
          
          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 moveTo has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

          Spry.Widget.SelectionDescriptor.prototype.moveTo = function(start, end)
          {
              if (Spry.is.ie && Spry.is.windows) {
                  if (this.element.nodeName == "TEXTAREA") {
                      var ta_range = this.element.createTextRange();
          Severity: Minor
          Found in Src/scripts/spryvalidationtextfield.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 serializeObject has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

          Spry.Utils.serializeObject = function(obj)
          {
              // Create a JSON representation of a given object.
          
              var str = "";
          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 loadData has a Cognitive Complexity of 15 (exceeds 5 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

          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 getRecordSetFromXMLDoc has a Cognitive Complexity of 15 (exceeds 5 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

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

          Spry.Data.Region.strToDataSetsArray = function(str, returnRegionNames)
          {
              var dataSetsArr = new Array;
              var foundHash = {};
          
          
          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 2 locations. Consider refactoring.
          Open

                          case "dd":
                              groupPatterns[i-1] = "\\d{1,2}";
                              fullGroupPatterns[i-1] = "\\d\\d";
                              dateValidationPatternString += "(" + groupPatterns[i-1] + ")";
                              autocompleteCharacters[i-1] = null;
          Severity: Major
          Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 1 hr to fix
          Src/scripts/spryvalidationtextfield.js on lines 1141..1146

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

          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 (key in hash) {
                    if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
                    hash[key].push(value);
                  }
                  else hash[key] = value;
          Severity: Major
          Found in Src/scripts/prototype.js and 1 other location - About 1 hr to fix
          Src/scripts/prototype.js on lines 4977..4980

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

          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

                          case "mm":
                              groupPatterns[i-1] = "\\d{1,2}";
                              fullGroupPatterns[i-1] = "\\d\\d";
                              dateValidationPatternString += "(" + groupPatterns[i-1] + ")";
                              autocompleteCharacters[i-1] = null;
          Severity: Major
          Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 1 hr to fix
          Src/scripts/spryvalidationtextfield.js on lines 1135..1140

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

          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 (key in result) {
                    if (!Object.isArray(result[key])) result[key] = [result[key]];
                    result[key].push(value);
                  } else result[key] = value;
          Severity: Major
          Found in Src/scripts/prototype.js and 1 other location - About 1 hr to fix
          Src/scripts/prototype.js on lines 614..618

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

          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