eliace/ergo-js

View on GitHub

Showing 296 of 296 total issues

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              if(provider) {
      
                  var data = composer.call(this, this.get(), 'update');
      
                  return provider.update(this, data, this.options.query).then(function(data) {
      Severity: Major
      Found in js/data/collection.js and 1 other location - About 3 hrs to fix
      js/data/object.js on lines 154..163

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 96.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                  if(oid == null) {
      
                      var data = composer.call(this, this.get(), 'create');
      
                      return provider.create(this, data, this.options.query)
      Severity: Major
      Found in js/data/object.js and 1 other location - About 3 hrs to fix
      js/data/collection.js on lines 203..212

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 96.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      `` 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

        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

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          Ergo.alias('includes:icon:at-right', {
          
              defaults:{
                  as: 'has-icon at-right',
                  components: {
          Severity: Major
          Found in js/widgets/mixins/icon.js and 2 other locations - About 3 hrs to fix
          js/widgets/mixins/icon.js on lines 132..153
          js/widgets/mixins/icon.js on lines 183..204

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 95.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          Ergo.alias('includes:xicon:at-right', {
          
              defaults:{
                  as: 'has-icon at-right',
                  components: {
          Severity: Major
          Found in js/widgets/mixins/icon.js and 2 other locations - About 3 hrs to fix
          js/widgets/mixins/icon.js on lines 132..153
          js/widgets/mixins/icon.js on lines 158..179

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 95.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          Ergo.alias('includes:xicon:after', {
          
              defaults:{
                  components: {
                      xicon: {
          Severity: Major
          Found in js/widgets/mixins/icon.js and 1 other location - About 3 hrs to fix
          js/widgets/mixins/icon.js on lines 78..99

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 95.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          Ergo.alias('includes:icon:at-left', {
          
              defaults:{
                  as: 'has-icon at-left',
                  components: {
          Severity: Major
          Found in js/widgets/mixins/icon.js and 2 other locations - About 3 hrs to fix
          js/widgets/mixins/icon.js on lines 158..179
          js/widgets/mixins/icon.js on lines 183..204

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 95.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          Ergo.alias('includes:icon:after', {
          
              defaults:{
                  components: {
                      icon: {
          Severity: Major
          Found in js/widgets/mixins/icon.js and 1 other location - About 3 hrs to fix
          js/widgets/mixins/icon.js on lines 104..125

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 95.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                      else if( item.options.col > (elements[elements.length-1]._col || 0) ) {
                          _el = $('<div class="col '+item.options.col+'"/>')[0];
                          _el._col = item.options.col;
                          item.dom.targetKey = item.options.col;
                          this.el.appendChild(_el);
          Severity: Major
          Found in js/layouts/column.js and 1 other location - About 2 hrs to fix
          js/layouts/column.js on lines 16..43

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                      if(elements.length == 0) {
                          _el = $('<div class="col '+item.options.col+'"/>')[0];
                          _el._col = item.options.col;
                          item.dom.targetKey = item.options.col;
                          this.el.appendChild(_el);
          Severity: Major
          Found in js/layouts/column.js and 1 other location - About 2 hrs to fix
          js/layouts/column.js on lines 22..43

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 92.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          `` 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

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                    if('include' in o) {
                //      this._includes = o.include.join(' ').split(' ').uniq();
                
                      for(var i = 0; i < this._includes.length; i++) {
                        var inc = Ergo._aliases['includes:'+this._includes[i]];
                Severity: Major
                Found in js/core/object.js and 2 other locations - About 2 hrs to fix
                js/core/object.js on lines 218..225
                js/core/object.js on lines 243..250

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 88.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                    if(this._includes) {
                //      var mods = o.mods.join(' ').split(' ').uniq();
                      for(var i = 0; i < this._includes.length; i++) {
                        var inc = Ergo._aliases['includes:'+this._includes[i]];
                        if(inc._construct)
                Severity: Major
                Found in js/core/object.js and 2 other locations - About 2 hrs to fix
                js/core/object.js on lines 187..195
                js/core/object.js on lines 243..250

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 88.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                    if(this._includes) {
                //      var mods = o.mods.join(' ').split(' ').uniq();
                      for(var i = 0; i < this._includes.length; i++) {
                        var inc = Ergo._aliases['includes:'+this._includes[i]];
                        if(inc._postConstruct)
                Severity: Major
                Found in js/core/object.js and 2 other locations - About 2 hrs to fix
                js/core/object.js on lines 187..195
                js/core/object.js on lines 218..225

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 88.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language