BadrIT/translation_center

View on GitHub

Showing 161 of 426 total issues

Function _open has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _open: function( event, target, content ) {
        var tooltip, events, delayedShow,
            positionOption = $.extend( {}, this.options.position );

        if ( !content ) {
Severity: Major
Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

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

        _showDatepicker: function(input) {
            input = input.target || input;
            if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
                input = $('input', input.parentNode)[0];
            if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
    Severity: Major
    Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

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

      $.effects.effect.bounce = function( o, done ) {
          var el = $( this ),
              props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
      
              // defaults:
      Severity: Major
      Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

        Function _mouseStart has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _mouseStart: function(event, overrideHandle, noActivation) {
        
                var o = this.options;
                this.currentContainer = this;
        
        
        Severity: Major
        Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

          Function _create has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _create: function() {
                  var that = this,
                      options = this.options,
                      active = options.active,
                      locationHash = location.hash.substring( 1 );
          Severity: Major
          Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

            Function drag has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                drag: function(event, ui) {
            
                    var inst = $(this).data("draggable"), that = this;
            
                    var checkPos = function(o) {
            Severity: Major
            Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

              Function explode has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              $.effects.effect.explode = function( o, done ) {
              
                  var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
                      cells = rows,
                      el = $( this ),
              Severity: Major
              Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

                Class TranslationKey has 22 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  class TranslationKey < ActiveRecord::Base
                    # Constants
                    ACCEPTED = "accepted"
                    PENDING = "pending"
                    TRANSLATED = "translated"
                Severity: Minor
                Found in app/models/translation_center/translation_key.rb - About 2 hrs to fix

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

                              keydown: function( event ) {
                                  var allowed, curVal, newVal, step,
                                      index = $( event.target ).data( "ui-slider-handle-index" );
                  
                                  switch ( event.keyCode ) {
                  Severity: Major
                  Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

                    Function _mouseDrag has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _mouseDrag: function(event) {
                    
                            //Compute the helpers position
                            this.position = this._generatePosition(event);
                            this.positionAbs = this._convertPositionTo("absolute");
                    Severity: Major
                    Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

                      Function createWrapper has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          createWrapper: function( element ) {
                      
                              // if the element is already wrapped, return it
                              if ( element.parent().is( ".ui-effects-wrapper" )) {
                                  return element.parent();
                      Severity: Major
                      Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

                        Function _generateMonthYearHeader has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
                                    secondary, monthNames, monthNamesShort) {
                                var changeMonth = this._get(inst, 'changeMonth');
                                var changeYear = this._get(inst, 'changeYear');
                                var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
                        Severity: Major
                        Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

                          Function parse has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              parse: function( red, green, blue, alpha ) {
                                  if ( red === undefined ) {
                                      this._rgba = [ null, null, null, null ];
                                      return this;
                                  }
                          Severity: Major
                          Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

                            Method translate_with_adding has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def translate_with_adding(locale, key, options = {})
                                # handle calling translation with a blank key
                                # or translation center tables don't exist
                                return translate_without_adding(locale, key, options) if key.blank? || !ActiveRecord::Base.connection.table_exists?('translation_center_translation_keys')
                            
                            
                            Severity: Minor
                            Found in lib/translation_center/translation_helpers.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

                            Function keydown has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        keydown: function( event ) {
                                            if ( this.element.prop( "readOnly" ) ) {
                                                suppressKeyPress = true;
                                                suppressInput = true;
                                                suppressKeyPressRepeat = true;
                            Severity: Major
                            Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

                              Function _processTabs has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  _processTabs: function() {
                                      var that = this;
                              
                                      this.tablist = this._getList()
                                          .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
                              Severity: Major
                              Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

                                Function _refreshValue has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    _refreshValue: function() {
                                        var lastValPercent, valPercent, value, valueMin, valueMax,
                                            oRange = this.options.range,
                                            o = this.options,
                                            that = this,
                                Severity: Major
                                Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

                                  Function _mouseStart has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      _mouseStart: function(event) {
                                          var that = this;
                                  
                                          this.opos = [event.pageX, event.pageY];
                                  
                                  
                                  Severity: Major
                                  Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

                                    Function _setOption has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        _setOption: function( key, value ) {
                                            var isDraggable, isResizable,
                                                uiDialog = this.uiDialog;
                                    
                                            switch ( key ) {
                                    Severity: Major
                                    Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

                                      Function _clear has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          _clear: function(event, noPropagation) {
                                      
                                              this.reverting = false;
                                              // We delay all events that have to be triggered to after the point where the placeholder has been removed and
                                              // everything else normalized again
                                      Severity: Minor
                                      Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language