talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

    this.dv = new Ext.DataView(
      {name: 'user[devices]', store: this.store, tpl: template, emptyText: 'No devices to display', deferEmptyText: false,
        multiSelect: false, singleSelect: false, itemSelector: 'li.device-item', selectedClass: 'device-selected'}
    );
Severity: Major
Found in app/assets/javascripts/profile/DevicesControl.js and 1 other location - About 1 hr to fix
app/assets/javascripts/profile/OrganizationsControl.js on lines 109..112

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

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

        }else{

            if(!s.animate){
                s.resizingEl.setHeight(newSize);
                if(onComplete){
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/SplitBar.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ext/src/widgets/SplitBar.js on lines 328..337

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

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

  def get_text_response(resp, message_hash)
    unless resp.ref.blank?
      if message_hash[resp.ref]
        return message_hash[resp.ref][:value] if message_hash[resp.ref][:value]
        return message.Messages.select{|m| m.name == message_hash[resp.ref][:ref]}.first.Value unless message_hash[resp.ref][:ref].blank? # check for blank as m.name will never be blank
Severity: Major
Found in app/models/service/talho/email/message.rb and 1 other location - About 1 hr to fix
app/models/service/talho/console/message.rb on lines 69..80

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

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

  def get_text_response(resp, message_hash)
    unless resp.ref.blank?
      if message_hash[resp.ref]
        return message_hash[resp.ref][:value] if message_hash[resp.ref][:value]
        return message.Messages.select{|m| m.name == message_hash[resp.ref][:ref]}.first.Value unless message_hash[resp.ref][:ref].blank? # check for blank as m.name will never be blank
Severity: Major
Found in app/models/service/talho/console/message.rb and 1 other location - About 1 hr to fix
app/models/service/talho/email/message.rb on lines 95..106

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

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 c has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        c: function() {
            var calc = [],
                arr = [
                    $f("Y", 1), // year
                    $f("m", 2), // month
Severity: Minor
Found in app/assets/javascripts/ext/src/util/Date.js - About 1 hr to fix

    Function readRecords has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        readRecords : function(o){
            this.arrayData = o;
            var s = this.meta,
                sid = s ? Ext.num(s.idIndex, s.id) : null,
                recordType = this.recordType,
    Severity: Minor
    Found in app/assets/javascripts/ext/src/data/ArrayReader.js - About 1 hr to fix

      Function setSize has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          setSize : function(w, h){
      
              // support for standard size objects
              if(typeof w == 'object'){
                  h = w.height;
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/BoxComponent.js - About 1 hr to fix

        Function createHtml has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function createHtml(o){
                var b = '',
                    attr,
                    val,
                    key,
        Severity: Minor
        Found in app/assets/javascripts/ext/src/ext-core/src/core/DomHelper.js - About 1 hr to fix

          Function onRender has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              onRender: function(){
                  Ext.ux.NavigableTabPanel.superclass.onRender.apply(this, arguments);
          
                  var st = this[this.stripTarget];
                  st.addClass('ux-navigable-tab-panel-header');
          Severity: Minor
          Found in app/assets/javascripts/ext_extensions/NavigableTabPanel.js - About 1 hr to fix

            Function attr has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                attr: function( elem, name, value ) {
                    // don't set attributes on text and comment nodes
                    if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
                        return undefined;
            
            
            Severity: Minor
            Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 1 hr to fix

              Function constructor has 42 lines of code (exceeds 25 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 hr to fix

                Function bindReady has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function bindReady(){
                    if ( readyBound ) return;
                    readyBound = true;
                
                    // Mozilla, Opera (see further below for it) and webkit nightlies currently support this event
                Severity: Minor
                Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 1 hr to fix

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

                      constructor: function(config){
                           var rowActions = new Ext.ux.grid.RowActions({
                             actions: [
                                 {iconCls: 'removeBtn', qtip: 'delete', cb: function(grid, record, action, index, colIndex){
                                     if(confirm("Are you sure you wish to remove " + record.get('tab_config').title + "?"))
                  Severity: Minor
                  Found in app/assets/javascripts/dashboard/manage_favorites_window.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                                } else if ( m[1] == ":" && m[2] == "nth-child" ) {
                                    var merge = {}, tmp = [],
                                        // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
                                        test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
                                            m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
                    Severity: Critical
                    Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js - About 1 hr to fix

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

                      Talho.ScriptManager.reg('Talho.Admin.Organizations', Talho.Admin.Organizations.Controller, function(config){
                        var cont = new Talho.Admin.Organizations.Controller(config);
                        return cont.getPanel();
                      });
                      Severity: Major
                      Found in app/assets/javascripts/admin/organizations/Controller.js and 3 other locations - About 1 hr to fix
                      app/assets/javascripts/admin/apps/Controller.js on lines 68..71
                      app/assets/javascripts/admin/organization_membership_requests/Controller.js on lines 22..25
                      app/assets/javascripts/dashboard/apps/Controller.js on lines 41..44

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

                      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

                          fx: function( elem, options, prop ){
                              this.options = options;
                              this.elem = elem;
                              this.prop = prop;
                      
                      
                      Severity: Major
                      Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js and 1 other location - About 1 hr to fix
                      app/assets/javascripts/jquery.js on lines 4002..4009

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

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

                      Talho.ScriptManager.reg("Talho.Admin.Apps", Talho.Admin.Apps.Controller, function(config){
                        var cont = new Talho.Admin.Apps.Controller(config);
                        return cont.getPanel();
                      });
                      Severity: Major
                      Found in app/assets/javascripts/admin/apps/Controller.js and 3 other locations - About 1 hr to fix
                      app/assets/javascripts/admin/organization_membership_requests/Controller.js on lines 22..25
                      app/assets/javascripts/admin/organizations/Controller.js on lines 75..78
                      app/assets/javascripts/dashboard/apps/Controller.js on lines 41..44

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

                      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

                          adjustBodyWidth : function(w){
                              if(this.header){
                                  this.header.setWidth(w);
                              }
                              if(this.footer){
                      app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 779..787

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

                      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

                      jQuery.nth = function(cur, result, dir, elem){
                          result = result || 1;
                          var num = 0;
                      
                          for ( ; cur; cur = cur[dir] )
                      Severity: Major
                      Found in app/assets/javascripts/jquery.js and 1 other location - About 1 hr to fix
                      app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 1772..1781

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

                      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

                          fx: function( elem, options, prop ){
                              this.options = options;
                              this.elem = elem;
                              this.prop = prop;
                      
                      
                      Severity: Major
                      Found in app/assets/javascripts/jquery.js and 1 other location - About 1 hr to fix
                      app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 3111..3118

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

                      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