talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Function Ajax has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Ext.lib.Ajax = function(){
    var createComplete = function(cb){
         return function(xhr, status){
            if((status == 'error' || status == 'timeout') && cb.failure){
                cb.failure.call(cb.scope||window, createResponse(cb, xhr));
Severity: Major
Found in app/assets/javascripts/ext/src/adapter/jquery-bridge.js - About 3 hrs to fix

    Function Ajax has 98 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Ext.lib.Ajax = function(){
        var createComplete = function(cb){
             return function(xhr, status){
                if((status == 'error' || status == 'timeout') && cb.failure){
                    cb.failure.call(cb.scope||window, createResponse(cb, xhr));
    Severity: Major
    Found in app/assets/javascripts/ext/adapter/jquery/ext-jquery-adapter-debug.js - About 3 hrs to fix

      Function HtmlNode has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      Ext.debug.HtmlNode = function(){
          var html = Ext.util.Format.htmlEncode;
          var ellipsis = Ext.util.Format.ellipsis;
          var nonSpace = /^\s*$/;
      
      
      Severity: Minor
      Found in app/assets/javascripts/ext/src/debug.js - About 3 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 handleMouseDown has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          handleMouseDown : function(e){
              var t = this.view.findHeaderCell(e.getTarget());
              if(t && this.allowHeaderDrag(e)){
                  var xy = this.view.fly(t).getXY(), 
                      x = xy[0],
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/grid/GridView.js - About 3 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 notifyOver has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          notifyOver : function(dd, e, data){
              var xy = e.getXY(), portal = this.portal, px = dd.proxy;
      
              // case column widths
              if(!this.grid){
      Severity: Minor
      Found in app/assets/javascripts/ext_extensions/Portal.js - About 3 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 obj2url has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      qq.obj2url = function(obj, temp, prefixDone){
          var uristrings = [],
              prefix = '&',
              add = function(nextObj, i){
                  var nextTemp = temp 
      Severity: Minor
      Found in app/assets/javascripts/lib/fileuploader.js - About 3 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 show has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

        def show
          @invitation = Invitation.find(params[:id])
          respond_to do |format|
            format.html
            format.json do
      Severity: Minor
      Found in app/controllers/admin/invitations_controller.rb - About 3 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 update has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

        def update
          @user = User.find(params[:id])
          if @user.update_attributes(params[:user])
            roles=params[:role_requests]
            roles.each_value do |r|
      Severity: Minor
      Found in app/controllers/users_controller.rb - About 3 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

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

          innerWidth: function() {
              return this[0] == window || this[0] == document ?
                  this.width() :
                  this.is(':visible') ?
                      this[0].offsetWidth - num(this, 'borderLeftWidth') - num(this, 'borderRightWidth') :
      app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 90..96

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

      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

                  "first-child" : function(c){
                      var r = [], ri = -1, n;
                      for(var i = 0, ci; ci = n = c[i]; i++){
                          while((n = n.previousSibling) && n.nodeType != 1);
                          if(!n){
      Severity: Major
      Found in app/assets/javascripts/ext/src/ext-core/src/core/DomQuery.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/ext/src/ext-core/src/core/DomQuery.js on lines 752..761

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

      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

        ajax_err_cb: function(response, opts) {
          var msg = '<b>Status: ' + response.status + ' => ' + response.statusText + '</b><br><br>' +
            '<div style="height:400px;overflow:scroll;">' + response.responseText + '<\div>';
          Ext.Msg.show({title: 'Error', msg: msg, minWidth: 900, maxWidth: 900, buttons: Ext.Msg.OK, icon: Ext.Msg.ERROR});
        },
      Severity: Major
      Found in app/assets/javascripts/search/FindPeople.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/profile/ProfileBase.js on lines 154..158

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

      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

                  "next" : function(c, ss){
                      var is = Ext.DomQuery.is,
                          r = [], ri = -1;
                      for(var i = 0, ci; ci = c[i]; i++){
                          var n = next(ci);
      Severity: Major
      Found in app/assets/javascripts/ext/src/ext-core/src/core/DomQuery.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/ext/src/ext-core/src/core/DomQuery.js on lines 909..919

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

      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

                  "prev" : function(c, ss){
                      var is = Ext.DomQuery.is,
                          r = [], ri = -1;
                      for(var i = 0, ci; ci = c[i]; i++){
                          var n = prev(ci);
      Severity: Major
      Found in app/assets/javascripts/ext/src/ext-core/src/core/DomQuery.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/ext/src/ext-core/src/core/DomQuery.js on lines 897..907

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

      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

                  "last-child" : function(c){
                      var r = [], ri = -1, n;
                      for(var i = 0, ci; ci = n = c[i]; i++){
                          while((n = n.nextSibling) && n.nodeType != 1);
                          if(!n){
      Severity: Major
      Found in app/assets/javascripts/ext/src/ext-core/src/core/DomQuery.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/ext/src/ext-core/src/core/DomQuery.js on lines 741..750

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

      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

          outerWidth: function() {
              return this[0] == window || this[0] == document ?
                  this.width() :
                  this.is(':visible') ?
                      this[0].offsetWidth :
      app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 129..135

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

      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

          innerHeight: function() {
              return this[0] == window || this[0] == document ?
                  this.height() :
                  this.is(':visible') ?
                      this[0].offsetHeight - num(this, 'borderTopWidth') - num(this, 'borderBottomWidth') :
      app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 110..116

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 113.

      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

        show_ajax_error: function(response){
          var msg = '<b>Status: ' + response.status + ' => ' + response.statusText + '</b><br><br>' +
            '<div style="height:400px;overflow:scroll;">' + response.responseText + '<\div>';
          Ext.Msg.show({title: 'Error', msg: msg, minWidth: 900, maxWidth: 900, buttons: Ext.Msg.OK, icon: Ext.Msg.ERROR});
        }
      Severity: Major
      Found in app/assets/javascripts/profile/ProfileBase.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/search/FindPeople.js on lines 347..351

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

      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

          outerHeight: function() {
              return this[0] == window || this[0] == document ?
                  this.height() :
                  this.is(':visible') ?
                      this[0].offsetHeight :
      app/assets/javascripts/jquery-tooltip/lib/jquery.dimensions.js on lines 148..154

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

      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 error-checking.js has 329 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/error-checking.js - About 3 hrs to fix

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

          grab_data: function(){
            this.store.clearFilter();
            var devices = jQuery.map(this.store.getRange(), function(e,i){ return e.data; });
            this.store.filterBy(function(e){ return e.get("state")!="deleted"; });
            return Ext.encode(devices);
        Severity: Major
        Found in app/assets/javascripts/profile/DevicesControl.js and 2 other locations - About 3 hrs to fix
        app/assets/javascripts/profile/OrganizationsControl.js on lines 68..73
        app/assets/javascripts/profile/RolesControl.js on lines 89..94

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

        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