eliace/ergo-js

View on GitHub

Showing 167 of 296 total issues

Function Ergo has a Cognitive Complexity of 163 (exceeds 5 allowed). Consider refactoring.
Open

var Ergo = (function(){

    var E = {};


Severity: Minor
Found in js/core/core-def.js - About 3 days 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 _dataDiff has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
Open

    _dataDiff: function(created, deleted, updated) {

        var o = this.options;

        var filter = o.dynamicFilter ? o.dynamicFilter.bind(this) : null;
Severity: Minor
Found in js/core/widget-data.js - About 1 day 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 _val has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

    _val: function(v) {
//        if('_cached' in this) return this._cached;
//        var v = undefined;

        if(arguments.length == 0) {
Severity: Minor
Found in js/core/data.js - About 1 day 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 59 (exceeds 5 allowed). Consider refactoring.
Open

    _construct: function(opts) {

        var o = opts.selection || {};

        this.selection = {
Severity: Minor
Found in js/includes/selectable.js - About 1 day 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 _bindEvents has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

    _bindEvents: function(targetProperty) {

        var o = this.options;

        var target = targetProperty ? this[targetProperty] : this;
Severity: Minor
Found in js/core/events.js - About 1 day 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 216 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Ergo = (function(){

    var E = {};


Severity: Major
Found in js/core/core-def.js - About 1 day to fix

    Function bind has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
    Open

        bind: function(data, update, pivot) {
    
            var o = this.options;
            var self = this;
            var w = this;
    Severity: Minor
    Found in js/core/widget-data.js - About 6 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 _postConstruct has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

        _postConstruct: function(o) {
    
    
            if('events' in o){
                for(var i in o.events){
    Severity: Minor
    Found in js/core/events.js - About 6 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 145 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _construct: function(opts) {
    
            var o = opts.selection || {};
    
            this.selection = {
    Severity: Major
    Found in js/includes/selectable.js - About 5 hrs to fix

      File data.js has 404 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        Function render has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
        Open

            render: function(target, cascade, beforeItem) {
        
        //        console.log('render');
        
        //    var el = this.el;
        Severity: Minor
        Found in js/core/widget-render.js - About 5 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

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

        
        //= require data
        //= require states
        //= require layout
        //= require widget-opts
        Severity: Minor
        Found in js/core/widget.js - About 5 hrs to fix

          Function set has a Cognitive Complexity of 34 (exceeds 5 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: Minor
          Found in js/core/states.js - About 5 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 sync has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
          Open

              sync: function(newData) {
          
                  var self = this;
          
                  var valueUid = (this.options.valueUid || this._valueUid);
          Severity: Minor
          Found in js/core/data.js - About 5 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

          File layout.js has 369 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          
          //= require dom
          
          
          
          Severity: Minor
          Found in js/core/layout.js - About 4 hrs to fix

            Function del has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
            Open

                del: function(i) {
                    if(arguments.length == 1) {
                        this.entry(i).del();
                    }
                    else {
            Severity: Minor
            Found in js/core/data.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 update has 113 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                update: function() {
            
            
                    // AUTO WIDTH
                    if(this._widget.options.autoWidth){
            Severity: Major
            Found in js/core/layout.js - About 4 hrs to fix

              Function _dataDiff has 111 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _dataDiff: function(created, deleted, updated) {
              
                      var o = this.options;
              
                      var filter = o.dynamicFilter ? o.dynamicFilter.bind(this) : null;
              Severity: Major
              Found in js/core/widget-data.js - About 4 hrs to fix

                Function update has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                Open

                    update: function() {
                
                
                        // AUTO WIDTH
                        if(this._widget.options.autoWidth){
                Severity: Minor
                Found in js/core/layout.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 addAfter has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                Open

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

                Severity
                Category
                Status
                Source
                Language