GuilhermeStracini/TCC-SENAC

View on GitHub

Showing 605 of 605 total issues

Function DSContext has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

Spry.Data.Region.DSContext = function(dataSet, processingContext)
{
    var m_dataSet = dataSet;
    var m_processingContext = processingContext;
    var m_curRowIndexArray = [ { rowIndex: -1 } ]; // -1 means return whatever the current row is inside the data set.
Severity: Minor
Found in Src/scripts/sprydata.js - About 6 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 a Cognitive Complexity of 40 (exceeds 5 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: Minor
Found in Src/scripts/spryvalidationtextfield.js - About 6 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 node has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

  node: function(elementName) {
    elementName = elementName.toUpperCase();

    // try innerHTML approach
    var parentTag = this.NODEMAP[elementName] || 'div';
Severity: Minor
Found in Src/scripts/builder.js - About 5 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

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

Spry.Widget.Utils.getFirstParentWithNodeName = function(node, nodeName)
{
    while (node.parentNode
            && node.parentNode.nodeName.toLowerCase() != nodeName.toLowerCase()
            && node.parentNode.nodeName != 'BODY') {
Severity: Major
Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 5 hrs to fix
Src/scripts/spryvalidationselect.js on lines 410..423

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

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 (!Spry.Widget.Form.destroyAll) {
    Spry.Widget.Form.destroyAll = function()
    {
        var q = Spry.Widget.Form.onSubmitWidgetQueue;
        for (var i = 0; i < Spry.Widget.Form.onSubmitWidgetQueue.length; i++) {
Severity: Major
Found in Src/scripts/spryvalidationselect.js and 1 other location - About 5 hrs to fix
Src/scripts/spryvalidationtextfield.js on lines 2031..2042

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

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

Spry.Widget.Utils.getFirstParentWithNodeName = function(node, nodeName)
{
    while (node.parentNode
            && node.parentNode.nodeName.toLowerCase() != nodeName.toLowerCase()
            && node.parentNode.nodeName != 'BODY') {
Severity: Major
Found in Src/scripts/spryvalidationselect.js and 1 other location - About 5 hrs to fix
Src/scripts/spryvalidationtextfield.js on lines 2246..2259

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

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 (!Spry.Widget.Form.destroyAll) {
    Spry.Widget.Form.destroyAll = function()
    {
        var q = Spry.Widget.Form.onSubmitWidgetQueue;
        for (var i = 0; i < Spry.Widget.Form.onSubmitWidgetQueue.length; i++) {
Severity: Major
Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 5 hrs to fix
Src/scripts/spryvalidationselect.js on lines 367..378

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

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

  update: (function(){

    var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){
      var el = document.createElement("select"),
          isBuggy = true;
Severity: Minor
Found in Src/scripts/prototype.js - About 5 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 onKeyDown has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

Spry.Widget.ValidationTextField.prototype.onKeyDown = function(e)
{
    this.saveState();
    this.keyCode = e.keyCode;

Severity: Minor
Found in Src/scripts/spryvalidationtextfield.js - About 5 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 a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

Form.Element.Serializers = (function() {
  function input(element, value) {
    switch (element.type.toLowerCase()) {
      case 'checkbox':
      case 'radio':
Severity: Minor
Found in Src/scripts/prototype.js - About 5 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 a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

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

  if (!methods) {
    Object.extend(Form, Form.Methods);
Severity: Minor
Found in Src/scripts/prototype.js - About 4 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 processTokens has 119 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Spry.Data.Region.prototype.processTokens = function(outputArr, token, processContext)
{
    var i = 0;

    switch(token.tokenType)
Severity: Major
Found in Src/scripts/sprydata.js - About 4 hrs to fix

    Function attachBehaviors has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    Spry.Widget.ValidationTextField.prototype.attachBehaviors = function()
    {
        if (this.element) {
            if (this.element.nodeName == "INPUT") {
                this.input = this.element;
    Severity: Minor
    Found in Src/scripts/spryvalidationtextfield.js - About 4 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 DSContext has 116 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Spry.Data.Region.DSContext = function(dataSet, processingContext)
    {
        var m_dataSet = dataSet;
        var m_processingContext = processingContext;
        var m_curRowIndexArray = [ { rowIndex: -1 } ]; // -1 means return whatever the current row is inside the data set.
    Severity: Major
    Found in Src/scripts/sprydata.js - About 4 hrs to fix

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

      Spry.Widget.SelectionDescriptor.prototype.move = function(amount)
      {
          if (Spry.is.ie && Spry.is.windows) {
              this.range.move("character", amount);
              this.range.select();
      Severity: Major
      Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 4 hrs to fix
      Src/scripts/spryvalidationtextfield.js on lines 1941..1950

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      Spry.Widget.SelectionDescriptor.prototype.moveEnd = function(amount)
      {
          if (Spry.is.ie && Spry.is.windows) {
              this.range.moveEnd("character", amount);
              this.range.select();
      Severity: Major
      Found in Src/scripts/spryvalidationtextfield.js and 1 other location - About 4 hrs to fix
      Src/scripts/spryvalidationtextfield.js on lines 1895..1904

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

      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

      File spryvalidationselect.js has 357 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // SpryValidationSelect.js - version 0.10 - Spry Pre-Release 1.6.1
      //
      // Copyright (c) 2006. Adobe Systems Incorporated.
      // All rights reserved.
      //
      Severity: Minor
      Found in Src/scripts/spryvalidationselect.js - About 4 hrs to fix

        Function xpathReduce has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        function xpathReduce(stack, ahead) {
          var cand = null;
        
          if (stack.length > 0) {
            var top = stack[stack.length-1];
        Severity: Minor
        Found in Src/scripts/xpath.js - About 4 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 processDataRefString has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

        Spry.Data.Region.processDataRefString = function(processingContext, regionStr, dataSetsToUse, isJSExpr)
        {
            if (!regionStr)
                return "";
        
        
        Severity: Minor
        Found in Src/scripts/sprydata.js - About 4 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 getSortFunc has 109 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Spry.Data.DataSet.prototype.sort.getSortFunc = function(prop, type, order)
        {
            var sortfunc = null;
            if (type == "number")
            {
        Severity: Major
        Found in Src/scripts/sprydata.js - About 4 hrs to fix
          Severity
          Category
          Status
          Source
          Language