wikimedia/mediawiki-core

View on GitHub
resources/lib/ooui/oojs-ui-widgets.js

Summary

Maintainability
F
3 wks
Test Coverage

File oojs-ui-widgets.js has 2564 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * OOUI v0.49.1
 * https://www.mediawiki.org/wiki/OOUI
 *
 * Copyright 2011–2024 OOUI Team and other contributors.
Severity: Major
Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 wk to fix

    Function OoUiTagMultiselectWidget has 103 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    OO.ui.TagMultiselectWidget = function OoUiTagMultiselectWidget( config ) {
        const rAF = window.requestAnimationFrame || setTimeout,
            widget = this,
            $tabFocus = $( '<span>' ).addClass( 'oo-ui-tagMultiselectWidget-focusTrap' );
    
    
    Severity: Major
    Found in resources/lib/ooui/oojs-ui-widgets.js - About 4 hrs to fix

      Function OoUiMenuTagMultiselectWidget has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      OO.ui.MenuTagMultiselectWidget = function OoUiMenuTagMultiselectWidget( config ) {
          let $autoCloseIgnore = $( [] );
      
          config = config || {};
      
      
      Severity: Major
      Found in resources/lib/ooui/oojs-ui-widgets.js - About 2 hrs to fix

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

        OO.ui.BookletLayout = function OoUiBookletLayout( config ) {
            // Configuration initialization
            config = config || {};
        
            // Parent constructor
        Severity: Major
        Found in resources/lib/ooui/oojs-ui-widgets.js - About 2 hrs to fix

          Function OoUiIndexLayout has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          OO.ui.IndexLayout = function OoUiIndexLayout( config ) {
              // Configuration initialization
              config = $.extend( {}, config, { menuPosition: 'top' } );
          
              // Parent constructor
          Severity: Minor
          Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

            Function OoUiOutlineControlsWidget has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            OO.ui.OutlineControlsWidget = function OoUiOutlineControlsWidget( outline, config ) {
                // Allow passing positional parameters inside the config object
                if ( OO.isPlainObject( outline ) && config === undefined ) {
                    config = outline;
                    outline = config.outline;
            Severity: Minor
            Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

              Function updateInputSize has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              OO.ui.TagMultiselectWidget.prototype.updateInputSize = function () {
                  if ( this.inputPosition === 'inline' && !this.isDisabled() ) {
                      if ( this.input.$input[ 0 ].scrollWidth === 0 ) {
                          // Input appears to be attached but not visible.
                          // Don't attempt to adjust its size, because our measurements
              Severity: Minor
              Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

                Function onInputKeyDown has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                OO.ui.TagMultiselectWidget.prototype.onInputKeyDown = function ( e ) {
                    const widget = this,
                        withMetaKey = e.metaKey || e.ctrlKey;
                
                    function isMovementInsideInput( dir ) {
                Severity: Minor
                Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

                  Function setTabPanel has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  OO.ui.IndexLayout.prototype.setTabPanel = function ( name ) {
                      let selectedItem,
                          $focused,
                          previousTabPanel,
                          tabPanel;
                  Severity: Minor
                  Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

                    Function OoUiPopupTagMultiselectWidget has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    OO.ui.PopupTagMultiselectWidget = function OoUiPopupTagMultiselectWidget( config ) {
                        const defaultConfig = { popup: {} };
                    
                        config = config || {};
                    
                    
                    Severity: Minor
                    Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

                      Function getRequestData has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      OO.ui.mixin.RequestManager.prototype.getRequestData = function () {
                          const widget = this,
                              value = this.getRequestQuery(),
                              deferred = $.Deferred();
                      
                      
                      Severity: Minor
                      Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

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

                        OO.ui.BookletLayout.prototype.setPage = function ( name ) {
                            const page = this.pages[ name ];
                            if ( !page || name === this.currentPageName ) {
                                return;
                            }
                        Severity: Minor
                        Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

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

                          OO.ui.IndexLayout.prototype.addTabPanels = function ( tabPanels, index ) {
                              let i, len, name, tabPanel, tabItem, currentIndex;
                              const stackLayoutTabPanels = this.stackLayout.getItems(),
                                  remove = [],
                                  tabItems = [];
                          Severity: Minor
                          Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

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

                            OO.ui.BookletLayout.prototype.addPages = function ( pages, index ) {
                                const stackLayoutPages = this.stackLayout.getItems(),
                                    remove = [],
                                    items = [];
                            
                            
                            Severity: Minor
                            Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

                              Function OoUiMixinLookupElement has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              OO.ui.mixin.LookupElement = function OoUiMixinLookupElement( config ) {
                                  // Configuration initialization
                                  config = $.extend( { highlightFirst: true }, config );
                              
                                  // Mixin constructors
                              Severity: Minor
                              Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

                                Function onKeyDown has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                OO.ui.TagItemWidget.prototype.onKeyDown = function ( e ) {
                                    if (
                                        !this.isDisabled() &&
                                        !this.isFixed() &&
                                        ( e.keyCode === OO.ui.Keys.BACKSPACE || e.keyCode === OO.ui.Keys.DELETE )
                                Severity: Minor
                                Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

                                  Function OoUiTagItemWidget has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  OO.ui.TagItemWidget = function OoUiTagItemWidget( config ) {
                                      config = config || {};
                                  
                                      // Parent constructor
                                      OO.ui.TagItemWidget.super.call( this, config );
                                  Severity: Minor
                                  Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

                                    Function OoUiMenuLayout has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    OO.ui.MenuLayout = function OoUiMenuLayout( config ) {
                                        // Configuration initialization
                                        config = $.extend( {
                                            expanded: true,
                                            showMenu: true,
                                    Severity: Minor
                                    Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

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

                                      OO.ui.mixin.LookupElement.prototype.populateLookupMenu = function () {
                                          const widget = this,
                                              value = this.getValue();
                                      
                                          if ( this.lookupsDisabled || this.isReadOnly() ) {
                                      Severity: Minor
                                      Found in resources/lib/ooui/oojs-ui-widgets.js - About 1 hr to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if ( $focused.length ) {
                                                                $focused[ 0 ].blur();
                                                            }
                                        Severity: Major
                                        Found in resources/lib/ooui/oojs-ui-widgets.js - About 45 mins to fix

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

                                          OO.ui.OutlineSelectWidget = function OoUiOutlineSelectWidget( config ) {
                                              // Parent constructor
                                              OO.ui.OutlineSelectWidget.super.call( this, config );
                                          
                                              // Mixin constructors
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 5 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3676..3691

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

                                          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

                                          OO.ui.ButtonSelectWidget = function OoUiButtonSelectWidget( config ) {
                                              // Parent constructor
                                              OO.ui.ButtonSelectWidget.super.call( this, config );
                                          
                                              // Mixin constructors
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 5 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3542..3557

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

                                          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 ( previousPage ) {
                                                  previousPage.setActive( false );
                                                  // Blur anything focused if the next page doesn't have anything focusable.
                                                  // This is not needed if the next page has something focusable (because once it is
                                                  // focused this blur happens automatically). If the layout is non-continuous, this
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 5 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2943..2961

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

                                          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 ( previousTabPanel ) {
                                                          previousTabPanel.setActive( false );
                                                          // Blur anything focused if the next tab panel doesn't have anything focusable.
                                                          // This is not needed if the next tab panel has something focusable (because once
                                                          // it is focused this blur happens automatically). If the layout is non-continuous,
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 5 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2408..2425

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

                                          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

                                          OO.ui.BookletLayout.prototype.onStackLayoutFocus = function ( e ) {
                                              // Find the page that an element was focused within
                                              const $target = $( e.target ).closest( '.oo-ui-pageLayout' );
                                              for ( const name in this.pages ) {
                                                  // Check for page match, exclude current page to find only page changes
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 5 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2627..2638

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

                                          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

                                          OO.ui.IndexLayout.prototype.onStackLayoutFocus = function ( e ) {
                                              // Find the tab panel that an element was focused within
                                              const $target = $( e.target ).closest( '.oo-ui-tabPanelLayout' );
                                              for ( const name in this.tabPanels ) {
                                                  // Check for tab panel match, exclude current tab panel to find only tab panel changes
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 5 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2029..2039

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

                                          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

                                          OO.ui.TagMultiselectWidget.prototype.toggleValid = function ( valid ) {
                                              valid = valid === undefined ? !this.valid : !!valid;
                                          
                                              if ( this.valid !== valid ) {
                                                  this.valid = valid;
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 4 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 4216..4226

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

                                          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

                                          OO.ui.TagItemWidget.prototype.toggleValid = function ( valid ) {
                                              valid = valid === undefined ? !this.valid : !!valid;
                                          
                                              if ( this.valid !== valid ) {
                                                  this.valid = valid;
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 4 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 5149..5159

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

                                          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

                                          OO.ui.BookletLayout.prototype.selectFirstSelectablePage = function () {
                                              if ( !this.outlineSelectWidget.findSelectedItem() ) {
                                                  this.outlineSelectWidget.selectItem( this.outlineSelectWidget.findFirstSelectableItem() );
                                              }
                                          
                                          
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 2 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2985..2991

                                          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

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

                                          OO.ui.IndexLayout.prototype.selectFirstSelectableTabPanel = function () {
                                              if ( !this.tabSelectWidget.findSelectedItem() ) {
                                                  this.tabSelectWidget.selectItem( this.tabSelectWidget.findFirstSelectableItem() );
                                              }
                                          
                                          
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 2 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2467..2473

                                          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

                                                      if ( OO.ui.Element.static.getDir( this.$element ) === 'rtl' ) {
                                                          movement = {
                                                              left: 'forwards',
                                                              right: 'backwards'
                                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 2 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 4178..4188

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

                                          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 ( OO.ui.Element.static.getDir( this.$element ) === 'rtl' ) {
                                                      movement = {
                                                          left: 'forwards',
                                                          right: 'backwards'
                                                      };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 2 hrs to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 4543..4553

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

                                          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 ( !this.stackLayout.isContinuous() && previousPage ) {
                                                  // This should not be necessary, since any inputs on the previous page should have
                                                  // been blurred when it was hidden, but browsers are not very consistent about
                                                  // this.
                                                  $focused = previousPage.$element.find( ':focus' );
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2965..2973

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

                                          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 ( !this.stackLayout.isContinuous() && previousTabPanel ) {
                                                          // This should not be necessary, since any inputs on the previous tab panel should
                                                          // have been blurred when it was hidden, but browsers are not very consistent about
                                                          // this.
                                                          $focused = previousTabPanel.$element.find( ':focus' );
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2428..2436

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

                                          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 (
                                                  !this.isDisabled() &&
                                                  !this.isFixed() &&
                                                  ( e.keyCode === OO.ui.Keys.BACKSPACE || e.keyCode === OO.ui.Keys.DELETE )
                                              ) {
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js on lines 537..542

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

                                          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

                                              this.$input.on( {
                                                  focus: this.onLookupInputFocus.bind( this ),
                                                  blur: this.onLookupInputBlur.bind( this ),
                                                  mousedown: this.onLookupInputMouseDown.bind( this )
                                              } );
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 11530..11534

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

                                          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

                                          OO.ui.PageLayout.prototype.setOutlineItem = function ( outlineItem ) {
                                              this.outlineItem = outlineItem || null;
                                              if ( outlineItem ) {
                                                  this.setupOutlineItem();
                                              }
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 1124..1130

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

                                          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

                                          OO.ui.TabPanelLayout.prototype.setTabItem = function ( tabItem ) {
                                              this.tabItem = tabItem || null;
                                              if ( tabItem ) {
                                                  this.setupTabItem();
                                              }
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 1275..1281

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

                                          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

                                          OO.ui.MenuLayout.prototype.setContentPanel = function ( contentPanel ) {
                                              this.contentPanel = contentPanel;
                                              this.$content.append( this.contentPanel.$element );
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 1825..1828

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

                                          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

                                          OO.ui.MenuLayout.prototype.setMenuPanel = function ( menuPanel ) {
                                              this.menuPanel = menuPanel;
                                              this.$menu.append( this.menuPanel.$element );
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 1835..1838

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

                                          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

                                          OO.ui.TagMultiselectWidget.prototype.checkValidity = function () {
                                              return this.getItems().every( function ( item ) {
                                                  return item.isValid();
                                              } );
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 8558..8562

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

                                          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

                                          OO.ui.MenuTagMultiselectWidget.prototype.createMenuOptionWidget = function ( data, label, icon ) {
                                              return new OO.ui.MenuOptionWidget( {
                                                  data: data,
                                                  label: label || data,
                                                  icon: icon
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/src/mediawiki.widgets/mw.widgets.NamespacesMultiselectWidget.js on lines 91..97

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

                                          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

                                          OO.ui.IndexLayout.prototype.getCurrentTabPanel = function () {
                                              const name = this.getCurrentTabPanelName();
                                              return name ? this.getTabPanel( name ) : undefined;
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2246..2249

                                          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

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

                                          OO.ui.BookletLayout.prototype.getCurrentPage = function () {
                                              const name = this.getCurrentPageName();
                                              return name ? this.getPage( name ) : undefined;
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2792..2795

                                          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

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

                                          OO.ui.BookletLayout.prototype.focusFirstFocusable = function () {
                                              OO.ui.findFocusable( this.stackLayout.$element ).focus();
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2719..2721

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

                                          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

                                          OO.ui.IndexLayout.prototype.focusFirstFocusable = function () {
                                              OO.ui.findFocusable( this.stackLayout.$element ).focus();
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2104..2106

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

                                          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

                                          OO.ui.OutlineOptionWidget.prototype.setRemovable = function ( removable ) {
                                              this.removable = !!removable;
                                              this.updateThemeClasses();
                                              return this;
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3480..3484

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

                                          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

                                          OO.ui.OutlineOptionWidget.prototype.setMovable = function ( movable ) {
                                              this.movable = !!movable;
                                              this.updateThemeClasses();
                                              return this;
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3495..3499

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

                                          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

                                          OO.ui.IndexLayout.prototype.onTabSelectWidgetSelect = function ( item ) {
                                              if ( item ) {
                                                  this.setTabPanel( item.getData() );
                                              }
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2114..2118

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

                                          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

                                          OO.ui.BookletLayout.prototype.onOutlineSelectWidgetSelect = function ( item ) {
                                              if ( item ) {
                                                  this.setPage( item.getData() );
                                              }
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2729..2733

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

                                          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

                                          OO.ui.MenuLayout.prototype.clearContentPanel = function () {
                                              this.contentPanel = null;
                                              this.$content.empty();
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 1843..1846

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

                                          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

                                          OO.ui.MenuLayout.prototype.clearMenuPanel = function () {
                                              this.menuPanel = null;
                                              this.$menu.empty();
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 1 hr to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 1851..1854

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

                                          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 ( !OO.ui.contains( page.$element[ 0 ], this.getElementDocument().activeElement, true ) ) {
                                                  page.focus();
                                              }
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 55 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2706..2712

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

                                          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 ( !OO.ui.contains(
                                                  tabPanel.$element[ 0 ],
                                                  this.getElementDocument().activeElement,
                                                  true
                                              ) ) {
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 55 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2095..2097

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

                                          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 ( itemIndex !== undefined && items[ itemIndex ] ) {
                                                  page = items[ itemIndex ];
                                              } else {
                                                  page = this.stackLayout.getCurrentItem();
                                              }
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 50 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2692..2696

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

                                          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 ( itemIndex !== undefined && items[ itemIndex ] ) {
                                                  tabPanel = items[ itemIndex ];
                                              } else {
                                                  tabPanel = this.stackLayout.getCurrentItem();
                                              }
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 50 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2081..2085

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

                                          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 3 locations. Consider refactoring.
                                          Open

                                              this.removeButton = new OO.ui.ButtonWidget( {
                                                  framed: false,
                                                  icon: 'trash',
                                                  title: OO.ui.msg( 'ooui-outline-control-remove' )
                                              } );
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 2 other locations - About 50 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3263..3267
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3268..3272

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

                                          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 3 locations. Consider refactoring.
                                          Open

                                          OO.ui.TagMultiselectWidget.prototype.onTagRemove = function ( item ) {
                                              this.removeTagByData( item.getData() );
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 2 other locations - About 50 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 11101..11103
                                          resources/lib/ooui/oojs-ui-core.js on lines 12693..12695

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

                                          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 3 locations. Consider refactoring.
                                          Open

                                              this.downButton = new OO.ui.ButtonWidget( {
                                                  framed: false,
                                                  icon: 'downTriangle',
                                                  title: OO.ui.msg( 'ooui-outline-control-move-down' )
                                              } );
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 2 other locations - About 50 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3263..3267
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3273..3277

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

                                          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 3 locations. Consider refactoring.
                                          Open

                                              this.upButton = new OO.ui.ButtonWidget( {
                                                  framed: false,
                                                  icon: 'upTriangle',
                                                  title: OO.ui.msg( 'ooui-outline-control-move-up' )
                                              } );
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 2 other locations - About 50 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3268..3272
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3273..3277

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

                                          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

                                              this.$overlay = ( config.$overlay === true ?
                                                  OO.ui.getDefaultOverlay() : config.$overlay ) || this.$element;
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 45 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 12550..12551

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

                                          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 3 locations. Consider refactoring.
                                          Open

                                          OO.ui.ButtonMenuSelectWidget.prototype.onMenuToggle = function ( isVisible ) {
                                              this.$element.toggleClass( 'oo-ui-buttonElement-pressed', isVisible );
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 2 other locations - About 40 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 9060..9062
                                          resources/lib/ooui/oojs-ui-core.js on lines 12717..12719

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

                                          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

                                              this.$movers
                                                  .addClass( 'oo-ui-outlineControlsWidget-movers' )
                                                  .append( this.upButton.$element, this.downButton.$element, this.removeButton.$element );
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 40 mins to fix
                                          resources/src/mediawiki.widgets/mw.widgets.SizeFilterWidget.js on lines 52..58

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

                                          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 3 locations. Consider refactoring.
                                          Open

                                              this.$overlay = ( config.$overlay === true ?
                                                  OO.ui.getDefaultOverlay() : config.$overlay ) || this.$element;
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 2 other locations - About 40 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 5213..5214
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 5396..5397

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

                                          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 3 locations. Consider refactoring.
                                          Open

                                              this.$overlay = ( config.$overlay === true ?
                                                  OO.ui.getDefaultOverlay() : config.$overlay ) || this.$element;
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 2 other locations - About 40 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3907..3908
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 5213..5214

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

                                          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 3 locations. Consider refactoring.
                                          Open

                                              this.$overlay = ( config.$overlay === true ?
                                                  OO.ui.getDefaultOverlay() : config.$overlay ) || this.$element;
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 2 other locations - About 40 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3907..3908
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 5396..5397

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

                                          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

                                          OO.ui.MenuTagMultiselectWidget.prototype.createMenuWidget = function ( menuConfig ) {
                                              return new OO.ui.MenuSelectWidget( menuConfig );
                                          };
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 40 mins to fix
                                          resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js on lines 472..474

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

                                          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 4 locations. Consider refactoring.
                                          Open

                                              OO.ui.mixin.GroupElement.call( this, $.extend( { $group: this.$element }, config ) );
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 3 other locations - About 35 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 7132..7134
                                          resources/lib/ooui/oojs-ui-core.js on lines 13497..13497
                                          resources/lib/ooui/oojs-ui-core.js on lines 13671..13671

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

                                          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 3 locations. Consider refactoring.
                                          Open

                                          OO.ui.MenuTagMultiselectWidget.prototype.onInputChange = function () {
                                              this.menu.toggle( true );
                                          };
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 2 other locations - About 35 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 9109..9111
                                          resources/lib/ooui/oojs-ui-core.js on lines 9119..9121

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

                                          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 ( this.autoFocus ) {
                                                  // Event 'focus' does not bubble, but 'focusin' does.
                                                  this.stackLayout.$element.on( 'focusin', this.onStackLayoutFocus.bind( this ) );
                                              }
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 35 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 1971..1974

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

                                          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 ( this.autoFocus ) {
                                                  // Event 'focus' does not bubble, but 'focusin' does
                                                  this.stackLayout.$element.on( 'focusin', this.onStackLayoutFocus.bind( this ) );
                                              }
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 35 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 2574..2577

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

                                          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 6 locations. Consider refactoring.
                                          Open

                                          OO.ui.ButtonMenuSelectWidget.prototype.onButtonMenuClick = function () {
                                              this.menu.toggle();
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 5 other locations - About 35 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 9571..9573
                                          resources/lib/ooui/oojs-ui-core.js on lines 12958..12960
                                          resources/src/mediawiki.widgets/Table/mw.widgets.RowWidget.js on lines 232..234
                                          resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 243..245
                                          resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 250..252

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

                                          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 6 locations. Consider refactoring.
                                          Open

                                              } else if (
                                                  e.keyCode === OO.ui.Keys.LEFT ||
                                                  e.keyCode === OO.ui.Keys.RIGHT
                                              ) {
                                                  let movement;
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 5 other locations - About 35 mins to fix
                                          resources/lib/jquery.ui/jquery.ui.button.js on lines 191..193
                                          resources/lib/ooui/oojs-ui-core.js on lines 7435..7435
                                          resources/lib/ooui/oojs-ui-core.js on lines 9585..9589
                                          resources/lib/ooui/oojs-ui-core.js on lines 9587..9589
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 4538..4560

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

                                          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 5 locations. Consider refactoring.
                                          Open

                                          OO.ui.mixin.LookupElement.prototype.abortLookupRequest = function () {
                                              this.abortRequest();
                                          };
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 4 other locations - About 35 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 2143..2145
                                          resources/lib/ooui/oojs-ui-core.js on lines 2231..2233
                                          resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js on lines 589..591
                                          resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js on lines 713..715

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

                                          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 6 locations. Consider refactoring.
                                          Open

                                                  } else if (
                                                      e.keyCode === OO.ui.Keys.LEFT ||
                                                      e.keyCode === OO.ui.Keys.RIGHT
                                                  ) {
                                                      let movement;
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 5 other locations - About 35 mins to fix
                                          resources/lib/jquery.ui/jquery.ui.button.js on lines 191..193
                                          resources/lib/ooui/oojs-ui-core.js on lines 7435..7435
                                          resources/lib/ooui/oojs-ui-core.js on lines 9585..9589
                                          resources/lib/ooui/oojs-ui-core.js on lines 9587..9589
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 4172..4196

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

                                          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

                                          OO.ui.mixin.LookupElement.prototype.getRequest = function () {
                                              return this.getLookupRequest();
                                          };
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 35 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 990..992

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

                                          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

                                          OO.ui.mixin.LookupElement.prototype.getRequestQuery = function () {
                                              return this.getValue();
                                          };
                                          Severity: Minor
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 35 mins to fix
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 997..999

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

                                          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 8 locations. Consider refactoring.
                                          Open

                                              OO.ui.mixin.ButtonElement.call( this, $.extend( {
                                                  active: this.active
                                              }, config ) );
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 7 other locations - About 30 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 4252..4254
                                          resources/lib/ooui/oojs-ui-core.js on lines 4338..4340
                                          resources/lib/ooui/oojs-ui-core.js on lines 4413..4415
                                          resources/lib/ooui/oojs-ui-core.js on lines 4494..4496
                                          resources/lib/ooui/oojs-ui-core.js on lines 8407..8407
                                          resources/lib/ooui/oojs-ui-core.js on lines 9910..9912
                                          resources/lib/ooui/oojs-ui-core.js on lines 10224..10226

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

                                          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 13 locations. Consider refactoring.
                                          Open

                                              if ( OO.isPlainObject( name ) && config === undefined ) {
                                                  config = name;
                                                  name = config.name;
                                              }
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 12 other locations - About 30 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 12848..12851
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 701..704
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1097..1100
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1702..1705
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1803..1806
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1996..1999
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 2059..2062
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 2513..2516
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 2752..2755
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 1193..1196
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3246..3249
                                          resources/lib/ooui/oojs-ui-windows.js on lines 637..640

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

                                          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 13 locations. Consider refactoring.
                                          Open

                                              if ( OO.isPlainObject( outline ) && config === undefined ) {
                                                  config = outline;
                                                  outline = config.outline;
                                              }
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 12 other locations - About 30 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 12848..12851
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 701..704
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1097..1100
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1702..1705
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1803..1806
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1996..1999
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 2059..2062
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 2513..2516
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 2752..2755
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 1029..1032
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 1193..1196
                                          resources/lib/ooui/oojs-ui-windows.js on lines 637..640

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

                                          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 8 locations. Consider refactoring.
                                          Open

                                              OO.ui.mixin.TabIndexedElement.call( this, $.extend( {
                                                  $tabIndexed: this.$button
                                              }, config ) );
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 7 other locations - About 30 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 3992..3994
                                          resources/lib/ooui/oojs-ui-core.js on lines 4348..4350
                                          resources/lib/ooui/oojs-ui-core.js on lines 8964..8966
                                          resources/lib/ooui/oojs-ui-core.js on lines 9916..9918
                                          resources/lib/ooui/oojs-ui-core.js on lines 12874..12874
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 731..733
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 2097..2099

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

                                          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 13 locations. Consider refactoring.
                                          Open

                                              if ( OO.isPlainObject( name ) && config === undefined ) {
                                                  config = name;
                                                  name = config.name;
                                              }
                                          Severity: Major
                                          Found in resources/lib/ooui/oojs-ui-widgets.js and 12 other locations - About 30 mins to fix
                                          resources/lib/ooui/oojs-ui-core.js on lines 12848..12851
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 701..704
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1097..1100
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1702..1705
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1803..1806
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 1996..1999
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 2059..2062
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 2513..2516
                                          resources/lib/ooui/oojs-ui-toolbars.js on lines 2752..2755
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 1029..1032
                                          resources/lib/ooui/oojs-ui-widgets.js on lines 3246..3249
                                          resources/lib/ooui/oojs-ui-windows.js on lines 637..640

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

                                          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

                                          There are no issues that match your filters.

                                          Category
                                          Status