talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

Ext.applyIf(String, {
    /**
     * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens.  Each
     * token must be unique, and must increment in the format {0}, {1}, etc.  Example usage:
     * <pre><code>
app/assets/javascripts/ext/adapter/ext/ext-base-debug.js on lines 994..1015
app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js on lines 994..1015
app/assets/javascripts/ext/adapter/prototype/ext-prototype-adapter-debug.js on lines 994..1015
app/assets/javascripts/ext/src/ext-core/src/core/Ext.js on lines 994..1015

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

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

Date.monthNumbers = {
  Gen : 0,
  Feb : 1,
  Mar : 2,
  Apr : 3,
Severity: Major
Found in app/assets/javascripts/ext/src/locale/ext-lang-it.js and 21 other locations - About 1 hr to fix
app/assets/javascripts/ext/src/locale/ext-lang-bg.js on lines 55..68
app/assets/javascripts/ext/src/locale/ext-lang-ca.js on lines 48..61
app/assets/javascripts/ext/src/locale/ext-lang-da.js on lines 57..70
app/assets/javascripts/ext/src/locale/ext-lang-el_GR.js on lines 75..88
app/assets/javascripts/ext/src/locale/ext-lang-en.js on lines 52..65
app/assets/javascripts/ext/src/locale/ext-lang-en_GB.js on lines 48..61
app/assets/javascripts/ext/src/locale/ext-lang-es.js on lines 49..62
app/assets/javascripts/ext/src/locale/ext-lang-fa.js on lines 50..63
app/assets/javascripts/ext/src/locale/ext-lang-fi.js on lines 51..64
app/assets/javascripts/ext/src/locale/ext-lang-he.js on lines 53..66
app/assets/javascripts/ext/src/locale/ext-lang-hr.js on lines 57..70
app/assets/javascripts/ext/src/locale/ext-lang-id.js on lines 62..75
app/assets/javascripts/ext/src/locale/ext-lang-lt.js on lines 61..74
app/assets/javascripts/ext/src/locale/ext-lang-nl.js on lines 52..65
app/assets/javascripts/ext/src/locale/ext-lang-no_NB.js on lines 55..68
app/assets/javascripts/ext/src/locale/ext-lang-no_NN.js on lines 55..68
app/assets/javascripts/ext/src/locale/ext-lang-pl.js on lines 55..68
app/assets/javascripts/ext/src/locale/ext-lang-pt_BR.js on lines 59..72
app/assets/javascripts/ext/src/locale/ext-lang-pt_PT.js on lines 50..63
app/assets/javascripts/ext/src/locale/ext-lang-ro.js on lines 55..68
app/assets/javascripts/ext/src/locale/ext-lang-tr.js on lines 59..72

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

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

    setTooltip : function(tip, title){
        this.attributes.qtip = tip;
        this.attributes.qtipTitle = title;
        if(this.rendered){
            this.ui.onTipChange(this, tip, title);
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/tree/TreeNode.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ext/src/widgets/tree/TreeNode.js on lines 322..328

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

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

    getBottom : function(local){
        var me = this;
        return !local ? me.getY() + me.getHeight() : (me.getTop(true) + me.getHeight()) || 0;
    },
app/assets/javascripts/ext/src/ext-core/src/core/Element.position.js on lines 173..176

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

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 (EC[id] && EC[id].el) {
            ex = EC[id].el;
            ex.dom = el;
        } else {
            ex = El.addToCache(new El(el));
Severity: Major
Found in app/assets/javascripts/ext/src/ext-core/src/core/Element.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ext/src/ext-core/src/core/Element.js on lines 782..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 72.

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 (EC[el] && EC[el].el) {
            ex = EC[el].el;
            ex.dom = elm;
        } else {
            ex = El.addToCache(new El(elm));
Severity: Major
Found in app/assets/javascripts/ext/src/ext-core/src/core/Element.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ext/src/ext-core/src/core/Element.js on lines 793..798

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

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

    getRight : function(local){
        var me = this;
        return !local ? me.getX() + me.getWidth() : (me.getLeft(true) + me.getWidth()) || 0;
    },
app/assets/javascripts/ext/src/ext-core/src/core/Element.position.js on lines 192..195

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

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

    setHref : function(href, target){
        this.attributes.href = href;
        this.attributes.hrefTarget = target;
        if(this.rendered){
            this.ui.onHrefChange(this, href, target);
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/tree/TreeNode.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ext/src/widgets/tree/TreeNode.js on lines 298..304

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

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

    val: function( value ) {
        if ( value === undefined ) {            
            var elem = this[0];

            if ( elem ) {
Severity: Minor
Found in app/assets/javascripts/jquery.js - About 1 hr to fix

    Function showExpressInstall has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
            isExpressInstallActive = true;
            storedCallbackFn = callbackFn || null;
            storedCallbackObj = {success:false, id:replaceElemIdStr};
            var obj = getElementById(replaceElemIdStr);
    Severity: Minor
    Found in app/assets/javascripts/ext/src/widgets/chart/swfobject.js - About 1 hr to fix

      Function fitToSize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          fitToSize : function(target) {
              if (this.container.enableOverflow === false) {
                  return;
              }
      
      
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/layout/ToolbarLayout.js - About 1 hr to fix

        Function addTool has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            addTool : function(){
                if(!this.rendered){
                    if(!this.tools){
                        this.tools = [];
                    }
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/Panel.js - About 1 hr to fix

          Function showEditWindow has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            showEditWindow: function(){
              var win = new Ext.Window({
                title: 'Edit Twitter Portlet',
                layout: 'border',
                items: [{ xtype: 'container', region: 'north', layout: 'form', itemId: 'north', height: 80, margins: '5px 5px 0px', items: [
          Severity: Minor
          Found in app/assets/javascripts/dashboard/cms/portlets/twitter.js - About 1 hr to fix

            Method update_it has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def update_it
                dashboard_json = ActiveSupport::JSON.decode(params["dashboards"]) if params["dashboards"]
                dashboard = Dashboard.with_user(current_user).with_roles('publisher', 'editor').find_by_id(params[:id])
                dashboard = Dashboard.find_by_id_and_application_default(params[:id], true) if current_user.is_super_admin? && dashboard.nil?
                
            Severity: Minor
            Found in app/controllers/dashboard_controller.rb - About 1 hr to fix

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

                def add_recipients(xml)
                  xml.swn(:rcpts) do
                    message.Recipients.each do |recipient|
                      xml.swn(:rcpt) do
                        xml.swn(:id, recipient.id)
              Severity: Major
              Found in app/models/service/swn/blackberry/message.rb and 2 other locations - About 1 hr to fix
              app/models/service/swn/fax/message.rb on lines 104..116
              app/models/service/swn/sms/message.rb on lines 105..117

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

              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

                def add_recipients(xml)
                  xml.swn(:rcpts) do
                    message.Recipients.each do |recipient|
                      xml.swn(:rcpt) do
                        xml.swn(:id, recipient.id)
              Severity: Major
              Found in app/models/service/swn/fax/message.rb and 2 other locations - About 1 hr to fix
              app/models/service/swn/blackberry/message.rb on lines 105..117
              app/models/service/swn/sms/message.rb on lines 105..117

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

              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

                def add_recipients(xml)
                  xml.swn(:rcpts) do
                    message.Recipients.each do |recipient|
                      xml.swn(:rcpt) do
                        xml.swn(:id, recipient.id)
              Severity: Major
              Found in app/models/service/swn/sms/message.rb and 2 other locations - About 1 hr to fix
              app/models/service/swn/blackberry/message.rb on lines 105..117
              app/models/service/swn/fax/message.rb on lines 104..116

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

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

                  _fillPermissionsForm: function(){
                      var ap = this.getComponent('tp').getComponent('sh').getComponent('ap');
                      var audience = null;
                      if(!ap.rendered){
                          audience = this.incoming_audience;
              Severity: Minor
              Found in app/assets/javascripts/documents/AddEditFolderWindow.js - About 1 hr to fix

                Function addBinding has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    addBinding : function(config){
                        if(Ext.isArray(config)){
                            Ext.each(config, function(c){
                                this.addBinding(c);
                            }, this);
                Severity: Minor
                Found in app/assets/javascripts/ext/src/util/KeyMap.js - About 1 hr to fix

                  Function fitColumns has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      fitColumns : function(preventRefresh, onlyExpand, omitColumn) {
                          var grid          = this.grid,
                              colModel      = this.cm,
                              totalColWidth = colModel.getTotalWidth(false),
                              gridWidth     = this.getGridInnerWidth(),
                  Severity: Minor
                  Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language