talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

File GridView.js has 456 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Ext.ux.maximgb.tg.GridView = Ext.extend(Ext.grid.GridView, 
{   
    expanded_icon_class : 'ux-maximgb-tg-elbow-minus',
    last_expanded_icon_class : 'ux-maximgb-tg-elbow-end-minus',
    collapsed_icon_class : 'ux-maximgb-tg-elbow-plus',
Severity: Minor
Found in app/assets/javascripts/ext_extensions/TreeGrid/src/GridView.js - About 6 hrs to fix

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

        constructor: function(config){
            this.addEvents('foldercreated');
    
            var cb = Ext.extend(Ext.form.Checkbox, {
                anchor: '100%',
    Severity: Major
    Found in app/assets/javascripts/documents/AddEditFolderWindow.js - About 6 hrs to fix

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

            if(o.isRawJSON) {
              if(Ext.isIE) {
                Ext.fly(script).on('readystatechange', function() {
                  if(script.readyState == 'complete') {
                    var data = script.innerHTML;
      Severity: Major
      Found in app/assets/javascripts/ext_extensions/jsonp.js and 1 other location - About 6 hrs to fix
      app/assets/javascripts/ext/src/ext-core/examples/jsonp/jsonp.js on lines 37..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 173.

      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

                  if(o.isRawJSON) {
                      if(Ext.isIE) {
                          Ext.fly(script).on('readystatechange', function() {
                              if(script.readyState == 'complete') {
                                  var data = script.innerHTML;
      app/assets/javascripts/ext_extensions/jsonp.js on lines 33..51

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

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

      function() {
          var BEFOREUPDATE = "beforeupdate",
              UPDATE = "update",
              FAILURE = "failure";
      
      
      Severity: Major
      Found in app/assets/javascripts/ext/src/util/UpdateManager.js - About 6 hrs to fix

        File PagingStore.js has 450 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * PagingStore for Ext 3.2 - v0.5
         */
        Ext.ns('Ext.ux.data');
        Ext.ux.data.PagingStore = Ext.extend(Ext.data.Store, {
        Severity: Minor
        Found in app/assets/javascripts/ext_extensions/PagingStore.js - About 6 hrs to fix

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

              onStripMouseDown : function(e){
                  if(e.button !== 0){
                      return;
                  }
                  e.preventDefault();
          Severity: Major
          Found in app/assets/javascripts/ext/src/widgets/TabPanel.js and 1 other location - About 6 hrs to fix
          app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 300..316

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

          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

              onStripMouseDown : function(e){
                  if(e.button !== 0){
                      return;
                  }
                  e.preventDefault();
          app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 460..476

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

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

            constructor: function(config){
              Ext.apply(this, config);
          
              this.store = new Ext.data.GroupingStore({
                reader: new Ext.data.JsonReader({
          Severity: Major
          Found in app/assets/javascripts/admin/BatchUsers.js - About 6 hrs to fix

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

                    {xtype: 'container', layout: 'hbox', labelAlign: 'top', items:[
                      {xtype: 'container', layout: 'form', labelAlign: 'top', width: 175, defaults:{width:175}, items:[
                        {xtype: 'textfield', fieldLabel: 'Office phone', name: 'user[phone]', maxLength: '46', allowBlank: true, vtype: 'phone'}
                      ]},
                      {xtype: 'container', layout: 'form', labelAlign: 'top', margins: '0 0 0 10', width: 175, defaults:{width:175}, items:[
            Severity: Major
            Found in app/assets/javascripts/profile/EditProfile.js and 1 other location - About 6 hrs to fix
            app/assets/javascripts/profile/EditProfile.js on lines 68..75

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

            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

                    {xtype: 'container', layout: 'hbox', labelAlign: 'top', items:[
                      {xtype: 'container', layout: 'form', labelAlign: 'top', width: 175, defaults:{width:175}, items:[
                        {xtype: 'textfield', fieldLabel: 'Home phone', name: 'user[home_phone]', maxLength: '46', allowBlank: true, vtype: 'phone'}
                      ]},
                      {xtype: 'container', layout: 'form', labelAlign: 'top', margins: '0 0 0 10', width: 175, defaults:{width:175}, items:[
            Severity: Major
            Found in app/assets/javascripts/profile/EditProfile.js and 1 other location - About 6 hrs to fix
            app/assets/javascripts/profile/EditProfile.js on lines 60..67

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

            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

                readTabs : function(removeExisting){
                    if(removeExisting === true){
                        this.items.each(function(item){
                            this.remove(item);
                        }, this);
            app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 492..508

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

            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

                scrollTo: function(position, animate) {
                    var oldPosition = this.getScrollPosition(),
                        newPosition = position.constrain(0, this.getMaxScrollRight());
                    
                    if (newPosition != oldPosition && !this.scrolling) {
            app/assets/javascripts/ext/src/widgets/layout/box/ScrollerOverflow.js on lines 370..388

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

            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

                readTabs : function(removeExisting){
                    if(removeExisting === true){
                        this.items.each(function(item){
                            this.remove(item);
                        }, this);
            Severity: Major
            Found in app/assets/javascripts/ext/src/widgets/TabPanel.js and 1 other location - About 6 hrs to fix
            app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 332..348

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

            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

                scrollTo: function(position, animate) {
                    var oldPosition = this.getScrollPosition(),
                        newPosition = position.constrain(0, this.getMaxScrollBottom());
                    
                    if (newPosition != oldPosition && !this.scrolling) {
            app/assets/javascripts/ext/src/widgets/layout/box/ScrollerOverflow.js on lines 460..478

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

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

            Ext.applyIf(Array.prototype, {
                /**
                 * Checks whether or not the specified object exists in the array.
                 * @param {Object} o The object to check for
                 * @param {Number} from (Optional) The index at which to begin the search
            app/assets/javascripts/ext/adapter/ext/ext-base-debug.js on lines 1020..1051
            app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js on lines 1020..1051
            app/assets/javascripts/ext/adapter/prototype/ext-prototype-adapter-debug.js on lines 1020..1051

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

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

            Ext.applyIf(Array.prototype, {
                /**
                 * Checks whether or not the specified object exists in the array.
                 * @param {Object} o The object to check for
                 * @param {Number} from (Optional) The index at which to begin the search
            Severity: Major
            Found in app/assets/javascripts/ext/adapter/ext/ext-base-debug.js and 3 other locations - About 6 hrs to fix
            app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js on lines 1020..1051
            app/assets/javascripts/ext/adapter/prototype/ext-prototype-adapter-debug.js on lines 1020..1051
            app/assets/javascripts/ext/adapter/yui/ext-yui-adapter-debug.js on lines 1020..1051

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

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

            Ext.applyIf(Array.prototype, {
                /**
                 * Checks whether or not the specified object exists in the array.
                 * @param {Object} o The object to check for
                 * @param {Number} from (Optional) The index at which to begin the search
            app/assets/javascripts/ext/adapter/ext/ext-base-debug.js on lines 1020..1051
            app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js on lines 1020..1051
            app/assets/javascripts/ext/adapter/yui/ext-yui-adapter-debug.js on lines 1020..1051

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

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

            Ext.applyIf(Array.prototype, {
                /**
                 * Checks whether or not the specified object exists in the array.
                 * @param {Object} o The object to check for
                 * @param {Number} from (Optional) The index at which to begin the search
            app/assets/javascripts/ext/adapter/ext/ext-base-debug.js on lines 1020..1051
            app/assets/javascripts/ext/adapter/prototype/ext-prototype-adapter-debug.js on lines 1020..1051
            app/assets/javascripts/ext/adapter/yui/ext-yui-adapter-debug.js on lines 1020..1051

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

            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

            Method query has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
            Open

              def query(args = nil)
                alert_classes = Alert.child_classes
                alert_classes.each do |alert_class|
                  alert_class.active.has_acknowledge.find_each do |alert|
                    next if alert.alert_attempts.with_device('Device::PhoneDevice').not_acknowledged.size == 0 && alert.alert_attempts.with_device('Device::EmailDevice').not_acknowledged.size == 0
            Severity: Minor
            Found in lib/workers/query_swn_for_acknowledgments_worker.rb - About 6 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Severity
            Category
            Status
            Source
            Language