eliace/ergo-js

View on GitHub

Showing 167 of 296 total issues

Avoid deeply nested control flow statements.
Open

                        if(disorder[0] == -1) {
                            disorder[1] = j;
                        }
Severity: Major
Found in js/core/core-utils.js - About 45 mins to fix

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

      _initialize: function (opts) {//}, scope) {
    
        var o = {
        };
    
    
    Severity: Minor
    Found in js/core/object.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

    Avoid deeply nested control flow statements.
    Open

                    else if( a && b && b.constructor == Object ) {
                        $ergo.deepMerge(o[name], b);
                    }
                    else {
                        o[name] = $ergo.deepCopy(b);
    Severity: Major
    Found in js/core/core-def.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if( this._groups[i][stt] ) {
                                  g = i;
                                  break;
                              }
      Severity: Major
      Found in js/core/states.js - About 45 mins to fix

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

          _construct: function(o) {
        
            if(o.provider) {
        
              var provider = o.provider;
        Severity: Minor
        Found in js/includes/provider-methods.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

        Avoid deeply nested control flow statements.
        Open

                                if( typeof callback == 'string' ) {
                                    var a = callback.split(':');
        //                            callback = (a.length == 1) ? this[callback].bind(this, null) : this[a[0]]/*.rcurry(a[1])*/.bind(this, a[1]);
                                    // action
                                    var action = $ergo.alias('actions:'+a[0]) || this[a[0]];
        Severity: Major
        Found in js/core/events.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if(index != _item._index+1) {
                                      n_upd++;
          //                            _item.unrender()
                                      this.items.remove(_item);
                                      this.items.add(_item, index);
          Severity: Major
          Found in js/core/widget-data.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if( !o[name] ) {
                                    o[name] = b;
                                }
                                else if(j[0] == '!') {
                                    // переписываем опцию
            Severity: Major
            Found in js/core/core-def.js - About 45 mins to fix

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

                  createWidgets: function() {
              
                      // рендерим виджеты скоупа (включаем виджеты в скоуп)
                      for(var i in this.widgets) {
              
              
              Severity: Minor
              Found in js/core/scope.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 ergo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              $.fn.ergo = function(o) {
                  if(this.length > 0){
                      var widget = (this[0]._dom) ? this[0]._dom._widget : undefined;// this.data('ergo-widget');
                      if(widget) return widget;
                      if(!o) return undefined;
              Severity: Minor
              Found in js/core/widget.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

              Avoid deeply nested control flow statements.
              Open

                                          if( index <= item.data._id[0] ) {
                                              return true;
                                          }
              Severity: Major
              Found in js/core/widget-data.js - About 45 mins to fix

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

                        show: function() {
                
                            var effect = false;
                
                //            if( !this.children.isEmpty() || this.el.text() ) {  // ?
                Severity: Minor
                Found in js/includes/effects.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

                Avoid deeply nested control flow statements.
                Open

                                        if( action ==  null ) {
                                            //TODO missed action
                                            callback = this._missedAction.bind(this, callback);
                                        }
                                        else {
                Severity: Major
                Found in js/core/events.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if(!(i in o) || (o[i] && o[i].constructor != Object)) o[i] = {};
                  Severity: Major
                  Found in js/core/core-def.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if( _item ) {
                                                _item._destroy();
                                                _item = null;
                                            }
                    Severity: Major
                    Found in js/core/widget-data.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          else if( p && p.constructor == Array ) {//$.isArray(p) ){
                              //                if(!(i in o) || !$.isArray(o[i])) o[i] = [];
                                              if(!(i in o) || (o[i] && o[i].constructor != Array)) o[i] = [];
                                              Ergo.deepMerge(o[i], p);
                                          }
                      Severity: Major
                      Found in js/core/core-def.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                for(var i = 0; i < this._id.length; i++) {
                                                    var key = this._id[i];
                                                    if(key in v)
                                                        src[key] = v[key];
                                                }
                        Severity: Major
                        Found in js/core/data.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if(e)
                                                      e._id[0] = j
                          Severity: Major
                          Found in js/core/data.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    for(var i = 0; i < this._id.length; i++)
                                                        mv[this._id[i]] = v[this._id[i]];
                            Severity: Major
                            Found in js/core/data.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      for(var i = 0; i < this._id.length; i++) {
                                                          var key = this._id[i];
                                                          if(key in v)
                                                              src[key] = v[key];
                                                      }
                              Severity: Major
                              Found in js/core/data.js - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language