WordPress/WordPress

View on GitHub

Showing 14,522 of 14,522 total issues

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

},{"16":16,"18":18,"2":2,"3":3,"7":7,"8":8}],15:[function(_dereq_,module,exports){
'use strict';

var _window = _dereq_(3);

Severity: Major
Found in wp-includes/js/mediaelement/mediaelement.js and 1 other location - About 3 wks to fix
wp-includes/js/mediaelement/mediaelement-and-player.js on lines 6919..7458

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

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

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

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

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

Refactorings

Further Reading

Function 5 has a Cognitive Complexity of 1230 (exceeds 5 allowed). Consider refactoring.
Open

},{}],5:[function(_dereq_,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
Severity: Minor
Found in wp-includes/js/mediaelement/mediaelement-and-player.js - About 3 wks to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function 5 has a Cognitive Complexity of 1230 (exceeds 5 allowed). Consider refactoring.
Open

},{}],5:[function(_dereq_,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
Severity: Minor
Found in wp-includes/js/mediaelement/mediaelement.js - About 3 wks to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

    var ComboBox = Widget.extend({
      init: function (settings) {
        var self = this;
        self._super(settings);
        settings = self.settings;
Severity: Major
Found in wp-includes/js/tinymce/themes/modern/theme.js and 1 other location - About 3 wks to fix
wp-includes/js/tinymce/themes/inlite/theme.js on lines 5249..5575

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

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

    var ComboBox = Widget.extend({
      init: function (settings) {
        var self = this;
        self._super(settings);
        settings = self.settings;
Severity: Major
Found in wp-includes/js/tinymce/themes/inlite/theme.js and 1 other location - About 3 wks to fix
wp-includes/js/tinymce/themes/modern/theme.js on lines 5074..5400

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

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

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

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

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

Refactorings

Further Reading

Function parserlib has 4285 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var parserlib = (function () {
var require;
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";

Severity: Major
Found in wp-includes/js/codemirror/csslint.js - About 3 wks to fix

    File mediaelement-and-player.js has 7013 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * MediaElement.js
     * http://www.mediaelementjs.com/
     *
     * Wrapper that mimics native HTML5 MediaElement (audio and video)
    Severity: Major
    Found in wp-includes/js/mediaelement/mediaelement-and-player.js - About 2 wks to fix

      File jquery.js has 6764 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*!
       * jQuery JavaScript Library v3.7.1
       * https://jquery.com/
       *
       * Copyright OpenJS Foundation and other contributors
      Severity: Major
      Found in wp-includes/js/jquery/jquery.js - About 2 wks to fix

        File csslint.js has 6554 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
        CSSLint v1.0.4
        Copyright (c) 2016 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        Severity: Major
        Found in wp-includes/js/codemirror/csslint.js - About 2 wks to fix

          File blocks-json.php has 6386 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php return array(
            'archives' => array(
              '$schema' => 'https://schemas.wp.org/trunk/block.json',
              'apiVersion' => 3,
              'name' => 'core/archives',
          Severity: Major
          Found in wp-includes/blocks/blocks-json.php - About 2 wks to fix

            File esprima.js has 6151 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            (function webpackUniversalModuleDefinition(root, factory) {
            /* istanbul ignore next */
                if(typeof exports === 'object' && typeof module === 'object')
                    module.exports = factory();
                else if(typeof define === 'function' && define.amd)
            Severity: Major
            Found in wp-includes/js/codemirror/esprima.js - About 2 wks to fix

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

                  var Window = FloatPanel.extend({
                    modal: true,
                    Defaults: {
                      border: 1,
                      layout: 'flex',
              Severity: Major
              Found in wp-includes/js/tinymce/themes/inlite/theme.js and 1 other location - About 2 wks to fix
              wp-includes/js/tinymce/themes/modern/theme.js on lines 4257..4509

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

              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

                  var Window = FloatPanel.extend({
                    modal: true,
                    Defaults: {
                      border: 1,
                      layout: 'flex',
              Severity: Major
              Found in wp-includes/js/tinymce/themes/modern/theme.js and 1 other location - About 2 wks to fix
              wp-includes/js/tinymce/themes/inlite/theme.js on lines 3726..3978

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

              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

              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

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

                    var Container = Control$1.extend({
                      init: function (settings) {
                        var self = this;
                        self._super(settings);
                        settings = self.settings;
                Severity: Major
                Found in wp-includes/js/tinymce/themes/modern/theme.js and 1 other location - About 2 wks to fix
                wp-includes/js/tinymce/themes/inlite/theme.js on lines 3008..3252

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

                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

                    var Container = Control$1.extend({
                      init: function (settings) {
                        var self = this;
                        self._super(settings);
                        settings = self.settings;
                Severity: Major
                Found in wp-includes/js/tinymce/themes/inlite/theme.js and 1 other location - About 2 wks to fix
                wp-includes/js/tinymce/themes/modern/theme.js on lines 2991..3235

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

                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

                },{"25":25,"26":26,"27":27,"28":28,"3":3,"7":7,"8":8}],22:[function(_dereq_,module,exports){
                'use strict';
                
                var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
                
                
                Severity: Major
                Found in wp-includes/js/mediaelement/mediaelement-and-player.js and 1 other location - About 2 wks to fix
                wp-includes/js/mediaelement/mediaelement.js on lines 2180..2469

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

                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

                },{"16":16,"17":17,"18":18,"19":19,"3":3,"7":7,"8":8}],13:[function(_dereq_,module,exports){
                'use strict';
                
                var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
                
                
                Severity: Major
                Found in wp-includes/js/mediaelement/mediaelement.js and 1 other location - About 2 wks to fix
                wp-includes/js/mediaelement/mediaelement-and-player.js on lines 6483..6772

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

                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

                File moxie.js has 5525 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                ;var MXI_DEBUG = false;
                /**
                 * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
                 * v1.3.5
                 *
                Severity: Major
                Found in wp-includes/js/plupload/moxie.js - About 2 wks to fix

                  File media-views.js has 5520 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /******/ (() => { // webpackBootstrap
                  /******/     var __webpack_modules__ = ({
                  
                  /***/ 7145:
                  /***/ ((module) => {
                  Severity: Major
                  Found in wp-includes/js/media-views.js - About 2 wks to fix
                    Severity
                    Category
                    Status
                    Source
                    Language