talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

if(Ext.form.NumberField){
  Ext.apply(Ext.form.NumberField.prototype, {
    decimalSeparator : ",",
    decimalPrecision : 2,
    minText : "El valor mínim per aquest camp és {0}",
Severity: Major
Found in app/assets/javascripts/ext/src/locale/ext-lang-ca.js and 6 other locations - About 1 hr to fix
app/assets/javascripts/ext/src/locale/ext-lang-en.js on lines 156..164
app/assets/javascripts/ext/src/locale/ext-lang-en_GB.js on lines 152..160
app/assets/javascripts/ext/src/locale/ext-lang-es.js on lines 151..159
app/assets/javascripts/ext/src/locale/ext-lang-fr.js on lines 173..181
app/assets/javascripts/ext/src/locale/ext-lang-ja.js on lines 151..159
app/assets/javascripts/ext/src/locale/ext-lang-nl.js on lines 156..164

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

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

if(Ext.form.NumberField){
  Ext.apply(Ext.form.NumberField.prototype, {
    decimalSeparator : ".",
    decimalPrecision : 2,
    minText : "このフィールドの最小値は {0} です。",
Severity: Major
Found in app/assets/javascripts/ext/src/locale/ext-lang-ja.js and 6 other locations - About 1 hr to fix
app/assets/javascripts/ext/src/locale/ext-lang-ca.js on lines 148..156
app/assets/javascripts/ext/src/locale/ext-lang-en.js on lines 156..164
app/assets/javascripts/ext/src/locale/ext-lang-en_GB.js on lines 152..160
app/assets/javascripts/ext/src/locale/ext-lang-es.js on lines 151..159
app/assets/javascripts/ext/src/locale/ext-lang-fr.js on lines 173..181
app/assets/javascripts/ext/src/locale/ext-lang-nl.js on lines 156..164

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

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

if(Ext.form.NumberField){
  Ext.apply(Ext.form.NumberField.prototype, {
    decimalSeparator : ".",
    decimalPrecision : 2,
    minText : "El valor m\u00EDnimo para este campo es de {0}",
Severity: Major
Found in app/assets/javascripts/ext/src/locale/ext-lang-es.js and 6 other locations - About 1 hr to fix
app/assets/javascripts/ext/src/locale/ext-lang-ca.js on lines 148..156
app/assets/javascripts/ext/src/locale/ext-lang-en.js on lines 156..164
app/assets/javascripts/ext/src/locale/ext-lang-en_GB.js on lines 152..160
app/assets/javascripts/ext/src/locale/ext-lang-fr.js on lines 173..181
app/assets/javascripts/ext/src/locale/ext-lang-ja.js on lines 151..159
app/assets/javascripts/ext/src/locale/ext-lang-nl.js on lines 156..164

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

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

if(Ext.form.NumberField){
  Ext.apply(Ext.form.NumberField.prototype, {
    decimalSeparator : ".",
    decimalPrecision : 2,
    minText : "The minimum value for this field is {0}",
Severity: Major
Found in app/assets/javascripts/ext/src/locale/ext-lang-en_GB.js and 6 other locations - About 1 hr to fix
app/assets/javascripts/ext/src/locale/ext-lang-ca.js on lines 148..156
app/assets/javascripts/ext/src/locale/ext-lang-en.js on lines 156..164
app/assets/javascripts/ext/src/locale/ext-lang-es.js on lines 151..159
app/assets/javascripts/ext/src/locale/ext-lang-fr.js on lines 173..181
app/assets/javascripts/ext/src/locale/ext-lang-ja.js on lines 151..159
app/assets/javascripts/ext/src/locale/ext-lang-nl.js on lines 156..164

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

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

if(Ext.form.NumberField){
  Ext.apply(Ext.form.NumberField.prototype, {
    decimalSeparator : ".",
    decimalPrecision : 2,
    minText : "The minimum value for this field is {0}",
Severity: Major
Found in app/assets/javascripts/ext/src/locale/ext-lang-en.js and 6 other locations - About 1 hr to fix
app/assets/javascripts/ext/src/locale/ext-lang-ca.js on lines 148..156
app/assets/javascripts/ext/src/locale/ext-lang-en_GB.js on lines 152..160
app/assets/javascripts/ext/src/locale/ext-lang-es.js on lines 151..159
app/assets/javascripts/ext/src/locale/ext-lang-fr.js on lines 173..181
app/assets/javascripts/ext/src/locale/ext-lang-ja.js on lines 151..159
app/assets/javascripts/ext/src/locale/ext-lang-nl.js on lines 156..164

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

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

            this.dd.setYConstraint(
                this.placement == Ext.SplitBar.TOP ? c1 : c2,
                this.placement == Ext.SplitBar.TOP ? c2 : c1,
                this.tickSize
            );
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 156..160

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

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 ( this[0] == window || this[0] == document )
            return self.pageYOffset ||
                $.boxModel && document.documentElement.scrollTop ||
                document.body.scrollTop;
app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 190..193

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

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

    this.buttons = [
      {text: 'OK', scope: this, handler: this.ok_clicked},
      {text: 'Cancel', scope: this, handler: function(){this.close();} }
    ];
app/assets/javascripts/dashboard/cms/views/open_dashboard_window.js on lines 28..31

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

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

    this.buttons = [
      {text: 'Open', scope: this, handler: this.openDashboard },
      {text: 'Cancel', scope: this, handler: function(){this.close();}}
    ]
app/assets/javascripts/dashboard/cms/views/manage_permissions_window.js on lines 24..27

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

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

            this.dd.setXConstraint(
                this.placement == Ext.SplitBar.LEFT ? c1 : c2,
                this.placement == Ext.SplitBar.LEFT ? c2 : c1,
                this.tickSize
            );
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 165..169

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

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 ( this[0] == window || this[0] == document )
            return self.pageXOffset ||
                $.boxModel && document.documentElement.scrollLeft ||
                document.body.scrollLeft;
app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 232..235

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

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

  initComponent: function(){
    if(!this.items){
      this.items = [];
    }
    this.items.push({xtype: 'grid', itemId: 'grid', cls: 'org-list-grid', header: false, border: true, store: new Ext.data.JsonStore({
Severity: Minor
Found in app/assets/javascripts/admin/organizations/view/Index.js - About 1 hr to fix

    Function CHILD has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            CHILD: function(elem, match){
                var type = match[1], node = elem;
                switch (type) {
                    case 'only':
                    case 'first':
    Severity: Minor
    Found in app/assets/javascripts/jquery.js - About 1 hr to fix

      Function add_role has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        add_role: function(){
          var template = new Ext.XTemplate(
            '<tpl for="."><div ext:qtip="{name}" class="x-combo-list-item">',
              '<tpl if="!leaf"><b></tpl>',
                '<tpl if="level &gt; 0">&nbsp;&nbsp;</tpl>',
      Severity: Minor
      Found in app/assets/javascripts/profile/RolesControl.js - About 1 hr to fix

        Function run has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                run : function(el, args, duration, easing, cb, scope, type){
                    var o = {};
                    for(var k in args){
                        switch(k){   // scriptaculous doesn't support, so convert these
                            case 'points':
        Severity: Minor
        Found in app/assets/javascripts/ext/src/adapter/prototype-bridge.js - About 1 hr to fix

          Function run has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              run : function(){
                  var o = this.options,
                      method = this.getMethod(),
                      isGet = method == 'GET';
                  if(o.clientValidation === false || this.form.isValid()){
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/form/Action.js - About 1 hr to fix

            Function getCollapsedEl has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                getCollapsedEl : function(){
                    if(!this.collapsedEl){
                        if(!this.toolTemplate){
                            var tt = new Ext.Template(
                                 '<div class="x-tool x-tool-{id}">&#160;</div>'
            Severity: Minor
            Found in app/assets/javascripts/ext/src/widgets/layout/BorderLayout.js - About 1 hr to fix

              Function getOffsets has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  getOffsets : function(){
                      var offsets, 
                          ap = this.getAnchorPosition().charAt(0);
                      if(this.anchorToTarget && !this.trackMouse){
                          switch(ap){
              Severity: Minor
              Found in app/assets/javascripts/ext/src/widgets/tips/ToolTip.js - About 1 hr to fix

                Function doEncode has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        doEncode = function(o){
                            if(!Ext.isDefined(o) || o === null){
                                return "null";
                            }else if(Ext.isArray(o)){
                                return encodeArray(o);
                Severity: Minor
                Found in app/assets/javascripts/ext/src/ext-core/src/util/JSON.js - About 1 hr to fix

                  Function run has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          run : function(el, args, duration, easing, cb, scope, type){
                              var o = {};
                              for(var k in args){
                                  switch(k){   // scriptaculous doesn't support, so convert these
                                      case 'points':
                    Severity
                    Category
                    Status
                    Source
                    Language