GuilhermeStracini/TCC-SENAC

View on GitHub

Showing 390 of 605 total issues

Function loadDataIntoDataSet has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

Spry.Data.XMLDataSet.prototype.loadDataIntoDataSet = function(rawDataDoc)
{
    var rs = null;
    var mainXPath = Spry.Data.Region.processDataRefString(null, this.xpath, this.dataSetsForDataRefStrings);
    var subPaths = this.subPaths;
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 xhRequestProcessor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

Spry.Data.XMLDataSet.prototype.xhRequestProcessor = function(xhRequest)
{
    // XMLDataSet uses the responseXML from the xhRequest

    var resp = xhRequest.responseXML;
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 updateContent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Spry.Data.Region.prototype.updateContent = function()
{
    var allDataSetsReady = true;

    var dsArray = this.getDataSets();
Severity: Minor
Found in Src/scripts/sprydata.js - About 1 hr to fix

    Function getElementsByClassName has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
      function iter(name) {
        return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
      }
    
    
    Severity: Minor
    Found in Src/scripts/prototype.js - About 1 hr to fix

      Function initialize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        initialize: function(element) {
          this.element = $(element);
          if (!this.element) throw(Effect._elementDoesNotExistError);
          var options = Object.extend({
            style: { }
      Severity: Minor
      Found in Src/scripts/effects.js - About 1 hr to fix

        Function SlideUp has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Effect.SlideUp = function(element) {
          element = $(element).cleanWhitespace();
          var oldInnerBottom = element.down().getStyle('bottom');
          var elementDimensions = element.getDimensions();
          return new Effect.Scale(element, window.opera ? 0 : 1,
        Severity: Minor
        Found in Src/scripts/effects.js - About 1 hr to fix

          Function main has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function main() { // Static publishing only
                  var rl = regObjArr.length;
                  for (var i = 0; i < rl; i++) { // For each registered object element
                      var id = regObjArr[i].id;
                      if (ua.pv[0] > 0) {
          Severity: Minor
          Found in Src/scripts/swfobject_modified.js - About 1 hr to fix

            Function onDomLoad has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var onDomLoad = function() {
                    if (!ua.w3cdom) {
                        return;
                    }
                    addDomLoadEvent(main);
            Severity: Minor
            Found in Src/scripts/swfobject_modified.js - About 1 hr to fix

              Function findRowsWithColumnValues has 26 lines of code (exceeds 25 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 1 hr to fix

                Function select has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Spry.Utils.SelectionManager.SelectionGroup.prototype.select = function(element, className, multiSelect)
                {
                    var selObj = null;
                
                    if (!multiSelect)
                Severity: Minor
                Found in Src/scripts/sprydata.js - About 1 hr to fix

                  Function attach has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      attach: function(rgn, node, value)
                      {
                          if (!value)
                              return;
                  
                  
                  Severity: Minor
                  Found in Src/scripts/sprydata.js - About 1 hr to fix

                    Function loadDataCallback has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Spry.Data.HTTPSourceDataSet.LoadManager.CachedRequest.prototype.loadDataCallback = function(req)
                    {
                        if (req.xhRequest.readyState != 4)
                            return;
                    
                    
                    Severity: Minor
                    Found in Src/scripts/sprydata.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if (element && isPercentage) {
                            context = context || element.parentNode;
                            var decimal = toDecimal(value);
                            var whole = null;
                            var position = element.getStyle('position');
                      Severity: Major
                      Found in Src/scripts/prototype.js - About 1 hr to fix

                        Function Region has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        Spry.Data.Region = function(regionNode, name, isDetailRegion, data, dataSets, regionStates, regionStateMap, hasBehaviorAttributes)
                        Severity: Major
                        Found in Src/scripts/sprydata.js - About 1 hr to fix

                          Function setOpacity has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            Element.Methods.setOpacity = function(element, value) {
                              element = $(element);
                              element.style.opacity = (value == 1) ? 0.999999 :
                                (value === '') ? '' : (value < 0.00001) ? 0 : value;
                              return element;
                          Severity: Minor
                          Found in Src/scripts/prototype.js - About 55 mins 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 writeAttribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            writeAttribute: function(element, name, value) {
                              element = $(element);
                              var attributes = { }, t = Element._attributeTranslations.write;
                          
                              if (typeof name == 'object') attributes = name;
                          Severity: Minor
                          Found in Src/scripts/prototype.js - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            getStyle: function(element, style) {
                              element = $(element);
                              style = style == 'float' ? 'cssFloat' : style.camelize();
                              var value = element.style[style];
                              if (!value || value == 'auto') {
                          Severity: Minor
                          Found in Src/scripts/prototype.js - About 55 mins 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 Hash has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          var Hash = Class.create(Enumerable, (function() {
                            function initialize(object) {
                              this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
                            }
                          
                          
                          Severity: Minor
                          Found in Src/scripts/prototype.js - About 55 mins 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 Selector has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          Prototype.Selector = (function() {
                          
                            function select() {
                              throw new Error('Method "Prototype.Selector.select" must be defined.');
                            }
                          Severity: Minor
                          Found in Src/scripts/prototype.js - About 55 mins 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 validate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          Spry.Widget.ValidationTextField.prototype.validate = function() {
                          
                              this.resetClasses();
                              //possible states: required, format, rangeMin, rangeMax, charsMin, charsMax
                              if (this.validateOn & Spry.Widget.ValidationTextField.ONSUBMIT) {
                          Severity: Minor
                          Found in Src/scripts/spryvalidationtextfield.js - About 55 mins 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