talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

    setYTicks: function(iStartY, iTickSize) {
        this.yTicks = [];
        this.yTickSize = iTickSize;

        var tickMap = {};
Severity: Major
Found in app/assets/javascripts/ext/src/dd/DDCore.js and 1 other location - About 1 day to fix
app/assets/javascripts/ext/src/dd/DDCore.js on lines 984..1005

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 234.

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

    setXTicks: function(iStartX, iTickSize) {
        this.xTicks = [];
        this.xTickSize = iTickSize;

        var tickMap = {};
Severity: Major
Found in app/assets/javascripts/ext/src/dd/DDCore.js and 1 other location - About 1 day to fix
app/assets/javascripts/ext/src/dd/DDCore.js on lines 1013..1034

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 234.

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

File EventManager.js has 577 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Ext JS Library 3.3.0
 * Copyright(c) 2006-2010 Ext JS, Inc.
 * licensing@extjs.com
 * http://www.extjs.com/license
Severity: Major
Found in app/assets/javascripts/ext/src/ext-core/src/core/EventManager.js - About 1 day to fix

    File TabPanel.js has 575 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Ext JS Library 3.3.0
     * Copyright(c) 2006-2010 Ext JS, Inc.
     * licensing@extjs.com
     * http://www.extjs.com/license
    Severity: Major
    Found in app/assets/javascripts/ext/src/widgets/TabPanel.js - About 1 day to fix

      Function onRender has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
      Open

          onRender : function(ct, position){
              if(!this.el){
                  var panelCfg = {
                      autoEl: {
                          id: this.id
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/form/CheckboxGroup.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

      File Component.js has 572 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*!
       * Ext JS Library 3.3.0
       * Copyright(c) 2006-2010 Ext JS, Inc.
       * licensing@extjs.com
       * http://www.extjs.com/license
      Severity: Major
      Found in app/assets/javascripts/ext/src/widgets/Component.js - About 1 day to fix

        Function constructor has 243 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          constructor: function(config){
            Talho.FindPeople.superclass.constructor.call(this, config);
        
            this.admin_mode = config.admin_mode;
            this.rolesStore = new Ext.data.JsonStore({
        Severity: Major
        Found in app/assets/javascripts/search/FindPeople.js - About 1 day to fix

          Function Api has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
          Open

          Ext.data.Api = (function() {
          
              // private validActions.  validActions is essentially an inverted hash of Ext.data.Api.actions, where value becomes the key.
              // Some methods in this singleton (e.g.: getActions, getVerb) will loop through actions with the code <code>for (var verb in this.actions)</code>
              // For efficiency, some methods will first check this hash for a match.  Those methods which do acces validActions will cache their result here.
          Severity: Minor
          Found in app/assets/javascripts/ext/src/data/Api.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 initComponent has 239 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            initComponent : function() {
              this.setTitle('Forum: ' + this.forumName);
                  
              var forumStore = new Ext.data.JsonStore({
                  url: String.format('/forums/{0}.json',this.forumId),
          Severity: Major
          Found in app/assets/javascripts/forums/view/topics/Index.js - About 1 day to fix

            Function calculateChildBoxes has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
            Open

                calculateChildBoxes: function(visibleItems, targetSize) {
                    var visibleCount = visibleItems.length,
            
                        padding      = this.padding,
                        topOffset    = padding.top,
            Severity: Minor
            Found in app/assets/javascripts/ext/src/widgets/layout/VBoxLayout.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 getTargetXY has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
            Open

                getTargetXY : function(){
                    if(this.delegate){
                        this.anchorTarget = this.triggerElement;
                    }
                    if(this.anchor){
            Severity: Minor
            Found in app/assets/javascripts/ext/src/widgets/tips/ToolTip.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 calculateChildBoxes has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
            Open

                calculateChildBoxes: function(visibleItems, targetSize) {
                    var visibleCount = visibleItems.length,
            
                        padding      = this.padding,
                        topOffset    = padding.top,
            Severity: Minor
            Found in app/assets/javascripts/ext/src/widgets/layout/HBoxLayout.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

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

                    var visibleCount = visibleItems.length,
            
                        padding      = this.padding,
                        topOffset    = padding.top,
                        leftOffset   = padding.left,
            Severity: Major
            Found in app/assets/javascripts/ext/src/widgets/layout/HBoxLayout.js and 1 other location - About 1 day to fix
            app/assets/javascripts/ext/src/widgets/layout/VBoxLayout.js on lines 66..93

            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 220.

            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

                    var visibleCount = visibleItems.length,
            
                        padding      = this.padding,
                        topOffset    = padding.top,
                        leftOffset   = padding.left,
            Severity: Major
            Found in app/assets/javascripts/ext/src/widgets/layout/VBoxLayout.js and 1 other location - About 1 day to fix
            app/assets/javascripts/ext/src/widgets/layout/HBoxLayout.js on lines 65..92

            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 220.

            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

            File dominoes-1.0-rc2.js has 549 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * Dominoes v.1.0 (rc2) [2/3/10 01:04:06.934 - CET]
             * Copyright 2010, Julian Aubourg
             * Dual licensed under the MIT and GPL Version 2 licenses
             */
            Severity: Major
            Found in app/assets/javascripts/lib/dominoes-1.0-rc2.js - About 1 day to fix

              Method xml_build_behavior has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
              Open

                def xml_build_behavior builder, options={}
                  options={ :Delivery => {:Providers => {} } } if options.blank?
                  builder.Behavior do |behavior|
                    if options[:override]
                      options[:override].call(behavior)
              Severity: Minor
              Found in app/models/alert.rb - 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 constructor has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
              Open

                  constructor: function(cfg) {
                      var me = this,
                          items = cfg.items || (me.items = [me]),
                          l = items.length,
                          i,
              Severity: Minor
              Found in app/assets/javascripts/ext_extensions/xActionColumn.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 constructor has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
              Open

                  constructor: function(el, config){
                      this.el = Ext.get(el);
                      if(config && config.wrap){
                          config.resizeChild = this.el;
                          this.el = this.el.wrap(typeof config.wrap == 'object' ? config.wrap : {cls:'xresizable-wrap'});
              Severity: Minor
              Found in app/assets/javascripts/ext/src/widgets/Resizable.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

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

                    listeners: {
                      'click': { 
                        fn:  function(div, index, node, e) {
                          if (node.classList.contains('forum-edit')) {            
                            this.fireEvent('editforum', parseInt(node.attributes['forumid'].value), null);        
              Severity: Major
              Found in app/assets/javascripts/forums/view/forums/Index.js and 1 other location - About 1 day to fix
              app/assets/javascripts/forums/view/topics/Index.js on lines 85..101

              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 206.

              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

                    listeners: {
                      'click': { 
                        fn:  function(div, index, node, e) {
                          if (node.classList.contains('forum-edit')) {            
                            this.fireEvent('editforum', parseInt(node.attributes['forumid'].value), null);        
              Severity: Major
              Found in app/assets/javascripts/forums/view/topics/Index.js and 1 other location - About 1 day to fix
              app/assets/javascripts/forums/view/forums/Index.js on lines 94..110

              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 206.

              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