BadrIT/translation_center

View on GitHub

Showing 426 of 426 total issues

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

        if ( factor.from.x !== factor.to.x ) {
            props = props.concat( hProps );
            el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
            el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
        }
Severity: Major
Found in app/assets/javascripts/translation_center/jquery-ui.js and 1 other location - About 3 hrs to fix
app/assets/javascripts/translation_center/jquery-ui.js on lines 10593..10597

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

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

        if (woset + that.size.width >= that.parentData.width) {
            that.size.width = that.parentData.width - woset;
            if (pRatio) that.size.height = that.size.width / that.aspectRatio;
        }
Severity: Major
Found in app/assets/javascripts/translation_center/jquery-ui.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/translation_center/jquery-ui.js on lines 2827..2830

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

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

        if (hoset + that.size.height >= that.parentData.height) {
            that.size.height = that.parentData.height - hoset;
            if (pRatio) that.size.width = that.size.height * that.aspectRatio;
        }
Severity: Major
Found in app/assets/javascripts/translation_center/jquery-ui.js and 1 other location - About 2 hrs to fix
app/assets/javascripts/translation_center/jquery-ui.js on lines 2822..2825

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

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

    _create: function() {
        this.activeMenu = this.element;
        this.element
            .uniqueId()
            .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
Severity: Major
Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

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

            $.extend(this.offset, {
                click: { //Where the click happened, relative to the element
                    left: event.pageX - this.offset.left,
                    top: event.pageY - this.offset.top
                },
    Severity: Major
    Found in app/assets/javascripts/translation_center/jquery-ui.js and 1 other location - About 2 hrs to fix
    app/assets/javascripts/translation_center/jquery-ui.js on lines 3306..3313

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

    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

            $.extend(this.offset, {
                click: { //Where the click happened, relative to the element
                    left: event.pageX - this.offset.left,
                    top: event.pageY - this.offset.top
                },
    Severity: Major
    Found in app/assets/javascripts/translation_center/jquery-ui.js and 1 other location - About 2 hrs to fix
    app/assets/javascripts/translation_center/jquery-ui.js on lines 1139..1146

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

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

    $.widget = function( name, base, prototype ) {
        var fullName, existingConstructor, constructor, basePrototype,
            namespace = name.split( "." )[ 0 ];
    
        name = name.split( "." )[ 1 ];
    Severity: Major
    Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

      Function formatDate has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          formatDate: function (format, date, settings) {
              if (!date)
                  return '';
              var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
              var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
      Severity: Major
      Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

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

          , getTitle: function () {
              var title
                , $e = this.$element
                , o = this.options
        
        
        Severity: Major
        Found in app/assets/javascripts/translation_center/bootstrap.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/translation_center/bootstrap.js on lines 1281..1290

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

        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

          , getContent: function () {
              var content
                , $e = this.$element
                , o = this.options
        
        
        Severity: Major
        Found in app/assets/javascripts/translation_center/bootstrap.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/translation_center/bootstrap.js on lines 1153..1162

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

        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

            _activate: function(event) {
                var draggable = $.ui.ddmanager.current;
                if(this.options.activeClass) this.element.addClass(this.options.activeClass);
                (draggable && this._trigger('activate', event, this.ui(draggable)));
            },
        Severity: Major
        Found in app/assets/javascripts/translation_center/jquery-ui.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/translation_center/jquery-ui.js on lines 1910..1914

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

        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

            _deactivate: function(event) {
                var draggable = $.ui.ddmanager.current;
                if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
                (draggable && this._trigger('deactivate', event, this.ui(draggable)));
            },
        Severity: Major
        Found in app/assets/javascripts/translation_center/jquery-ui.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/translation_center/jquery-ui.js on lines 1904..1908

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

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

            _mouseDrag: function(event) {
                var that = this;
                this.dragged = true;
        
                if (this.options.disabled)
        Severity: Major
        Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

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

                  if (that._helper && !o.animate && (/static/).test(ce.css('position')))
                      $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
          Severity: Major
          Found in app/assets/javascripts/translation_center/jquery-ui.js and 1 other location - About 2 hrs to fix
          app/assets/javascripts/translation_center/jquery-ui.js on lines 2839..2840

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

          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

                  if (that._helper && !o.animate && (/relative/).test(ce.css('position')))
                      $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
          Severity: Major
          Found in app/assets/javascripts/translation_center/jquery-ui.js and 1 other location - About 2 hrs to fix
          app/assets/javascripts/translation_center/jquery-ui.js on lines 2842..2843

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

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

              _doKeyDown: function(event) {
                  var inst = $.datepicker._getInst(event.target);
                  var handled = true;
                  var isRTL = inst.dpDiv.is('.ui-datepicker-rtl');
                  inst._keyEvent = true;
          Severity: Major
          Found in app/assets/javascripts/translation_center/jquery-ui.js - About 2 hrs to fix

            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

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

                          this.element.siblings( ":visible" ).each(function() {
                              var elem = $( this ),
                                  position = elem.css( "position" );
              
                              if ( position === "absolute" || position === "fixed" ) {
              Severity: Major
              Found in app/assets/javascripts/translation_center/jquery-ui.js and 1 other location - About 2 hrs to fix
              app/assets/javascripts/translation_center/jquery-ui.js on lines 5799..5807

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

              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

                          this.element.siblings( ":visible" ).each(function() {
                              var elem = $( this ),
                                  position = elem.css( "position" );
              
                              if ( position === "absolute" || position === "fixed" ) {
              Severity: Major
              Found in app/assets/javascripts/translation_center/jquery-ui.js and 1 other location - About 2 hrs to fix
              app/assets/javascripts/translation_center/jquery-ui.js on lines 13670..13678

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

              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 _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
                Severity
                Category
                Status
                Source
                Language