eliace/ergo-js

View on GitHub

Showing 167 of 296 total issues

Function _preConstruct has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    _preConstruct: function(o) {
        Ergo.core.Widget.superclass._preConstruct.call(this, o);
//        this._super(o);


Severity: Minor
Found in js/core/widget.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 setStyle has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    setStyle: function(k, v) {
        if(arguments.length == 2) {
            v = (typeof v === 'number') ? $ergo.dom.numberStyleToPx(k, v) : v;
            this.el.style[k] = v;
        }
Severity: Minor
Found in js/core/dom.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 add has 46 lines of code (exceeds 25 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 1 hr to fix

    Function extend has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        E.extend = function(p_ctor, ctor, overrides) {
    
            var c = ctor;
    
            if(typeof c == 'object') {
    Severity: Minor
    Found in js/core/core-classes.js - About 1 hr to fix

      Function _bindStates has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          _bindStates: function() {
              var o = this.options;
      
              if('states' in o){
                  for(var i in o.states) {
      Severity: Minor
      Found in js/core/states.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 fire has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          fire: function(type, _event, baseEvent) {
      
              // "ленивая" генерация базового события
              // var _event = {
              //     base: baseEvent,
      Severity: Minor
      Found in js/core/events.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 _groupElements has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          _groupElements: function(group) {
      
              var beforeEl = null;
              var afterEl = null;
      
      Severity: Minor
      Found in js/core/layout.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 _renderDiff has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          _renderDiff: function(created, deleted, updated) {
      
      //        console.log('render diff', arguments);
      
              var o = this.options;
      Severity: Minor
      Found in js/core/widget-render.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 state has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          state: function(name, value) {
      
              if(arguments.length == 1) {
                  return this._current[name];
              }
      Severity: Minor
      Found in js/core/states.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 _dataChanged has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          _dataChanged: function(lazy, cascade, no_dynamic) {
      
      //        this.events.fire('refresh');//, e);
      
              // если отключено каскадирование, то обновление не производим
      Severity: Minor
      Found in js/core/widget-data.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 join has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          join: function(scope_name, params, widget) {
      
              var ctx = this;
      
              var parent = null;
      Severity: Minor
      Found in js/core/context.js - About 1 hr to fix

        Function _initialize has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _initialize: function (opts) {//}, scope) {
        
            var o = {
            };
        
        
        Severity: Minor
        Found in js/core/object.js - About 1 hr to fix

          Function _bindDOM has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              _bindDOM: function() {
          
                  var o = this.options;
          
                  if(o.layout) {
          Severity: Minor
          Found in js/core/widget-render.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 add has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              add: function(value, index) {
          
                  var values = this.get();
          
                  var isLast = false;
          Severity: Minor
          Found in js/core/data.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 prop has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              prop: function(i, v, defaultValue) {
          
                  if(arguments.length == 1 || arguments.length == 3) {
          
                      if( this.options.get && (i in this.options.get) ) {
          Severity: Minor
          Found in js/core/widget.js - About 1 hr to fix

            Function update has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                update: function() {
                    Ergo.layouts.Grid.superclass.update.call(this);
            //        this._super();
            
            
            Severity: Minor
            Found in js/layouts/grid.js - About 1 hr to fix

              Function _renderDiff has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _renderDiff: function(created, deleted, updated) {
              
              //        console.log('render diff', arguments);
              
                      var o = this.options;
              Severity: Minor
              Found in js/core/widget-render.js - About 1 hr to fix

                Function dependencies has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var dependencies = function() {
                
                    var sources = [];
                
                    var MATCH_REGEXP = /^\/\/= require (.*)$/mg;
                Severity: Minor
                Found in gulpfile.js - About 1 hr to fix

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

                    _construct: function(o) {
                  
                      var ctx = this;
                  
                      this._growls = $.ergo(o.growls);
                  Severity: Minor
                  Found in js/widgets/mixins/growls.js - About 1 hr to fix

                    Function _state_on has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                        _state_on: function(s, data) {
                    
                            var self = this;
                            var states = this._states;//this._widget.options.states;
                    
                    Severity: Minor
                    Found in js/core/states.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

                    Severity
                    Category
                    Status
                    Source
                    Language