eliace/ergo-js

View on GitHub

Showing 167 of 296 total issues

Function jquery:keydown has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

            'jquery:keydown': function(e) {

                if(e.keyCode == KEY_UP) {
                    if(!this.selected || this.states.is('opened')) {
                        this.$dropdown.navigator.prev();
Severity: Minor
Found in js/widgets/basic/select.js - About 45 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 _construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    _construct: function(o) {
        this._super(o);


        var grid = this;
Severity: Minor
Found in js/widgets/grids/table-grid.js - About 45 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 _layoutChanged has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    _layoutChanged: function() {
        this._super();


        if(this.before._rendered) {
Severity: Minor
Found in js/widgets/boxes/item-box.js - About 45 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

Consider simplifying this complex logical expression.
Open

        if( (this.options.autoRender === false && target !== true) || (this.options.autoRender == 'non-empty' && !this.__txt && (!this.__c || this.__c.src.length == 0)) ) {
            return;
        }
Severity: Major
Found in js/core/widget-render.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                        if(!child._pivot && !(initial.data == child.data && child.options.dynamic) && (child.data != self.data || update === false || !child._static)) {//child.options.binding)) {
                            child._rebind(false, undefined, initial);
                        }
    Severity: Major
    Found in js/core/widget-data.js - About 40 mins to fix

      Function stream has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          stream: function(filter, sorter, pager, callback) {
      
              var ds = this;
      
              var values = ds.get();
      Severity: Minor
      Found in js/core/data.js - About 35 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 factory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          factory: function(o, type) {
      
              var default_opt = this.options.defaultOpt || 'text';
              if($.isString(o)) {
                  var v = o;
      Severity: Minor
      Found in js/core/widget-list.js - About 35 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 stream has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          stream: function(filter, sorter, pager, callback) {
      
              var c = this._widget; // возможно не лучшее решение, но практичное
      
              var filter = filter || c.options.filter;
      Severity: Minor
      Found in js/core/widget-list.js - About 35 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

      Avoid too many return statements within this function.
      Open

              if(partials[1][j]+'-'+partials[0][i] == k) return v+'px';
      Severity: Major
      Found in js/core/core-dom.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return this;
        Severity: Major
        Found in js/core/object.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return v;
          Severity: Major
          Found in js/core/core-dom.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return this.states.is(i);
            Severity: Major
            Found in js/core/widget.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return defaultValue;
              Severity: Major
              Found in js/core/widget.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            if(partials[0][i] == k) return v+'px';
                Severity: Major
                Found in js/core/core-dom.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return this;
                  Severity: Major
                  Found in js/core/widget.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return defaultValue;
                    Severity: Major
                    Found in js/core/object.js - About 30 mins to fix

                      Function _initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          _initialize: function() {
                              Ergo.core.Layout.superclass._initialize.apply(this, arguments);
                      
                              var o = this.options;
                      
                      Severity: Minor
                      Found in js/core/layout.js - About 25 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 entry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          entry: function(i) {
                      
                      //        console.log('-- data entry --');
                      
                              var ds = this;
                      Severity: Minor
                      Found in js/core/data.js - About 25 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 flush has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          flush: function() {
                      
                              var oid = this.oid;
                      
                              var composer = this.options.composer || this._compose;
                      Severity: Minor
                      Found in js/data/object.js - About 25 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 at has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          at: function(pos, weight, group) {
                      
                              var w = weight || 0;
                      
                              var elements = this.innerEl.childNodes;
                      Severity: Minor
                      Found in js/core/layout.js - About 25 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