eliace/ergo-js

View on GitHub

Showing 167 of 296 total issues

Function open has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

        open: function(position) {

            var popups = Ergo.context._popups;

            // в эксклюзивном режиме закрываем другие всплывающие виджеты
Severity: Minor
Found in js/includes/popup.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 _construct has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    _construct: function(o) {

        var _w = this;

        this.navigator = {
Severity: Minor
Found in js/includes/list-navigator.js - About 3 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 add has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    add: function(item, i, type) {

//        console.log('add item');

//        var key;
Severity: Minor
Found in js/core/widget-list.js - About 3 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 bind has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    bind: function(data, update, pivot) {

        var o = this.options;
        var self = this;
        var w = this;
Severity: Major
Found in js/core/widget-data.js - About 3 hrs to fix

    Function addBefore has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        addBefore: function(item, otherItem, w, group) {
    
            var o = this.options;
    
            var itemEl = item.dom.outerEl;
    Severity: Minor
    Found in js/core/layout.js - About 3 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

    `` has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Ergo.defineClass('Ergo.core.Widget', /** @lends Ergo.core.Widget.prototype */{
    
        extends: 'Ergo.core.Object',
    
        mixins: ['observable', 'statable'],
    Severity: Minor
    Found in js/core/widget.js - About 3 hrs to fix

      Function open has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              open: function(position) {
      
                  var popups = Ergo.context._popups;
      
                  // в эксклюзивном режиме закрываем другие всплывающие виджеты
      Severity: Major
      Found in js/includes/popup.js - About 3 hrs to fix

        Function sync has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            sync: function(newData) {
        
                var self = this;
        
                var valueUid = (this.options.valueUid || this._valueUid);
        Severity: Major
        Found in js/core/data.js - About 3 hrs to fix

          Function _construct has 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _construct: function(o) {
                  this._super(o);
          
          
                  var grid = this;
          Severity: Major
          Found in js/widgets/grids/table-grid.js - About 3 hrs to fix

            Function set has 82 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                set: function(to, data) {
            
                    if(!to || (typeof to !== 'string')) {
                        console.warn('State key ['+$ergo.print(to)+'] must be of type string');
                        return false;
            Severity: Major
            Found in js/core/states.js - About 3 hrs to fix

              File states.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              
              //= require events
              
              
              
              Severity: Minor
              Found in js/core/states.js - About 3 hrs to fix

                Function _construct has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    _construct: function(o) {
                        this._super(o);
                
                
                        this._scopes = {};
                Severity: Minor
                Found in js/core/context.js - About 3 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 _construct has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _construct: function(o) {
                        this._super(o);
                
                
                        var w = this;
                Severity: Major
                Found in js/widgets/basic/table.js - About 3 hrs to fix

                  File core-utils.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  
                  
                  
                  
                  (function(){
                  Severity: Minor
                  Found in js/core/core-utils.js - About 3 hrs to fix

                    Function addAfter has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        addAfter: function(item, otherItem, w, group) {
                    
                            var o = this.options;
                    
                            var itemEl = item.dom.outerEl;
                    Severity: Major
                    Found in js/core/layout.js - About 3 hrs to fix

                      `` has 26 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      Ergo.defineClass('Ergo.core.Components', /** @lends Ergo.core.Components.prototype */ {
                      
                          extends: 'Ergo.core.Array',
                      
                      //     defaults: {
                      Severity: Minor
                      Found in js/core/widget-list.js - About 3 hrs to fix

                        `` has 25 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        $ergo.merge(Ergo.core.Collection.prototype, /** @lends Ergo.core.Collection.prototype */{
                        // Ergo.core.Collection = Ergo.defineClass('Ergo.core.Collection', 'Ergo.core.Object', /** @lends Ergo.core.Collection.prototype */{
                        //
                        //     defaults: {
                        // //        plugins: [Ergo.Observable]
                        Severity: Minor
                        Found in js/core/collection.js - About 2 hrs to fix

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

                              _destroy: function(root) {
                                  Ergo.core.Widget.superclass._destroy.call(this);
                          
                                  var self = this;
                          
                          
                          Severity: Minor
                          Found in js/core/widget.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 addBefore has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              addBefore: function(item, otherItem, w, group) {
                          
                                  var o = this.options;
                          
                                  var itemEl = item.dom.outerEl;
                          Severity: Major
                          Found in js/core/layout.js - About 2 hrs to fix

                            File widget-list.js has 279 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            
                            //= require array
                            
                            
                            
                            
                            Severity: Minor
                            Found in js/core/widget-list.js - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language