talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Method perform has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def perform
      report_id = params[:report_id]
      logger = REPORT_LOGGER || Logger.new
      begin
        begin
Severity: Major
Found in lib/reporters/reporter.rb - About 2 hrs to fix

    File ext-lang-pt_PT.js has 263 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-pt_PT.js - About 2 hrs to fix

      File ext-lang-fi.js has 263 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-fi.js - About 2 hrs to fix

        File ext-lang-el_GR.js has 263 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-el_GR.js - About 2 hrs to fix

          File ext-lang-tr.js has 263 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-tr.js - About 2 hrs to fix

            File ext-lang-hu.js has 263 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-hu.js - About 2 hrs to fix

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

                  post: function( url, data, callback, type ) {
                      if ( jQuery.isFunction( data ) ) {
                          callback = data;
                          data = {};
                      }
              Severity: Major
              Found in app/assets/javascripts/jquery.js and 1 other location - About 2 hrs to fix
              app/assets/javascripts/jquery-tooltip/lib/jquery.js on lines 2491..2504

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

              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

                  post: function( url, data, callback, type ) {
                      if ( jQuery.isFunction( data ) ) {
                          callback = data;
                          data = {};
                      }
              Severity: Major
              Found in app/assets/javascripts/jquery-tooltip/lib/jquery.js and 1 other location - About 2 hrs to fix
              app/assets/javascripts/jquery.js on lines 3346..3359

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

              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 ext-lang-pt_BR.js has 262 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-pt_BR.js - About 2 hrs to fix

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

                  initComponent: function(){
                    this.setTitle(this.editMode ? 'Edit Forum' : 'New Forum');
                    this.items = [
                      {xtype: 'container', itemId: 'container', width: 350, layout: 'form', defaults: {anchor: '100%'}, items: [
                        {xtype: 'textfield', fieldLabel: 'Forum Name', name:'forum[name]', allowBlank: false},
                Severity: Major
                Found in app/assets/javascripts/forums/view/forums/New.js - About 2 hrs to fix

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

                      initComponent : function(){
                          Ext.tree.TreePanel.superclass.initComponent.call(this);
                  
                          if(!this.eventModel){
                              this.eventModel = new Ext.tree.TreeEventModel(this);
                  Severity: Major
                  Found in app/assets/javascripts/ext/src/widgets/tree/TreePanel.js - About 2 hrs to fix

                    Function frame has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        frame : function(color, count, o){
                            o = getObject(o);
                            var me = this,
                                dom = me.dom,
                                proxy,
                    Severity: Major
                    Found in app/assets/javascripts/ext/src/ext-core/src/core/Fx.js - About 2 hrs to fix

                      Function getXY has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              getXY : function(el) {
                                  var p, 
                                      pe, 
                                      b,
                                      bt, 
                      Severity: Major
                      Found in app/assets/javascripts/ext/src/ext-core/src/adapter/ext-base-dom.js - About 2 hrs to fix

                        Function doRender has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            doRender : function(cs, rs, ds, startRow, colCount, stripe)
                            {
                                var ts = this.templates, ct = ts.cell, rt = ts.row, last = colCount-1;
                                var tstyle = 'width:'+this.getTotalWidth()+';';
                                // buffers
                        Severity: Major
                        Found in app/assets/javascripts/ext_extensions/TreeGrid/src/GridView.js - About 2 hrs to fix

                          Function doRender has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              doRender : function(cs, rs, ds, startRow, colCount, stripe)
                              {
                                  var ts = this.templates, ct = ts.cell, rt = ts.row, last = colCount-1;
                                  var tstyle = 'width:'+this.getTotalWidth()+';';
                                  // buffers
                          Severity: Major
                          Found in app/assets/javascripts/ext_extensions/TreeGrid/TreeGrid.js - About 2 hrs to fix

                            Function getXY has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    getXY : function(el) {
                                        var p, 
                                            pe, 
                                            b,
                                            bt, 
                            Severity: Major
                            Found in app/assets/javascripts/ext/adapter/ext/ext-base-debug.js - About 2 hrs to fix

                              Function panelLoaded has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  panelLoaded: function(panel){
                                      var link_elem_style = {'margin-bottom': '15px'};
                              
                                      var wildcard_explanation = panel.getEl().select('.search_user_explanation').first();
                                      if(wildcard_explanation)
                              Severity: Major
                              Found in app/assets/javascripts/searches/AdvancedSearch.js - About 2 hrs to fix

                                Method import_users has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def self.import_users(filename, options={})
                                    options = {:col_sep => ",", :row_sep => :auto, :update => false, :create => true,
                                               :default_jurisdiction => nil, :default_password => self.generate_random_password}.merge(options)
                                    CSV.open(filename, :headers => true, :col_sep => options[:col_sep], :row_sep => options[:row_sep]) do |records|
                                      records.each do |rec|
                                Severity: Major
                                Found in lib/user_importer.rb - About 2 hrs to fix

                                  Function initComponent has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    initComponent : function() {
                                      this.setTitle('Topic: '+ this.topicName);
                                      
                                      if(!this.items) {
                                        this.items = [];
                                  Severity: Minor
                                  Found in app/assets/javascripts/forums/view/topics/Show.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 execute has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      execute : function(action, rs, options, /* private */ batch) {
                                          // blow up if action not Ext.data.CREATE, READ, UPDATE, DESTROY
                                          if (!Ext.data.Api.isAction(action)) {
                                              throw new Ext.data.Api.Error('execute', action);
                                          }
                                  Severity: Minor
                                  Found in app/assets/javascripts/ext/src/data/Store.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language