talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Method show has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def show
    respond_to do |format|
      format.html do
        DashboardController.app_toolbar "application"
        expire_fragment(:controller => "dashboard", :action => "index") if DashboardController.expired?
Severity: Minor
Found in app/controllers/dashboard_controller.rb - About 1 hr 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 index has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def index
    user = params[:user_id] ? User.find(params[:user_id]) : current_user
    respond_to do |format|
      format.json do
        for_admin = params[:for_admin].to_s == "true"
Severity: Minor
Found in app/controllers/dashboard_controller.rb - About 1 hr 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 curCSS has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    curCSS: function( elem, name, force ) {
        var ret, style = elem.style;

        // We need to handle opacity special in IE
        if ( name == "opacity" && !jQuery.support.opacity ) {
Severity: Minor
Found in app/assets/javascripts/jquery.js - About 1 hr to fix

    Function dirCheck has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
        var sibDir = dir == "previousSibling" && !isXML;
        for ( var i = 0, l = checkSet.length; i < l; i++ ) {
            var elem = checkSet[i];
            if ( elem ) {
    Severity: Minor
    Found in app/assets/javascripts/jquery.js - About 1 hr to fix

      Function request has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              request : function(method, uri, cb, data, options){
                  var o = {
                      type: method,
                      url: uri,
                      data: data,
      Severity: Minor
      Found in app/assets/javascripts/ext/src/adapter/jquery-bridge.js - About 1 hr to fix

        Function doRequest has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            doRequest : function(action, rs, params, reader, callback, scope, options) {
                var args = [],
                    directFn = this.api[action] || this.directFn;
        
                switch (action) {
        Severity: Minor
        Found in app/assets/javascripts/ext/src/data/DirectProxy.js - About 1 hr to fix

          Function ua has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              ua = function() {
                  var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
                      u = nav.userAgent.toLowerCase(),
                      p = nav.platform.toLowerCase(),
                      windows = p ? (/win/).test(p) : /win/.test(u),
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/chart/swfobject.js - About 1 hr to fix

            Function doQuery has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                doQuery : function(q, forceAll){
                    q = Ext.isEmpty(q) ? '' : q;
                    var qe = {
                        query: q,
                        forceAll: forceAll,
            Severity: Minor
            Found in app/assets/javascripts/ext/src/widgets/form/Combo.js - About 1 hr to fix

              Function showAt has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  showAt : function(xy){
                      var t = this.activeTarget;
                      if(t){
                          if(!this.rendered){
                              this.render(Ext.getBody());
              Severity: Minor
              Found in app/assets/javascripts/ext/src/widgets/tips/QuickTip.js - About 1 hr to fix

                Function byAttribute has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function byAttribute(cs, attr, value, op, custom){
                        var result = [], 
                            ri = -1, 
                            useGetStyle = custom == "{",        
                            fn = Ext.DomQuery.operators[op],        
                Severity: Minor
                Found in app/assets/javascripts/ext/src/ext-core/src/core/DomQuery.js - About 1 hr to fix

                  Function request has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          request : function(method, uri, cb, data, options){
                              var o = {
                                  type: method,
                                  url: uri,
                                  data: data,

                    Function removeListener has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            removeListener : function(el, eventName, fn, scope){
                                el = Ext.getDom(el);
                                var id = getId(el),
                                    f = el && (Ext.elCache[id].events)[eventName] || [],
                                    wrap, i, l, k, len, fnc;
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/ext-core/src/core/EventManager.js - About 1 hr to fix

                      Function bindStore has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          bindStore: function (store, initial) {
                              var doLoad;
                              if (!initial && this.store) {
                                  if (store !== this.store && this.store.autoDestroy) {
                                      this.store.destroy();
                      Severity: Minor
                      Found in app/assets/javascripts/ext_extensions/PagingStore.js - About 1 hr to fix

                        Function save has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function save() {
                                // if this is the current source, or it has no title (occurs with click event), stop
                                if ( $.tooltip.blocked || this == current || (!this.tooltipText && !settings(this).bodyHandler) )
                                    return;
                        
                        
                        Severity: Minor
                        Found in app/assets/javascripts/jquery-tooltip/jquery.tooltip.js - About 1 hr to fix

                          Function sortData has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              sortData: function () {
                                  var sortInfo = this.hasMultiSort ? this.multiSortInfo : this.sortInfo,
                                      direction = sortInfo.direction || "ASC",
                                      sorters = sortInfo.sorters,
                                      sortFns = [];
                          Severity: Minor
                          Found in app/assets/javascripts/ext_extensions/PagingStore.js - About 1 hr to fix

                            Method create has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def create
                                begin
                                  params[:folder_id] = nil if params[:folder_id] == 'null' || params[:folder_id] == '' || params[:folder_id] == '0'
                            
                                  @parent_folder = params[:folder_id] ?  Folder.find(params[:folder_id].to_i) : nil
                            Severity: Minor
                            Found in app/controllers/doc/documents_controller.rb - About 1 hr to fix

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

                                      if(this.tabPosition == 'top'){
                                          this.elements += ',header';
                                          this.stripTarget = 'header';
                                      }else {
                                          this.elements += ',footer';
                              Severity: Major
                              Found in app/assets/javascripts/ext/src/widgets/TabPanel.js and 1 other location - About 1 hr to fix
                              app/assets/javascripts/ext_extensions/VerticalTabPanel/Ext.ux.tot2ivn.VrTabPanel.js on lines 196..202

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

                              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

                                          all.on("add", function(index, o){
                                              if(o.id == id){
                                                  fn.call(scope || o, o);
                                                  all.un("add", fn, scope);
                                              }
                              Severity: Major
                              Found in app/assets/javascripts/ext/src/widgets/ComponentMgr.js and 1 other location - About 1 hr to fix
                              app/assets/javascripts/ext/src/util/AbstractManager.js on lines 105..110

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

                              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(typeof selector == "string"){
                                      els = Ext.Element.selectorFunction(selector, root);
                                  }else if(selector.length !== undefined){
                                      els = selector;
                                  }else{
                              Severity: Major
                              Found in app/assets/javascripts/ext/src/core/CompositeElement.js and 1 other location - About 1 hr to fix
                              app/assets/javascripts/ext/src/ext-core/src/core/CompositeElementLite.js on lines 303..309

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

                              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(typeof selector == "string"){
                                      els = Ext.Element.selectorFunction(selector, root);
                                  }else if(selector.length !== undefined){
                                      els = selector;
                                  }else{
                              app/assets/javascripts/ext/src/core/CompositeElement.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 63.

                              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