talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

    this.edge = this.strip.createChild({
      tag : 'span',
      cls : 'x-tab-edge',
      cn : [{
        tag : 'span',
Severity: Major
Found in app/assets/javascripts/ext_extensions/PillPanel.js and 1 other location - About 1 hr to fix
app/assets/javascripts/ext/src/widgets/TabPanel.js on lines 329..329

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

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

    show: function(speed,callback){
        if ( speed ) {
            return this.animate( genFx("show", 3), speed, callback);
        } else {
            for ( var i = 0, l = this.length; i < l; i++ ){
Severity: Minor
Found in app/assets/javascripts/jquery.js - About 1 hr to fix

    Function clone has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        clone: function( events ) {
            // Do the clone
            var ret = this.map(function(){
                if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
                    // IE copies events bound via attachEvent when
    Severity: Minor
    Found in app/assets/javascripts/jquery.js - About 1 hr to fix

      Function extend has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      jQuery.extend = jQuery.fn.extend = function() {
          // copy reference to target object
          var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
      
          // Handle a deep copy situation
      Severity: Minor
      Found in app/assets/javascripts/jquery.js - About 1 hr to fix

        Function _createSelectionGrid has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _createSelectionGrid: function(){
                this.jurisdictionContextMenu = new Ext.menu.Menu({
                    defaultAlign: 'tl-b?',
                    defaultOffsets: [0, 2],
                    plain: true,
        Severity: Minor
        Found in app/assets/javascripts/audience/JurisdictionsTree.js - About 1 hr to fix

          Function acknowledgement_clicked has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            acknowledgement_clicked: function(ev, el, op){
              el = Ext.get(el);
              if(el.hasClass('selected')){
                return;
              }
          Severity: Minor
          Found in app/assets/javascripts/alert/acknowledgement_controller.js - About 1 hr to fix

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

              initComponent: function(){
                this.items = [
                  {xtype: 'form', itemId: 'form', border: false, padding: 5, unstyled: true, region: 'center', labelAlign: 'top', method: 'GET', url: '/report_schedules/' + this.report_type + '.json', items: [
                    {xtype: 'textfield', fieldLabel: 'Report Type', anchor: '100%', value: '', name: 'report_schedule[report_type]', disabled: true},
                    {xtype: 'label', text: 'Days to run the report:'},
            Severity: Minor
            Found in app/assets/javascripts/reports/view/EditReportSchedule.js - About 1 hr to fix

              Function bindReady has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function bindReady(){
                  if ( readyBound ) return;
                  readyBound = true;
              
                  // Mozilla, Opera and webkit nightlies currently support this event
              Severity: Minor
              Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                Function fix has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    fix: function(event) {
                        if ( event[expando] )
                            return event;
                
                        // store a copy of the original event object
                Severity: Minor
                Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                  Function checkIFrame has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function checkIFrame() {
                          if (!iframe.contentWindow || !iframe.contentWindow.document) {
                              setTimeout(checkIFrame, 10);
                              return;
                          }
                  Severity: Minor
                  Found in app/assets/javascripts/ext/src/util/History.js - About 1 hr to fix

                    Function doForm has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        doForm : function(c, m, form, callback, scope){
                            var t = new Ext.Direct.Transaction({
                                provider: this,
                                action: c,
                                method: m.name,
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/direct/RemotingProvider.js - About 1 hr to fix

                      Function constrainTo has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          constrainTo : function(constrainTo, pad, inContent){
                              if(Ext.isNumber(pad)){
                                  pad = {left: pad, right:pad, top:pad, bottom:pad};
                              }
                              pad = pad || this.defaultPadding;
                      Severity: Minor
                      Found in app/assets/javascripts/ext/src/dd/DDCore.js - About 1 hr to fix

                        Function groupBy has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            groupBy : function(field, forceRegroup, direction) {
                                direction = direction ? (String(direction).toUpperCase() == 'DESC' ? 'DESC' : 'ASC') : this.groupDir;
                        
                                if (this.groupField == field && this.groupDir == direction && !forceRegroup) {
                                    return; // already grouped by this field
                        Severity: Minor
                        Found in app/assets/javascripts/ext/src/data/GroupingStore.js - About 1 hr to fix

                          Function getStyleSize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  getStyleSize : function(){
                                      var me = this,
                                          w, h,
                                          doc = document,
                                          d = this.dom,
                          Severity: Minor
                          Found in app/assets/javascripts/ext/src/core/Element.style-more.js - About 1 hr to fix

                            Function extractData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                extractData : function(root, returnRecords) {
                                    // A bit ugly this, too bad the Record's raw data couldn't be saved in a common property named "raw" or something.
                                    var rawName = (this instanceof Ext.data.JsonReader) ? 'json' : 'node';
                            
                                    var rs = [];
                            Severity: Minor
                            Found in app/assets/javascripts/ext/src/data/DataReader.js - About 1 hr to fix

                              Function mon has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  mon : function(item, ename, fn, scope, opt){
                                      this.createMons();
                                      if(Ext.isObject(ename)){
                                          var propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;
                              
                              
                              Severity: Minor
                              Found in app/assets/javascripts/ext/src/widgets/Component.js - About 1 hr to fix

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

                                    initComponent : function(){
                                        this.addEvents(
                                            /**
                                             * @event change
                                             * Fires after the button's active menu item has changed.  Note that if a {@link #changeHandler} function
                                Severity: Minor
                                Found in app/assets/javascripts/ext/src/widgets/CycleButton.js - About 1 hr to fix

                                  Function select has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      select : function(nodeInfo, keepExisting, suppressEvent){
                                          if(Ext.isArray(nodeInfo)){
                                              if(!keepExisting){
                                                  this.clearSelections(true);
                                              }
                                  Severity: Minor
                                  Found in app/assets/javascripts/ext/src/widgets/DataView.js - About 1 hr to fix

                                    Function isValidDropPoint has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        isValidDropPoint : function(n, pt, dd, e, data){
                                            if(!n || !data){ return false; }
                                            var targetNode = n.node;
                                            var dropNode = data.node;
                                            // default drop rules
                                    Severity: Minor
                                    Found in app/assets/javascripts/ext/src/widgets/tree/TreeDropZone.js - About 1 hr to fix

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

                                          bindStore : function(store, initial){
                                              if(!initial && this.store){
                                                  if(store !== this.store && this.store.autoDestroy){
                                                      this.store.destroy();
                                                  }else{
                                      Severity: Minor
                                      Found in app/assets/javascripts/ext/src/widgets/chart/Chart.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language