talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

    onWheel : function(e){
        var d = e.getWheelDelta()*this.wheelIncrement*-1;
        e.stopEvent();

        var pos = this.getScrollPos(),
app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 1000..1012

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

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.disabledDatesRE && this.disabledDates){
            var dd = this.disabledDates,
                len = dd.length - 1,
                re = '(?:';

Severity: Major
Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/ext/src/widgets/form/DateField.js on lines 185..197

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

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

    findTargets : function(e){
        var item = null,
            itemEl = e.getTarget('li:not(.x-tab-edge)', this.strip);

        if(itemEl){
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/TabPanel.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 278..297

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

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

    findTargets : function(e){
        var item = null,
            itemEl = e.getTarget('li:not(.x-tab-edge)', this.strip);

        if(itemEl){
app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 438..457

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

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 (versionData['older_id']) {
      this.olderButton.purgeListeners();
      this.olderButton.on('click', function(){ this.getVersion({'id': versionData['older_id']})}, this);
      this.olderButton.enable();
      col_model.setHidden( col_model.findColumnIndex('previous_version') , false );
Severity: Major
Found in app/assets/javascripts/admin/AuditLog.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/admin/AuditLog.js on lines 212..220

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

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 (versionData['newer_id']) {
      this.newerButton.purgeListeners();
      this.newerButton.on('click', function(){ this.getVersion({'id': versionData['newer_id']}) }, this);
      this.newerButton.enable();
      col_model.setHidden( col_model.findColumnIndex('next_version') , false );
Severity: Major
Found in app/assets/javascripts/admin/AuditLog.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/admin/AuditLog.js on lines 203..211

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

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

    unique: function( array ) {
        var ret = [], done = {};

        try {

Severity: Major
Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/jquery.js on lines 1113..1132

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

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

    unique: function( array ) {
        var ret = [], done = {};

        try {

Severity: Major
Found in app/assets/javascripts/jquery.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 1137..1156

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

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

    onRender : function(ct, position){
        Ext.Panel.superclass.onRender.call(this, ct, position);
        this.createClasses();

        var el = this.el,
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/Panel.js - About 5 hrs to fix

    File ext-base-anim.js has 381 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/adapter/ext-base-anim.js - About 5 hrs to fix

      File Invitations.js has 380 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      Ext.ns("Talho");
      
      Talho.Invitations = Ext.extend(function(){}, {
        constructor: function(config){
      
      
      Severity: Minor
      Found in app/assets/javascripts/invitations/Invitations.js - About 5 hrs to fix

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

          deleteApp: function(g, r){
            var app = g.getStore().getAt(r);
            Ext.Msg.confirm('Delete App', 'Are you sure you want to delete the app "' + app.get('name') + '"?', function(btn){
              if(btn == 'yes'){
                Ext.Ajax.request({
        Severity: Major
        Found in app/assets/javascripts/admin/apps/view/Index.js and 1 other location - About 5 hrs to fix
        app/assets/javascripts/admin/apps/view/Roles.js on lines 79..91

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

        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

          deleteRole: function(g, r){
            var role = g.getStore().getAt(r);
            Ext.Msg.confirm("Delete Role", "Are you sure you would like to delete role " + role.get('name') + "?", function(btn){
              if(btn == 'yes'){
                Ext.Ajax.request({
        Severity: Major
        Found in app/assets/javascripts/admin/apps/view/Roles.js and 1 other location - About 5 hrs to fix
        app/assets/javascripts/admin/apps/view/Index.js on lines 44..56

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

        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 getAlignToXY has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

            getAlignToXY : function(el, p, o){        
                el = Ext.get(el);
                
                if(!el || !el.dom){
                    throw "Element.alignToXY with an element that doesn't exist";
        Severity: Minor
        Found in app/assets/javascripts/ext/src/core/Element.alignment.js - About 5 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 onLayout has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

            onLayout : function(ct, target){
                var collapsed, i, c, pos, items = ct.items.items, len = items.length;
                if(!this.rendered){
                    collapsed = [];
                    for(i = 0; i < len; i++) {
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/layout/BorderLayout.js - About 5 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

        File DocumentViews.js has 377 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        Ext.ns('Talho.ux.Documents');
        
        (function(){
            Talho.ux.Documents.translateMimeType = function(mime){
                if(mime.match(/image\//))
        Severity: Minor
        Found in app/assets/javascripts/documents/DocumentViews.js - About 5 hrs to fix

          TreeNode has 38 functions (exceeds 20 allowed). Consider refactoring.
          Open

          Ext.tree.TreeNode = Ext.extend(Ext.data.Node, {
              
              constructor : function(attributes){
                  attributes = attributes || {};
                  if(Ext.isString(attributes)){
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/tree/TreeNode.js - About 5 hrs to fix

            Function JSON has 125 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Ext.util.JSON = new (function(){
                var useHasOwn = !!{}.hasOwnProperty,
                    isNative = function() {
                        var useNative = null;
            
            
            Severity: Major
            Found in app/assets/javascripts/ext/src/ext-core/src/util/JSON.js - About 5 hrs to fix

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

                      getHeight : function(contentHeight){
                          var me = this,
                              dom = me.dom,
                              hidden = Ext.isIE && me.isStyle('display', 'none'),
                              h = MATH.max(dom.offsetHeight, hidden ? 0 : dom.clientHeight) || 0;
              app/assets/javascripts/ext/src/ext-core/src/core/Element.style.js on lines 360..367

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

              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

                      getWidth : function(contentWidth){
                          var me = this,
                              dom = me.dom,
                              hidden = Ext.isIE && me.isStyle('display', 'none'),
                              w = MATH.max(dom.offsetWidth, hidden ? 0 : dom.clientWidth) || 0;
              app/assets/javascripts/ext/src/ext-core/src/core/Element.style.js on lines 345..353

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

              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