talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

  grab_data: function(){
    this.store.clearFilter();
    var rq = jQuery.map(this.store.getRange(), function(e,i){ return e.data; });
    this.store.filterBy(function(e){ return e.get("state")!="deleted"; });
    return Ext.encode(rq);
Severity: Major
Found in app/assets/javascripts/profile/OrganizationsControl.js and 2 other locations - About 3 hrs to fix
app/assets/javascripts/profile/DevicesControl.js on lines 70..75
app/assets/javascripts/profile/RolesControl.js on lines 89..94

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

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

  grab_data: function(){
    this.store.clearFilter();
    var rq = jQuery.map(this.store.getRange(), function(e,i){ return e.data; });
    this.store.filterBy(function(e){ return e.get("state")!="deleted"; });
    return Ext.encode(rq);
Severity: Major
Found in app/assets/javascripts/profile/RolesControl.js and 2 other locations - About 3 hrs to fix
app/assets/javascripts/profile/DevicesControl.js on lines 70..75
app/assets/javascripts/profile/OrganizationsControl.js on lines 68..73

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

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

RowSelectionModel has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

Ext.grid.RowSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel,  {
    /**
     * @cfg {Boolean} singleSelect
     * <tt>true</tt> to allow selection of only one row at a time (defaults to <tt>false</tt>
     * allowing multiple selections)
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/grid/RowSelectionModel.js - About 3 hrs to fix

    Menu has 31 functions (exceeds 20 allowed). Consider refactoring.
    Open

    Ext.menu.Menu = Ext.extend(Ext.Container, {
        /**
         * @cfg {Object} defaults
         * A config object that will be applied to all items added to this container either via the {@link #items}
         * config or via the {@link #add} method.  The defaults config can contain any number of
    Severity: Minor
    Found in app/assets/javascripts/ext/src/widgets/menu/Menu.js - About 3 hrs to fix

      RowEditor has 31 functions (exceeds 20 allowed). Consider refactoring.
      Open

      Ext.ux.grid.RowEditor = Ext.extend(Ext.Panel, {
          floating: true,
          shadow: false,
          layout: 'hbox',
          cls: 'x-small-editor',
      Severity: Minor
      Found in app/assets/javascripts/ext_extensions/RowEditor.js - About 3 hrs to fix

        File Element.style.js has 326 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: Minor
        Found in app/assets/javascripts/ext/src/ext-core/src/core/Element.style.js - About 3 hrs to fix

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

            _destroy_handler: function(dv,index,node,e){
              var elem = Ext.get(e.getTarget());
              if (elem.hasClass("profile-destroy")) {
                this.store.getAt(index).set("state", "deleted");
                this.store.filterBy(function(e){ return e.get("state")!="deleted"; });
          Severity: Major
          Found in app/assets/javascripts/profile/RolesControl.js and 2 other locations - About 3 hrs to fix
          app/assets/javascripts/profile/DevicesControl.js on lines 119..125
          app/assets/javascripts/profile/OrganizationsControl.js on lines 126..132

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

          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

                              this._fileControls.applySectionDetails('folder_detail_container', {
                                  'name': sel.get('name'),
                                  'image': Talho.ux.Documents.mimeToImageClass('folder'),
                                  'created_at': Ext.util.Format.date(sel.get('created_at'), 'n/j/y h:i A'),
                                  'updated_at': Ext.util.Format.date(sel.get('updated_at'), 'n/j/y h:i A')
          Severity: Major
          Found in app/assets/javascripts/documents/Documents.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/documents/Documents.js on lines 429..434

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

          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 3 locations. Consider refactoring.
          Open

            _destroy_handler: function(dv,index,node,e){
              var elem = Ext.get(e.getTarget());
              if (elem.hasClass("profile-destroy")) {
                this.store.getAt(index).set("state", "deleted");
                this.store.filterBy(function(e){ return e.get("state")!="deleted"; });
          Severity: Major
          Found in app/assets/javascripts/profile/OrganizationsControl.js and 2 other locations - About 3 hrs to fix
          app/assets/javascripts/profile/DevicesControl.js on lines 119..125
          app/assets/javascripts/profile/RolesControl.js on lines 157..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 111.

          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

                              this._fileControls.applySectionDetails('folder_detail_container', {
                                  'name': sel.get('name'),
                                  'image': Talho.ux.Documents.mimeToImageClass('folder'),
                                  'created_at': Ext.util.Format.date(sel.get('created_at'), 'n/j/y h:i A'),
                                  'updated_at': Ext.util.Format.date(sel.get('updated_at'), 'n/j/y h:i A')
          Severity: Major
          Found in app/assets/javascripts/documents/Documents.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/documents/Documents.js on lines 416..421

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

          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

          Ext.grid.PivotAggregatorMgr.registerType('max', function(records, measure) {
              var data   = [],
                  length = records.length,
                  i;
              
          Severity: Major
          Found in app/assets/javascripts/ext/src/widgets/grid/PivotGrid.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/ext/src/widgets/grid/PivotGrid.js on lines 363..373

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

          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 3 locations. Consider refactoring.
          Open

            _destroy_handler: function(dv,index,node,e){
              var elem = Ext.get(e.getTarget());
              if (elem.hasClass("profile-destroy")) {
                this.store.getAt(index).set("state", "deleted");
                this.store.filterBy(function(e){ return e.get("state")!="deleted"; });
          Severity: Major
          Found in app/assets/javascripts/profile/DevicesControl.js and 2 other locations - About 3 hrs to fix
          app/assets/javascripts/profile/OrganizationsControl.js on lines 126..132
          app/assets/javascripts/profile/RolesControl.js on lines 157..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 111.

          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

          Ext.grid.PivotAggregatorMgr.registerType('min', function(records, measure) {
              var data   = [],
                  length = records.length,
                  i;
              
          Severity: Major
          Found in app/assets/javascripts/ext/src/widgets/grid/PivotGrid.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/ext/src/widgets/grid/PivotGrid.js on lines 375..385

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

          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

          Function Ajax has 94 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Ext.lib.Ajax = function(){
              var createSuccess = function(cb){
                   return cb.success ? function(xhr){
                      cb.success.call(cb.scope||window, createResponse(cb, xhr));
                   } : Ext.emptyFn;
          Severity: Major
          Found in app/assets/javascripts/ext/src/adapter/prototype-bridge.js - About 3 hrs to fix

            Function Ajax has 94 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Ext.lib.Ajax = function(){
                var createSuccess = function(cb){
                     return cb.success ? function(xhr){
                        cb.success.call(cb.scope||window, createResponse(cb, xhr));
                     } : Ext.emptyFn;

              Function selectPath has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

                  selectPath : function(path, attr, callback){
                      if(Ext.isEmpty(path)){
                          if(callback){
                              callback(false, undefined);
                          }
              Severity: Minor
              Found in app/assets/javascripts/ext/src/widgets/tree/TreePanel.js - About 3 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 ButtonToggleMgr has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

              Ext.ButtonToggleMgr = function(){
                 var groups = {};
              
                 function toggleGroup(btn, state){
                     if(state){
              Severity: Minor
              Found in app/assets/javascripts/ext/src/widgets/Button.js - About 3 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 autoScrollTabs has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

                  autoScrollTabs : function(){
                      this.pos = this.tabPosition=='bottom' ? this.footer : this.header;
                      var count = this.items.length,
                          ow = this.pos.dom.offsetWidth,
                          tw = this.pos.dom.clientWidth - 80,
              Severity: Minor
              Found in app/assets/javascripts/ext_extensions/NavigableTabPanel.js - About 3 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

              Method add_sender has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

                def add_sender(xml)
                  xml.swn(:sender) do
                    xml.swn(:introName, message.Author.display_name) unless message.Author.blank?
                    if message.Behavior && message.Behavior.Delivery && message.Behavior.Delivery.Providers
                      provider = message.Behavior.Delivery.Providers.select{|p| p.name == "swn"}
              Severity: Minor
              Found in app/models/service/swn/fax/message.rb - About 3 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

              Method add_sender has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

                def add_sender(xml)
                  xml.swn(:sender) do
                    xml.swn(:introName, message.Author.display_name) unless message.Author.blank?
                    if message.Behavior && message.Behavior.Delivery && message.Behavior.Delivery.Providers
                      provider = message.Behavior.Delivery.Providers.select{|p| p.name == "swn"}
              Severity: Minor
              Found in app/models/service/swn/phone/message.rb - About 3 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