talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Function initComponent has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    initComponent : function() {
        Ext.grid.GridPanel.superclass.initComponent.call(this);

        if (this.columnLines) {
            this.cls = (this.cls || '') + ' x-grid-with-col-lines';
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/grid/GridPanel.js - About 2 hrs to fix

    Function compile has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            compile : function(path, type){
                type = type || "select";
    
                // setup fn preamble
                var fn = ["var f = function(root){\n var mode; ++batch; var n = root || document;\n"],
    Severity: Major
    Found in app/assets/javascripts/ext/src/ext-core/src/core/DomQuery.js - About 2 hrs to fix

      Function filterBy has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          filterBy : function(fn, scope, startNode){
              startNode = startNode || this.tree.root;
              if(this.autoClear){
                  this.clear();
              }
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/tree/TreeFilter.js - About 2 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 getErrors has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          getErrors: function(value) {
              var errors = Ext.form.TextField.superclass.getErrors.apply(this, arguments);
              
              value = Ext.isDefined(value) ? value : this.processValue(this.getRawValue());        
              
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/form/TextField.js - About 2 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 onEditorKey has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          onEditorKey : function(field, e){
              var k = e.getKey(), 
                  newCell, 
                  g = this.grid, 
                  last = g.lastEdit,
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/grid/RowSelectionModel.js - About 2 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 extractData has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          extractData: function() {
              var records  = this.store.data.items,
                  recCount = records.length,
                  cells    = [],
                  record, i, j, k;
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/grid/PivotGrid.js - About 2 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 MenuNav has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      Ext.menu.MenuNav = Ext.extend(Ext.KeyNav, function(){
          function up(e, m){
              if(!m.tryActivate(m.items.indexOf(m.activeItem)-1, -1)){
                  m.tryActivate(m.items.length-1, -1);
              }
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/menu/Menu.js - About 2 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 onClick has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          ,onClick:function(e, target) {
      
              var view = this.grid.getView();
      
              // handle row action click
      Severity: Minor
      Found in app/assets/javascripts/ext_extensions/Ext.ux.grid.RowActions.js - About 2 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

      Method perform_delivery has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

        def perform_delivery
          # find the title, sender, and other things that are static
          @title = message.Messages.select {|m| m.name == 'title' }.first.Value
          if !message.Author
            @sender = DO_NOT_REPLY
      Severity: Minor
      Found in app/models/service/talho/email/message.rb - About 2 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

      Method handle_org_requests has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

        def handle_org_requests(req_json, current_user)
          return [ false, [ "Permission denied" ] ] unless editable_by?(current_user)
          rq_list = ActiveSupport::JSON.decode(req_json)
          result = "success"
          rq_errors = []
      Severity: Minor
      Found in app/models/user.rb - About 2 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

      Method create has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

        def create
          if request.post?
            if request.xhr?
              user_list = JSON.parse(params[:user_batch][:users])
              params[:user_batch].delete(:users)
      Severity: Minor
      Found in app/controllers/admin/user_batch_controller.rb - About 2 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 ext-lang-ja.js has 274 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/locale/ext-lang-ja.js - About 2 hrs to fix

        Function Types has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Ext.data.Types = new function(){
            var st = Ext.data.SortTypes;
            Ext.apply(this, {
                /**
                 * @type Regexp
        Severity: Major
        Found in app/assets/javascripts/ext/src/data/Types.js - About 2 hrs to fix

          Function offset has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              offset: function(options, returnObject) {
                  var x = 0, y = 0, sl = 0, st = 0,
                      elem = this[0], parent = this[0], op, parPos, elemPos = $.css(elem, 'position'),
                      mo = $.browser.mozilla, ie = $.browser.msie, sf = $.browser.safari, oa = $.browser.opera,
                      absparent = false, relparent = false, 
          Severity: Major
          Found in app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js - About 2 hrs to fix

            File ext-lang-ca.js has 273 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/locale/ext-lang-ca.js - About 2 hrs to fix

              File TreePanel.js has 273 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/widgets/tree/TreePanel.js - About 2 hrs to fix

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

                                if(axy[1] < scrollY){
                                    if(this.anchorToTarget){
                                        this.defaultAlign = 't-b';
                                        if(this.mouseOffset){this.mouseOffset[1] *= -1;}
                                    }
                Severity: Major
                Found in app/assets/javascripts/ext/src/widgets/tips/ToolTip.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/ext/src/widgets/tips/ToolTip.js on lines 206..213

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

                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(axy[0] < scrollX){
                                    if(this.anchorToTarget){
                                        this.defaultAlign = 'l-r';
                                        if(this.mouseOffset){this.mouseOffset[0] *= -1;}
                                    }
                Severity: Major
                Found in app/assets/javascripts/ext/src/widgets/tips/ToolTip.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/ext/src/widgets/tips/ToolTip.js on lines 222..229

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

                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

                File alerts.js has 272 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                (function($) {
                  $(function() {
                    $(document).ready(function() {
                      if ($('#alert_device_phone_device:checked,#alert_device_sms_device:checked,#alert_device_fax_device:checked,#alert_device_blackberry_device:checked').length > 0) {
                        $('#details .caller_id').show();
                Severity: Minor
                Found in app/assets/javascripts/alerts.js - About 2 hrs to fix

                  Function _createFileIconView has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _createFileIconView: function(store){
                  
                          return {
                              xtype: 'panel',
                              title: 'Files',
                  Severity: Major
                  Found in app/assets/javascripts/documents/Documents.js - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language