WordPress/WordPress

View on GitHub
wp-admin/js/customize-controls.js

Summary

Maintainability
F
1 mo
Test Coverage

File customize-controls.js has 5805 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @output wp-admin/js/customize-controls.js
 */

/* global _wpCustomizeHeader, _wpCustomizeBackground, _wpMediaViewsL10n, MediaElementPlayer, console, confirm */
Severity: Major
Found in wp-admin/js/customize-controls.js - About 2 wks to fix

    Function save has 188 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                save: function( args ) {
                    var previewer = this,
                        deferred = $.Deferred(),
                        changesetStatus = api.state( 'selectedChangesetStatus' ).get(),
                        selectedChangesetDate = api.state( 'selectedChangesetDate' ).get(),
    Severity: Major
    Found in wp-admin/js/customize-controls.js - About 7 hrs to fix

      Function initStickyHeaders has 144 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              (function initStickyHeaders() {
                  var parentContainer = $( '.wp-full-overlay-sidebar-content' ),
                      changeContainer, updateHeaderHeight, releaseStickyHeader, resetStickyHeader, positionStickyHeader,
                      activeHeader, lastScrollTop;
      
      
      Severity: Major
      Found in wp-admin/js/customize-controls.js - About 5 hrs to fix

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

                initialize: function( id, options ) {
                    var control = this, deferredSettingIds = [], settings, gatherSettings;
        
                    control.params = _.extend(
                        {},
        Severity: Major
        Found in wp-admin/js/customize-controls.js - About 4 hrs to fix

          Function checkAndDisplayLockNotice has 102 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  ( function checkAndDisplayLockNotice() {
          
                      var LockedNotification = api.OverlayNotification.extend(/** @lends wp.customize~LockedNotification.prototype */{
          
                          /**
          Severity: Major
          Found in wp-admin/js/customize-controls.js - About 4 hrs to fix

            Function initialize has 98 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    initialize: function( params, options ) {
                        var previewer = this,
                            urlParser = document.createElement( 'a' );
            
                        $.extend( previewer, options || {} );
            Severity: Major
            Found in wp-admin/js/customize-controls.js - About 3 hrs to fix

              Function run has 95 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      run: function( deferred ) {
                          var previewFrame = this,
                              loaded = false,
                              ready = false,
                              readyData = null,
              Severity: Major
              Found in wp-admin/js/customize-controls.js - About 3 hrs to fix

                Function attachEvents has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        attachEvents: function () {
                            var section = this, debounced;
                
                            // Expand/Collapse accordion sections on click.
                            section.container.find( '.customize-section-back' ).on( 'click keydown', function( event ) {
                Severity: Major
                Found in wp-admin/js/customize-controls.js - About 3 hrs to fix

                  Function requestChangesetUpdate has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      api.requestChangesetUpdate = function requestChangesetUpdate( changes, args ) {
                          var deferred, request, submittedChanges = {}, data, submittedArgs;
                          deferred = new $.Deferred();
                  
                          // Prevent attempting changeset update while request is being made.
                  Severity: Major
                  Found in wp-admin/js/customize-controls.js - About 3 hrs to fix

                    Function loadThemes has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            loadThemes: function() {
                                var section = this, params, page, request;
                    
                                if ( section.loading ) {
                                    return; // We're already loading a batch of themes.
                    Severity: Major
                    Found in wp-admin/js/customize-controls.js - About 3 hrs to fix

                      Function onChangeExpanded has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              onChangeExpanded: function ( expanded, args ) {
                                  var section = this,
                                      container = section.headContainer.closest( '.wp-full-overlay-sidebar-content' ),
                                      content = section.contentContainer,
                                      overlay = section.headContainer.closest( '.wp-full-overlay' ),
                      Severity: Major
                      Found in wp-admin/js/customize-controls.js - About 2 hrs to fix

                        Function installTheme has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                installTheme: function( event ) {
                                    var panel = this, preview, onInstallSuccess, slug = $( event.target ).data( 'slug' ), deferred = $.Deferred(), request;
                                    preview = $( event.target ).hasClass( 'preview' );
                        
                                    // Temporary since supplying SFTP credentials does not work yet. See #42184.
                        Severity: Major
                        Found in wp-admin/js/customize-controls.js - About 2 hrs to fix

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

                                  onChangeExpanded: function ( expanded, args ) {
                          
                                      // Immediately call the complete callback if there were no changes.
                                      if ( args.unchanged ) {
                                          if ( args.completeCallback ) {
                          Severity: Major
                          Found in wp-admin/js/customize-controls.js - About 2 hrs to fix

                            Function render has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    render: function() {
                                        var collection = this,
                                            notifications, hadOverlayNotification = false, hasOverlayNotification, overlayNotifications = [],
                                            previousNotificationsByCode = {},
                                            listElement, focusableElements;
                            Severity: Major
                            Found in wp-admin/js/customize-controls.js - About 2 hrs to fix

                              Function onChangeExpanded has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      onChangeExpanded: function( expanded, args ) {
                                          var section = this,
                                              container = section.headContainer.closest( '.wp-full-overlay-sidebar-content' ),
                                              content = section.contentContainer,
                                              backBtn = content.find( '.customize-section-back' ),
                              Severity: Major
                              Found in wp-admin/js/customize-controls.js - About 2 hrs to fix

                                Function onChangeExpanded has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        onChangeExpanded: function ( expanded, args ) {
                                
                                            // Note: there is a second argument 'args' passed.
                                            var section = this,
                                                container = section.contentContainer.closest( '.customize-themes-full-container' );
                                Severity: Major
                                Found in wp-admin/js/customize-controls.js - About 2 hrs to fix

                                  Function reflowPaneContents has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      api.reflowPaneContents = _.bind( function () {
                                  
                                          var appendContainer, activeElement, rootHeadContainers, rootNodes = [], wasReflowed = false;
                                  
                                          if ( document.activeElement ) {
                                  Severity: Major
                                  Found in wp-admin/js/customize-controls.js - About 2 hrs to fix

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

                                            initialize: function ( id, options ) {
                                                var container = this;
                                                container.id = id;
                                    
                                                if ( ! Container.instanceCounter ) {
                                    Severity: Major
                                    Found in wp-admin/js/customize-controls.js - About 2 hrs to fix

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

                                              calculateImageSelectOptions: function(attachment, controller) {
                                                  var xInit = parseInt(_wpCustomizeHeader.data.width, 10),
                                                      yInit = parseInt(_wpCustomizeHeader.data.height, 10),
                                                      flexWidth = !! parseInt(_wpCustomizeHeader.data['flex-width'], 10),
                                                      flexHeight = !! parseInt(_wpCustomizeHeader.data['flex-height'], 10),
                                      Severity: Minor
                                      Found in wp-admin/js/customize-controls.js - About 2 hrs to fix

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

                                                loadThemePreview: function( themeId ) {
                                                    var panel = this, deferred = $.Deferred(), onceProcessingComplete, urlParser, queryParams;
                                        
                                                    // Prevent loading a non-active theme preview when there is a drafted/scheduled changeset.
                                                    if ( ! panel.canSwitchTheme( themeId ) ) {
                                        Severity: Minor
                                        Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                          Function _animateChangeExpanded has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                                  _animateChangeExpanded: function( completeCallback ) {
                                                      // Return if CSS transitions are not supported or if reduced motion is enabled.
                                                      if ( ! normalizedTransitionendEventName || isReducedMotion ) {
                                                          // Schedule the callback until the next tick to prevent focus loss.
                                                          _.defer( function () {
                                          Severity: Minor
                                          Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                            Function trash has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                        trash: function trash() {
                                                            var request, success, fail;
                                            
                                                            api.state( 'trashing' ).set( true );
                                                            api.state( 'processing' ).set( api.state( 'processing' ).get() + 1 );
                                            Severity: Minor
                                            Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                              Function refresh has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                      refresh: function() {
                                                          var previewer = this, onSettingChange;
                                              
                                                          // Display loading indicator.
                                                          previewer.send( 'loading-initiated' );
                                              Severity: Minor
                                              Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                Function calculateImageSelectOptions has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                        calculateImageSelectOptions: function( attachment, controller ) {
                                                            var control    = controller.get( 'control' ),
                                                                flexWidth  = !! parseInt( control.params.flex_width, 10 ),
                                                                flexHeight = !! parseInt( control.params.flex_height, 10 ),
                                                                realWidth  = attachment.get( 'width' ),
                                                Severity: Minor
                                                Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                  Function ready has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                          ready: function ready() {
                                                              var control = this, element, component, node, url, input, button;
                                                  
                                                              _.bindAll( control, 'updatePreviewLink' );
                                                  
                                                  
                                                  Severity: Minor
                                                  Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                    Function ready has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                            ready: function() {
                                                                var control = this,
                                                                    isHueSlider = this.params.mode === 'hue',
                                                                    updating = false,
                                                                    picker;
                                                    Severity: Minor
                                                    Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                      Function handleSettingValidities has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          api._handleSettingValidities = function handleSettingValidities( args ) {
                                                              var invalidSettingControls, invalidSettings = [], wasFocused = false;
                                                      
                                                              // Find the controls that correspond to each invalid setting.
                                                              _.each( args.settingValidities, function( validity, settingId ) {
                                                      Severity: Minor
                                                      Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                        Function render has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                                        render: function() {
                                                                            var notification = this, li, data, takeOverButton, request;
                                                                            data = _.extend(
                                                                                {
                                                                                    allowOverride: false,
                                                        Severity: Minor
                                                        Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                  ready: function() {
                                                                      var control = this, panel = api.panel( 'themes' );
                                                          
                                                                      function disableSwitchButtons() {
                                                                          return ! panel.canSwitchTheme( control.params.theme.id );
                                                          Severity: Minor
                                                          Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                    ready: function() {
                                                                        var control = this;
                                                                        // Shortcut so that we don't have to use _.bind every time we add a callback.
                                                                        _.bindAll( control, 'restoreDefault', 'removeFile', 'openFrame', 'select', 'pausePlayer' );
                                                            
                                                            
                                                            Severity: Minor
                                                            Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                      setupNotifications: function() {
                                                                          var control = this, renderNotificationsIfVisible, onSectionAssigned;
                                                              
                                                                          // Add setting notifications to the control notification.
                                                                          _.each( control.settings, function( setting ) {
                                                              Severity: Minor
                                                              Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                Function onChangeActive has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                        onChangeActive: function( active, args ) {
                                                                            var construct = this,
                                                                                headContainer = construct.headContainer,
                                                                                duration, expandedOtherPanel;
                                                                
                                                                
                                                                Severity: Minor
                                                                Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                  Function addNewPage has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                          addNewPage: function () {
                                                                              var control = this, promise, toggle, container, input, title, select;
                                                                  
                                                                              if ( 'dropdown-pages' !== control.params.type || ! control.params.allow_addition || ! api.Menus ) {
                                                                                  return;
                                                                  Severity: Minor
                                                                  Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                    Function attachEvents has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                            attachEvents: function() {
                                                                                var panel = this;
                                                                    
                                                                                // Attach regular panel events.
                                                                                api.Panel.prototype.attachEvents.apply( panel );
                                                                    Severity: Minor
                                                                    Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                      Function renderContent has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                              renderContent: function () {
                                                                                  var control = this, template, standardTypes, templateId, sectionId;
                                                                      
                                                                                  standardTypes = [
                                                                                      'button',
                                                                      Severity: Minor
                                                                      Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                        Function attachEvents has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                                attachEvents: function () {
                                                                                    var meta, panel = this;
                                                                        
                                                                                    // Expand/Collapse accordion sections on click.
                                                                                    panel.headContainer.find( '.accordion-section-title' ).on( 'click keydown', function( event ) {
                                                                        Severity: Minor
                                                                        Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                                  ready: function ready() {
                                                                                      var control = this;
                                                                          
                                                                                      control.inputElements = {};
                                                                                      control.invalidDate = false;
                                                                          Severity: Minor
                                                                          Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                                    validateInputs: function validateInputs() {
                                                                                        var control = this, components, validityInput;
                                                                            
                                                                                        control.invalidDate = false;
                                                                            
                                                                            
                                                                            Severity: Minor
                                                                            Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                                      ready: function( data ) {
                                                                                          var previewer = this, synced = {}, constructs;
                                                                              
                                                                                          synced.settings = api.get();
                                                                                          synced['settings-modified-while-loading'] = previewer.settingsModifiedWhileLoading;
                                                                              Severity: Minor
                                                                              Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                                        function startAutosaving() {
                                                                                            var timeoutId, updateChangesetWithReschedule, scheduleChangesetUpdate, updatePending = false;
                                                                                
                                                                                            api.unbind( 'change', startAutosaving ); // Ensure startAutosaving only fires once.
                                                                                
                                                                                
                                                                                Severity: Minor
                                                                                Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                                          initSyntaxHighlightingEditor: function( codeEditorSettings ) {
                                                                                              var control = this, $textarea = control.container.find( 'textarea' ), settings, suspendEditorUpdate = false;
                                                                                  
                                                                                              settings = _.extend( {}, codeEditorSettings, {
                                                                                                  onTabNext: _.bind( control.onTabNext, control ),
                                                                                  Severity: Minor
                                                                                  Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                                                function requestClose() {
                                                                                                    var clearedToClose = $.Deferred(), dismissAutoSave = false, dismissLock = false;
                                                                                    
                                                                                                    if ( isCleanState() ) {
                                                                                                        dismissLock = true;
                                                                                    Severity: Minor
                                                                                    Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                      Function initEditor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                      Open

                                                                                              initEditor: function() {
                                                                                                  var control = this, element, editorSettings = false;
                                                                                      
                                                                                                  // Obtain editorSettings for instantiation.
                                                                                                  if ( wp.codeEditor && ( _.isUndefined( control.params.editor_settings ) || false !== control.params.editor_settings ) ) {
                                                                                      Severity: Minor
                                                                                      Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                        Function onChangeExpanded has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                        Open

                                                                                                onChangeExpanded: function( expanded, args ) {
                                                                                                    var panel = this, overlay, sections, hasExpandedSection = false;
                                                                                        
                                                                                                    // Expand/collapse the panel normally.
                                                                                                    api.Panel.prototype.onChangeExpanded.apply( this, [ expanded, args ] );
                                                                                        Severity: Minor
                                                                                        Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                          Function embed has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                          Open

                                                                                                  embed: function () {
                                                                                                      var inject,
                                                                                                          section = this;
                                                                                          
                                                                                                      section.containerParent = api.ensure( section.containerParent );
                                                                                          Severity: Minor
                                                                                          Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                            Function filter has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                            Open

                                                                                                    filter: function( terms ) {
                                                                                                        var control = this,
                                                                                                            matchCount = 0,
                                                                                                            haystack = control.params.theme.name + ' ' +
                                                                                                                control.params.theme.description + ' ' +
                                                                                            Severity: Minor
                                                                                            Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                              Function expand has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                              Open

                                                                                                          function expand() {
                                                                                              
                                                                                                              // Try to load controls if none are loaded yet.
                                                                                                              if ( 0 === section.loaded ) {
                                                                                                                  section.loadThemes();
                                                                                              Severity: Minor
                                                                                              Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                                Function renderScreenshots has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                Open

                                                                                                        renderScreenshots: function() {
                                                                                                            var section = this;
                                                                                                
                                                                                                            // Fill queue initially, or check for more if empty.
                                                                                                            if ( null === section.screenshotQueue || 0 === section.screenshotQueue.length ) {
                                                                                                Severity: Minor
                                                                                                Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                                  Function initPlainTextareaEditor has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                          initPlainTextareaEditor: function() {
                                                                                                              var control = this, $textarea = control.container.find( 'textarea' ), textarea = $textarea[0];
                                                                                                  
                                                                                                              $textarea.on( 'blur', function onBlur() {
                                                                                                                  $textarea.data( 'next-tab-blurs', false );
                                                                                                  Severity: Minor
                                                                                                  Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                                    Function renderNotifications has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                            renderNotifications: function() {
                                                                                                                var control = this, container, notifications, hasError = false;
                                                                                                    
                                                                                                                if ( 'undefined' !== typeof console && console.warn ) {
                                                                                                                    console.warn( '[DEPRECATED] wp.customize.Control.prototype.renderNotifications() is deprecated in favor of instantiating a wp.customize.Notifications and calling its render() method.' );
                                                                                                    Severity: Minor
                                                                                                    Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                                      Function linkElements has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                      Open

                                                                                                              linkElements: function () {
                                                                                                                  var control = this, nodes, radios, element;
                                                                                                      
                                                                                                                  nodes = control.container.find( '[data-customize-setting-link], [data-customize-setting-key-link]' );
                                                                                                                  radios = {};
                                                                                                      Severity: Minor
                                                                                                      Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                                        Function dropdownInit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                                dropdownInit: function() {
                                                                                                                    var control      = this,
                                                                                                                        statuses     = this.container.find('.dropdown-status'),
                                                                                                                        params       = this.params,
                                                                                                                        toggleFreeze = false,
                                                                                                        Severity: Minor
                                                                                                        Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                                          Function attachEvents has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                                  attachEvents: function () {
                                                                                                                      var meta, content, section = this;
                                                                                                          
                                                                                                                      if ( section.container.hasClass( 'cannot-expand' ) ) {
                                                                                                                          return;
                                                                                                          Severity: Minor
                                                                                                          Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                                            Function login has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                                    login: function() {
                                                                                                                        var previewer = this,
                                                                                                                            deferred, messenger, iframe;
                                                                                                            
                                                                                                                        if ( this._login ) {
                                                                                                            Severity: Minor
                                                                                                            Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                                                                      deleteTheme: function( event ) {
                                                                                                                          var theme, section;
                                                                                                                          theme = $( event.target ).data( 'slug' );
                                                                                                                          section = api.section( 'installed_themes' );
                                                                                                              
                                                                                                              
                                                                                                              Severity: Minor
                                                                                                              Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                                                                        convertInputDateToString: function convertInputDateToString() {
                                                                                                                            var control = this, date = '', dateFormat, hourInTwentyFourHourFormat,
                                                                                                                                getElementValue, pad;
                                                                                                                
                                                                                                                            pad = function( number, padding ) {
                                                                                                                Severity: Minor
                                                                                                                Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                                                                          _toggleExpanded: function( expanded, params ) {
                                                                                                                              var instance = this, previousCompleteCallback;
                                                                                                                              params = params || {};
                                                                                                                              previousCompleteCallback = params.completeCallback;
                                                                                                                  
                                                                                                                  
                                                                                                                  Severity: Minor
                                                                                                                  Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                                                                            openMedia: function(event) {
                                                                                                                                var l10n = _wpMediaViewsL10n;
                                                                                                                    
                                                                                                                                event.preventDefault();
                                                                                                                    
                                                                                                                    
                                                                                                                    Severity: Minor
                                                                                                                    Found in wp-admin/js/customize-controls.js - About 1 hr to fix

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

                                                                                                                              filtersChecked: function() {
                                                                                                                                  var section = this,
                                                                                                                                      items = section.container.find( '.filter-group' ).find( ':checkbox' ),
                                                                                                                                      tags = [];
                                                                                                                      
                                                                                                                      
                                                                                                                      Severity: Minor
                                                                                                                      Found in wp-admin/js/customize-controls.js - About 1 hr to fix

                                                                                                                        Function mustBeCropped has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                        Open

                                                                                                                                mustBeCropped: function( flexW, flexH, dstW, dstH, imgW, imgH ) {
                                                                                                                        Severity: Minor
                                                                                                                        Found in wp-admin/js/customize-controls.js - About 45 mins to fix

                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                          Open

                                                                                                                                                      if ( changesetDate.get() !== selectedChangesetDate.get() ) {
                                                                                                                                                          saveBtn.val( api.l10n.schedule );
                                                                                                                                                      } else {
                                                                                                                                                          saveBtn.val( api.l10n.scheduled );
                                                                                                                                                      }
                                                                                                                          Severity: Major
                                                                                                                          Found in wp-admin/js/customize-controls.js - About 45 mins to fix

                                                                                                                            Avoid too many return statements within this function.
                                                                                                                            Open

                                                                                                                                    return deferred.promise();
                                                                                                                            Severity: Major
                                                                                                                            Found in wp-admin/js/customize-controls.js - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this function.
                                                                                                                              Open

                                                                                                                                              return false;
                                                                                                                              Severity: Major
                                                                                                                              Found in wp-admin/js/customize-controls.js - About 30 mins to fix

                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                Open

                                                                                                                                            return true;
                                                                                                                                Severity: Major
                                                                                                                                Found in wp-admin/js/customize-controls.js - About 30 mins to fix

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

                                                                                                                                          initFrame: function() {
                                                                                                                                              var l10n = _wpMediaViewsL10n;
                                                                                                                                  
                                                                                                                                              this.frame = wp.media({
                                                                                                                                                  button: {
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 day to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 4729..4757

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

                                                                                                                                  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

                                                                                                                                          initFrame: function() {
                                                                                                                                              var l10n = _wpMediaViewsL10n;
                                                                                                                                  
                                                                                                                                              this.frame = wp.media({
                                                                                                                                                  button: {
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 day to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 4541..4569

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

                                                                                                                                  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

                                                                                                                                          api.control( 'background_repeat', function( control ) {
                                                                                                                                              control.elements[0].unsync( api( 'background_repeat' ) );
                                                                                                                                  
                                                                                                                                              control.element = new api.Element( control.container.find( 'input' ) );
                                                                                                                                              control.element.set( 'no-repeat' !== control.setting() );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 7 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 9076..9089

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

                                                                                                                                  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

                                                                                                                                          api.control( 'background_attachment', function( control ) {
                                                                                                                                              control.elements[0].unsync( api( 'background_attachment' ) );
                                                                                                                                  
                                                                                                                                              control.element = new api.Element( control.container.find( 'input' ) );
                                                                                                                                              control.element.set( 'fixed' !== control.setting() );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 7 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 9061..9074

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

                                                                                                                                  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

                                                                                                                                          select: function() {
                                                                                                                                              // Get the attachment from the modal frame.
                                                                                                                                              var node,
                                                                                                                                                  attachment = this.frame.state().get( 'selection' ).first().toJSON(),
                                                                                                                                                  mejsSettings = window._wpmejsSettings || {};
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 6 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 4405..4423

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

                                                                                                                                  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

                                                                                                                                          select: function() {
                                                                                                                                              // Get the attachment from the modal frame.
                                                                                                                                              var node,
                                                                                                                                                  attachment = this.frame.state().get( 'selection' ).first().toJSON(),
                                                                                                                                                  mejsSettings = window._wpmejsSettings || {};
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 6 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 4343..4361

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

                                                                                                                                  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

                                                                                                                                          getPreviousTheme: function () {
                                                                                                                                              var section = this, control, nextControl, sectionControls, i;
                                                                                                                                              control = api.control( section.params.action + '_theme_' + section.currentTheme );
                                                                                                                                              sectionControls = section.controls();
                                                                                                                                              i = _.indexOf( sectionControls, control );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 5 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2495..2509

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

                                                                                                                                  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

                                                                                                                                          getNextTheme: function () {
                                                                                                                                              var section = this, control, nextControl, sectionControls, i;
                                                                                                                                              control = api.control( section.params.action + '_theme_' + section.currentTheme );
                                                                                                                                              sectionControls = section.controls();
                                                                                                                                              i = _.indexOf( sectionControls, control );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 5 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2532..2546

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

                                                                                                                                  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

                                                                                                                                              control.container.on( 'keydown', function( event ) {
                                                                                                                                                  var pickerContainer;
                                                                                                                                                  if ( 27 !== event.which ) { // Esc.
                                                                                                                                                      return;
                                                                                                                                                  }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 4 hrs to fix
                                                                                                                                  wp-content/themes/twentytwentyone/assets/js/palette-colorpicker.js on lines 42..53

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

                                                                                                                                  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 ( tabbables.last()[0] === event.target && ! event.shiftKey ) {
                                                                                                                                                      tabbables.first().focus();
                                                                                                                                                      return false;
                                                                                                                                                  } else if ( tabbables.first()[0] === event.target && event.shiftKey ) {
                                                                                                                                                      tabbables.last().focus();
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 3 hrs to fix
                                                                                                                                  wp-includes/js/media-views.js on lines 5805..5811

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

                                                                                                                                  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

                                                                                                                                          $.each( api.settings.panels, function ( id, data ) {
                                                                                                                                              var Constructor = api.panelConstructor[ data.type ] || api.Panel, options;
                                                                                                                                              // Inclusion of params alias is for back-compat for custom panels that expect to augment this property.
                                                                                                                                              options = _.extend( { params: data }, data );
                                                                                                                                              api.panel.add( new Constructor( id, options ) );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 3 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7868..7873
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7876..7881

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

                                                                                                                                  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

                                                                                                                                          $.each( api.settings.controls, function( id, data ) {
                                                                                                                                              var Constructor = api.controlConstructor[ data.type ] || api.Control, options;
                                                                                                                                              // Inclusion of params alias is for back-compat for custom controls that expect to augment this property.
                                                                                                                                              options = _.extend( { params: data }, data );
                                                                                                                                              api.control.add( new Constructor( id, options ) );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 3 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7860..7865
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7868..7873

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

                                                                                                                                  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

                                                                                                                                          $.each( api.settings.sections, function ( id, data ) {
                                                                                                                                              var Constructor = api.sectionConstructor[ data.type ] || api.Section, options;
                                                                                                                                              // Inclusion of params alias is for back-compat for custom sections that expect to augment this property.
                                                                                                                                              options = _.extend( { params: data }, data );
                                                                                                                                              api.section.add( new Constructor( id, options ) );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 3 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7860..7865
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7876..7881

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

                                                                                                                                  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

                                                                                                                                                          section._animateChangeExpanded( function() {
                                                                                                                                                              sectionTitle.attr( 'tabindex', '-1' );
                                                                                                                                                              backBtn.attr( 'tabindex', '0' );
                                                                                                                                  
                                                                                                                                                              backBtn.trigger( 'focus' );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 3 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1617..1628
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2976..2987

                                                                                                                                  Duplicated Code

                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                  Tuning

                                                                                                                                  This issue has a mass of 95.

                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                  Refactorings

                                                                                                                                  Further Reading

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

                                                                                                                                                          section._animateChangeExpanded( function() {
                                                                                                                                                              sectionTitle.attr( 'tabindex', '-1' );
                                                                                                                                                              backBtn.attr( 'tabindex', '0' );
                                                                                                                                  
                                                                                                                                                              backBtn.trigger( 'focus' );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 3 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2721..2732
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2976..2987

                                                                                                                                  Duplicated Code

                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                  Tuning

                                                                                                                                  This issue has a mass of 95.

                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                  Refactorings

                                                                                                                                  Further Reading

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

                                                                                                                                                      panel._animateChangeExpanded( function() {
                                                                                                                                                          topPanel.attr( 'tabindex', '-1' );
                                                                                                                                                          backBtn.attr( 'tabindex', '0' );
                                                                                                                                  
                                                                                                                                                          backBtn.trigger( 'focus' );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 3 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1617..1628
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2721..2732

                                                                                                                                  Duplicated Code

                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                  Tuning

                                                                                                                                  This issue has a mass of 95.

                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                  Refactorings

                                                                                                                                  Further Reading

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

                                                                                                                                                  section._animateChangeExpanded( function() {
                                                                                                                                                      backBtn.attr( 'tabindex', '-1' );
                                                                                                                                                      sectionTitle.attr( 'tabindex', '0' );
                                                                                                                                  
                                                                                                                                                      sectionTitle.trigger( 'focus' );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 2 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2754..2764

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

                                                                                                                                  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

                                                                                                                                                  section._animateChangeExpanded( function() {
                                                                                                                                                      backBtn.attr( 'tabindex', '-1' );
                                                                                                                                                      sectionTitle.attr( 'tabindex', '0' );
                                                                                                                                  
                                                                                                                                                      sectionTitle.trigger( 'focus' );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 2 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1665..1675

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

                                                                                                                                  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

                                                                                                                                          nextTheme: function () {
                                                                                                                                              var section = this;
                                                                                                                                              if ( section.getNextTheme() ) {
                                                                                                                                                  section.showDetails( section.getNextTheme(), function() {
                                                                                                                                                      section.overlay.find( '.right' ).focus();
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 2 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2517..2524

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

                                                                                                                                  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

                                                                                                                                          previousTheme: function () {
                                                                                                                                              var section = this;
                                                                                                                                              if ( section.getPreviousTheme() ) {
                                                                                                                                                  section.showDetails( section.getPreviousTheme(), function() {
                                                                                                                                                      section.overlay.find( '.left' ).focus();
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 2 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2479..2486

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

                                                                                                                                  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 ( notify ) {
                                                                                                                                                  notification = new api.Notification( notificationCode, {
                                                                                                                                                      type: 'error',
                                                                                                                                                      message: api.l10n.futureDateError
                                                                                                                                                  } );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 2 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 6038..6046

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

                                                                                                                                  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 ( notify ) {
                                                                                                                                                  notification = new api.Notification( notificationCode, {
                                                                                                                                                      type: 'info',
                                                                                                                                                      message: api.l10n.saveBeforeShare
                                                                                                                                                  } );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 2 hrs to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 5915..5923

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

                                                                                                                                  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

                                                                                                                                              container.expanded.bind( function ( expanded ) {
                                                                                                                                                  var args = container.expandedArgumentsQueue.shift();
                                                                                                                                                  args = $.extend( {}, container.defaultExpandedArguments, args );
                                                                                                                                                  container.onChangeExpanded( expanded, args );
                                                                                                                                              });
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 3 other locations - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 3586..3590
                                                                                                                                  wp-admin/js/customize-nav-menus.js on lines 1560..1564
                                                                                                                                  wp-admin/js/customize-widgets.js on lines 502..506

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

                                                                                                                                  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

                                                                                                                                              control.active.bind( function ( active ) {
                                                                                                                                                  var args = control.activeArgumentsQueue.shift();
                                                                                                                                                  args = $.extend( {}, control.defaultActiveArguments, args );
                                                                                                                                                  control.onChangeActive( active, args );
                                                                                                                                              } );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 3 other locations - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1014..1018
                                                                                                                                  wp-admin/js/customize-nav-menus.js on lines 1560..1564
                                                                                                                                  wp-admin/js/customize-widgets.js on lines 502..506

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

                                                                                                                                  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 ( ! api.utils.areElementListsEqual( sectionHeadContainers, appendContainer.children( '[id]' ) ) ) {
                                                                                                                                                  _( sections ).each( function ( section ) {
                                                                                                                                                      appendContainer.append( section.headContainer );
                                                                                                                                                  } );
                                                                                                                                                  wasReflowed = true;
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7074..7079

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

                                                                                                                                  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 ( ! api.utils.areElementListsEqual( controlContainers, appendContainer.children( '[id]' ) ) ) {
                                                                                                                                                  _( controls ).each( function ( control ) {
                                                                                                                                                      appendContainer.append( control.container );
                                                                                                                                                  } );
                                                                                                                                                  wasReflowed = true;
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7058..7063

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

                                                                                                                                  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 ( ! params.type ) {
                                                                                                                                                  _.find( api.sectionConstructor, function( Constructor, type ) {
                                                                                                                                                      if ( Constructor === section.constructor ) {
                                                                                                                                                          params.type = type;
                                                                                                                                                          return true;
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2800..2808

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

                                                                                                                                  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 ( ! params.type ) {
                                                                                                                                                  _.find( api.panelConstructor, function( Constructor, type ) {
                                                                                                                                                      if ( Constructor === panel.constructor ) {
                                                                                                                                                          params.type = type;
                                                                                                                                                          return true;
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1449..1457

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

                                                                                                                                  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 ( this.params.width === attachment.width && this.params.height === attachment.height && ! this.params.flex_width && ! this.params.flex_height ) {
                                                                                                                                                  wp.ajax.post( 'crop-image', {
                                                                                                                                                      nonce: attachment.nonces.edit,
                                                                                                                                                      id: attachment.id,
                                                                                                                                                      context: 'site-icon',
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 4578..4583

                                                                                                                                  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

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

                                                                                                                                              if ( this.params.width === attachment.width && this.params.height === attachment.height && ! this.params.flex_width && ! this.params.flex_height ) {
                                                                                                                                                  this.setImageFromAttachment( attachment );
                                                                                                                                                  this.frame.close();
                                                                                                                                              } else {
                                                                                                                                                  this.frame.setState( 'cropper' );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 4767..4788

                                                                                                                                  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

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

                                                                                                                                                  if ( section.panel() ) {
                                                                                                                                                      panel = api.panel( section.panel() );
                                                                                                                                                      if ( panel.contentContainer.hasClass( 'skip-transition' ) ) {
                                                                                                                                                          panel.collapse();
                                                                                                                                                      }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1659..1664

                                                                                                                                  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

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

                                                                                                                                                  if ( section.panel() ) {
                                                                                                                                                      panel = api.panel( section.panel() );
                                                                                                                                                      if ( panel.contentContainer.hasClass( 'skip-transition' ) ) {
                                                                                                                                                          panel.collapse();
                                                                                                                                                      }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2748..2753

                                                                                                                                  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

                                                                                                                                          api.panel.each( function ( panel ) {
                                                                                                                                              var value = panel.active();
                                                                                                                                              panel.active.callbacks.fireWith( panel.active, [ value, value ] );
                                                                                                                                          } );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7098..7101

                                                                                                                                  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

                                                                                                                                          api.section.each( function ( section ) {
                                                                                                                                              var value = section.active();
                                                                                                                                              section.active.callbacks.fireWith( section.active, [ value, value ] );
                                                                                                                                          } );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7094..7097

                                                                                                                                  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

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

                                                                                                                                              control.editor.codemirror.on( 'keydown', function onKeydown( codemirror, event ) {
                                                                                                                                                  var escKeyCode = 27;
                                                                                                                                                  if ( escKeyCode === event.keyCode ) {
                                                                                                                                                      event.stopPropagation();
                                                                                                                                                  }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/widgets/custom-html-widgets.js on lines 264..269

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

                                                                                                                                  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 ( 'undefined' === typeof data ) {
                                                                                                                                                      section.container.find( '.unexpected-error' ).show();
                                                                                                                                                      wp.a11y.speak( section.container.find( '.unexpected-error' ).text() );
                                                                                                                                                  } else if ( 'undefined' !== typeof console && console.error ) {
                                                                                                                                                      console.error( data );
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2154..2159

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

                                                                                                                                  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 ( 0 === section.loaded ) {
                                                                                                                                                          section.container.find( '.no-themes' ).show();
                                                                                                                                                          wp.a11y.speak( section.container.find( '.no-themes' ).text() );
                                                                                                                                                      } else {
                                                                                                                                                          section.fullyLoaded = true;
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2173..2178

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

                                                                                                                                  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

                                                                                                                                                  } else if ( 'future' === api.state( 'selectedChangesetStatus' ).get() && api.state( 'selectedChangesetDate' ).get() !== api.state( 'changesetDate' ).get() ) {
                                                                                                                                                      highlightScheduleButton();
                                                                                                                                                  }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 8858..8860

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

                                                                                                                                  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 ( 'future' === api.state( 'selectedChangesetStatus' ).get() && api.state( 'selectedChangesetDate' ).get() !== api.state( 'changesetDate' ).get() ) {
                                                                                                                                                      return false;
                                                                                                                                                  }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7286..7288

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

                                                                                                                                  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 ( ! sectionId || ( api.section.has( sectionId ) && api.section( sectionId ).expanded() ) ) {
                                                                                                                                                      control.notifications.render();
                                                                                                                                                  }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 4067..4069

                                                                                                                                  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

                                                                                                                                              if ( ! sectionId || ( api.section.has( sectionId ) && api.section( sectionId ).expanded() ) ) {
                                                                                                                                                  control.notifications.render();
                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 3826..3828

                                                                                                                                  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

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

                                                                                                                                              control.setting.bind( function ( value ) {
                                                                                                                                                  // Bail if the update came from the control itself.
                                                                                                                                                  if ( updating ) {
                                                                                                                                                      return;
                                                                                                                                                  }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-content/themes/twentytwentyone/assets/js/palette-colorpicker.js on lines 32..39

                                                                                                                                  Duplicated Code

                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                  Tuning

                                                                                                                                  This issue has a mass of 56.

                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                  Refactorings

                                                                                                                                  Further Reading

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

                                                                                                                                              function disableInstallButtons() {
                                                                                                                                                  return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 5127..5129

                                                                                                                                  Duplicated Code

                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                  Tuning

                                                                                                                                  This issue has a mass of 56.

                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                  Refactorings

                                                                                                                                  Further Reading

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

                                                                                                                                              function disableInstallButtons() {
                                                                                                                                                  return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2599..2601

                                                                                                                                  Duplicated Code

                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                  Tuning

                                                                                                                                  This issue has a mass of 56.

                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                  Refactorings

                                                                                                                                  Further Reading

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

                                                                                                                                          $( '.customize-controls-preview-toggle' ).on( 'click', function() {
                                                                                                                                              api.state( 'paneVisible' ).set( ! api.state( 'paneVisible' ).get() );
                                                                                                                                          });
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 8475..8477

                                                                                                                                  Duplicated Code

                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                  Tuning

                                                                                                                                  This issue has a mass of 56.

                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                  Refactorings

                                                                                                                                  Further Reading

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

                                                                                                                                          $( '.collapse-sidebar' ).on( 'click', function() {
                                                                                                                                              api.state( 'paneVisible' ).set( ! api.state( 'paneVisible' ).get() );
                                                                                                                                          });
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 8556..8558

                                                                                                                                  Duplicated Code

                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                  Tuning

                                                                                                                                  This issue has a mass of 56.

                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                  Refactorings

                                                                                                                                  Further Reading

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

                                                                                                                                              if ( realWidth / realHeight > ratio ) {
                                                                                                                                                  yInit = realHeight;
                                                                                                                                                  xInit = yInit * ratio;
                                                                                                                                              } else {
                                                                                                                                                  xInit = realWidth;
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 4947..4953
                                                                                                                                  wp-admin/js/site-icon.js on lines 39..45

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

                                                                                                                                  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

                                                                                                                                              if ( xImg / yImg > ratio ) {
                                                                                                                                                  yInit = yImg;
                                                                                                                                                  xInit = yInit * ratio;
                                                                                                                                              } else {
                                                                                                                                                  xInit = xImg;
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 1 hr to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 4619..4625
                                                                                                                                  wp-admin/js/site-icon.js on lines 39..45

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

                                                                                                                                  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 ( null === api.Previewer.prototype.refreshBuffer ) {
                                                                                                                                              api.Previewer.prototype.refreshBuffer = api.settings.timeouts.windowRefresh;
                                                                                                                                          }
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 55 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7148..7150

                                                                                                                                  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 ( null === api.PreviewFrame.prototype.sensitivity ) {
                                                                                                                                              api.PreviewFrame.prototype.sensitivity = api.settings.timeouts.previewFrameSensitivity;
                                                                                                                                          }
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 55 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 7151..7153

                                                                                                                                  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 ( api.settings.theme._canInstall && api.settings.theme._filesystemCredentialsNeeded ) {
                                                                                                                                                  panel.notifications.add( new api.Notification( 'theme_install_unavailable', {
                                                                                                                                                      message: api.l10n.themeInstallUnavailable,
                                                                                                                                                      type: 'info',
                                                                                                                                                      dismissible: true
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 50 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 3296..3302

                                                                                                                                  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 ( preview ) {
                                                                                                                                                  api.notifications.add( new api.OverlayNotification( 'theme_installing', {
                                                                                                                                                      message: api.l10n.themeDownloading,
                                                                                                                                                      type: 'info',
                                                                                                                                                      loading: true
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 50 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 3097..3103

                                                                                                                                  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

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

                                                                                                                                                              if ( ! section.contentContainer.parent().is( section.headContainer ) ) {
                                                                                                                                                                  section.containerParent.append( section.contentContainer );
                                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 50 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1510..1512
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1755..1757

                                                                                                                                  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

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

                                                                                                                                                          if ( ! section.contentContainer.parent().is( section.headContainer ) ) {
                                                                                                                                                              section.containerParent.append( section.contentContainer );
                                                                                                                                                          }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 50 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1498..1500
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1510..1512

                                                                                                                                  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

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

                                                                                                                                                      if ( ! section.contentContainer.parent().is( section.headContainer ) ) {
                                                                                                                                                          section.containerParent.append( section.contentContainer );
                                                                                                                                                      }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 50 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1498..1500
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1755..1757

                                                                                                                                  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

                                                                                                                                              _.each( items.filter( ':checked' ), function( item ) {
                                                                                                                                                  tags.push( $( item ).prop( 'value' ) );
                                                                                                                                              });
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 50 mins to fix
                                                                                                                                  wp-admin/js/theme.js on lines 1858..1860

                                                                                                                                  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

                                                                                                                                              new api.HeaderTool.ChoiceListView({
                                                                                                                                                  collection: api.HeaderTool.UploadsList = new api.HeaderTool.ChoiceList(),
                                                                                                                                                  el: '#customize-control-header_image .choices .uploaded .list'
                                                                                                                                              });
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 40 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 4864..4867

                                                                                                                                  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

                                                                                                                                              new api.HeaderTool.ChoiceListView({
                                                                                                                                                  collection: api.HeaderTool.DefaultsList = new api.HeaderTool.DefaultsList(),
                                                                                                                                                  el: '#customize-control-header_image .choices .default .list'
                                                                                                                                              });
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 40 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 4859..4862

                                                                                                                                  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

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

                                                                                                                                                      change: function() {
                                                                                                                                                          updating = true;
                                                                                                                                                          control.setting.set( picker.wpColorPicker( 'color' ) );
                                                                                                                                                          updating = false;
                                                                                                                                                      },
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 35 mins to fix
                                                                                                                                  wp-content/themes/twentytwentyone/assets/js/palette-colorpicker.js on lines 20..24

                                                                                                                                  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

                                                                                                                                                      } else {
                                                                                                                                                          section.notifications.add( new api.Notification( noticeCode, {
                                                                                                                                                              type: 'info',
                                                                                                                                                              message: api.l10n.videoHeaderNotice
                                                                                                                                                          } ) );
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 35 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 9134..9139

                                                                                                                                  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

                                                                                                                                                  if ( 'page' === showOnFront() && pageOnFrontId && pageForPostsId && pageOnFrontId === pageForPostsId ) {
                                                                                                                                                      showOnFront.notifications.add( new api.Notification( errorCode, {
                                                                                                                                                          type: 'error',
                                                                                                                                                          message: api.l10n.pageOnFrontError
                                                                                                                                                      } ) );
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 35 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 9214..9219

                                                                                                                                  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

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

                                                                                                                                                  if ( section.panel() ) {
                                                                                                                                                      api.panel( section.panel() ).expand({
                                                                                                                                                          duration: args.duration,
                                                                                                                                                          completeCallback: expand
                                                                                                                                                      });
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 30 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2042..2049
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2738..2745

                                                                                                                                  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

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

                                                                                                                                                  if ( section.panel() && api.panel.has( section.panel() ) ) {
                                                                                                                                                      api.panel( section.panel() ).expand({
                                                                                                                                                          duration: args.duration,
                                                                                                                                                          completeCallback: expand
                                                                                                                                                      });
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 30 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1644..1656
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2738..2745

                                                                                                                                  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

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

                                                                                                                                                  if ( section.panel() ) {
                                                                                                                                                      api.panel( section.panel() ).expand({
                                                                                                                                                          duration: args.duration,
                                                                                                                                                          completeCallback: expand
                                                                                                                                                      });
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 2 other locations - About 30 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1644..1656
                                                                                                                                  wp-admin/js/customize-controls.js on lines 2042..2049

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

                                                                                                                                                  if ( panel === api.state( 'expandedPanel' ).get() ) {
                                                                                                                                                      api.state( 'expandedPanel' ).set( false );
                                                                                                                                                  }
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 30 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 1679..1681

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

                                                                                                                                              api.panel.each( function( panel ) {
                                                                                                                                                  if ( panel.expanded() ) {
                                                                                                                                                      expandedPanels.push( panel );
                                                                                                                                                  }
                                                                                                                                              });
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 30 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 8520..8524

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

                                                                                                                                              api.section.each( function( section ) {
                                                                                                                                                  if ( section.expanded() ) {
                                                                                                                                                      expandedSections.push( section );
                                                                                                                                                  }
                                                                                                                                              });
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 30 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 8525..8529

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

                                                                                                                                                  if ( section === api.state( 'expandedSection' ).get() ) {
                                                                                                                                                      api.state( 'expandedSection' ).set( false );
                                                                                                                                                  }
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-admin/js/customize-controls.js and 1 other location - About 30 mins to fix
                                                                                                                                  wp-admin/js/customize-controls.js on lines 3015..3017

                                                                                                                                  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