wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method __construct has 20 arguments (exceeds 4 allowed). Consider refactoring.
Open

        ServiceOptions $options,
        PageIdentity $page,
        RevisionStore $revisionStore,
        RevisionRenderer $revisionRenderer,
        SlotRoleRegistry $slotRoleRegistry,
Severity: Major
Found in includes/Storage/DerivedPageDataUpdater.php - About 2 hrs to fix

    StatusValue has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class StatusValue implements Stringable {
    
        /**
         * @var bool
         * @internal Only for use by Status. Use {@link self::isOK()} or {@link self::setOK()}.
    Severity: Minor
    Found in includes/libs/StatusValue.php - About 2 hrs to fix

      DjVuHandler has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class DjVuHandler extends ImageHandler {
          private const EXPENSIVE_SIZE_LIMIT = 10_485_760; // 10MiB
      
          // Constants for getHandlerState
          private const STATE_DJVU_IMAGE = 'djvuImage';
      Severity: Minor
      Found in includes/media/DjVuHandler.php - About 2 hrs to fix

        PostgresInstaller has 23 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class PostgresInstaller extends DatabaseInstaller {
        
            /** @inheritDoc */
            protected $globalNames = [
                'wgDBserver',
        Severity: Minor
        Found in includes/installer/PostgresInstaller.php - About 2 hrs to fix

          SpecialBlock has 23 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class SpecialBlock extends FormSpecialPage {
          
              private BlockUtils $blockUtils;
              private BlockPermissionCheckerFactory $blockPermissionCheckerFactory;
              private BlockUserFactory $blockUserFactory;
          Severity: Minor
          Found in includes/specials/SpecialBlock.php - About 2 hrs to fix

            Method __construct has 20 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    ServiceOptions $config,
                    array $parsoidSettings,
                    ObjectFactory $objectFactory,
                    Language $contentLanguage,
                    StatsdDataFactoryInterface $stats,
            Severity: Major
            Found in includes/parser/Parsoid/Config/SiteConfig.php - About 2 hrs to fix

              BotPassword has 23 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class BotPassword {
              
                  public const APPID_MAXLENGTH = 32;
              
                  /**
              Severity: Minor
              Found in includes/user/BotPassword.php - About 2 hrs to fix

                AbstractContent has 23 functions (exceeds 20 allowed). Consider refactoring.
                Open

                abstract class AbstractContent implements Content {
                    /**
                     * Name of the content model this Content object represents.
                     * Use with CONTENT_MODEL_XXX constants
                     *
                Severity: Minor
                Found in includes/content/AbstractContent.php - About 2 hrs to fix

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

                  FilterItem.prototype.toggleConflicted = function ( conflicted ) {
                      conflicted = conflicted === undefined ? !this.conflicted : conflicted;
                  
                      if ( this.conflicted !== conflicted ) {
                          this.conflicted = conflicted;
                  Severity: Major
                  Found in resources/src/mediawiki.rcfilters/dm/FilterItem.js and 3 other locations - About 2 hrs to fix
                  resources/src/mediawiki.rcfilters/dm/FilterGroup.js on lines 933..940
                  resources/src/mediawiki.rcfilters/dm/FilterItem.js on lines 353..360
                  resources/src/mediawiki.rcfilters/dm/FilterItem.js on lines 368..375

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

                  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

                  FilterGroup.prototype.toggleVisible = function ( isVisible ) {
                      isVisible = isVisible === undefined ? !this.visible : isVisible;
                  
                      if ( this.visible !== isVisible ) {
                          this.visible = isVisible;
                  Severity: Major
                  Found in resources/src/mediawiki.rcfilters/dm/FilterGroup.js and 3 other locations - About 2 hrs to fix
                  resources/src/mediawiki.rcfilters/dm/FilterItem.js on lines 337..344
                  resources/src/mediawiki.rcfilters/dm/FilterItem.js on lines 353..360
                  resources/src/mediawiki.rcfilters/dm/FilterItem.js on lines 368..375

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

                  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

                      hide: function( speed ) {
                          if ( standardSpeed( speed ) ) {
                              return this._hide.apply( this, arguments );
                          } else {
                              var args = _normalizeArguments.apply( this, arguments );
                  Severity: Major
                  Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 2 hrs to fix
                  resources/lib/jquery.ui/jquery.ui.effect.js on lines 1174..1182

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                              this.rows[ row ] = {
                                  isFull: false,
                                  width: 0,
                                  items: [],
                                  $element: $( '<div>' )
                  resources/src/mediawiki.widgets/MediaSearch/mw.widgets.MediaSearchWidget.js on lines 342..353

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

                  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

                      [ 'state', 'always', 'catch', 'pipe', 'then', 'promise', 'progress', 'done', 'fail' ]
                          .forEach( ( method ) => {
                              lifecycle[ method ] = function () {
                                  OO.ui.warnDeprecation(
                                      'Using the return value of openWindow as a promise is deprecated. ' +
                  Severity: Major
                  Found in resources/lib/ooui/oojs-ui-windows.js and 1 other location - About 2 hrs to fix
                  resources/lib/ooui/oojs-ui-windows.js on lines 1505..1514

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

                  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

                  FilterItem.prototype.toggleIncluded = function ( included ) {
                      included = included === undefined ? !this.included : included;
                  
                      if ( this.included !== included ) {
                          this.included = included;
                  Severity: Major
                  Found in resources/src/mediawiki.rcfilters/dm/FilterItem.js and 3 other locations - About 2 hrs to fix
                  resources/src/mediawiki.rcfilters/dm/FilterGroup.js on lines 933..940
                  resources/src/mediawiki.rcfilters/dm/FilterItem.js on lines 337..344
                  resources/src/mediawiki.rcfilters/dm/FilterItem.js on lines 368..375

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

                  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

                  FilterItem.prototype.toggleFullyCovered = function ( isFullyCovered ) {
                      isFullyCovered = isFullyCovered === undefined ? !this.fullycovered : isFullyCovered;
                  
                      if ( this.fullyCovered !== isFullyCovered ) {
                          this.fullyCovered = isFullyCovered;
                  Severity: Major
                  Found in resources/src/mediawiki.rcfilters/dm/FilterItem.js and 3 other locations - About 2 hrs to fix
                  resources/src/mediawiki.rcfilters/dm/FilterGroup.js on lines 933..940
                  resources/src/mediawiki.rcfilters/dm/FilterItem.js on lines 337..344
                  resources/src/mediawiki.rcfilters/dm/FilterItem.js on lines 353..360

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                              this.rows[ row ] = {
                                  isFull: false,
                                  width: 0,
                                  items: [],
                                  $element: $( '<div>' )
                  resources/src/mediawiki.widgets/MediaSearch/mw.widgets.MediaSearchWidget.js on lines 359..370

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

                  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

                      show: function( speed ) {
                          if ( standardSpeed( speed ) ) {
                              return this._show.apply( this, arguments );
                          } else {
                              var args = _normalizeArguments.apply( this, arguments );
                  Severity: Major
                  Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 2 hrs to fix
                  resources/lib/jquery.ui/jquery.ui.effect.js on lines 1185..1193

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

                  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 if (format === 'ddd') {
                                  ii = indexOf.call(this._shortWeekdaysParse, llc);
                                  return ii !== -1 ? ii : null;
                              } else {
                                  ii = indexOf.call(this._minWeekdaysParse, llc);
                  Severity: Major
                  Found in resources/lib/moment/moment.js and 1 other location - About 2 hrs to fix
                  resources/lib/moment/moment.js on lines 1009..1015

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

                  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 (format === 'MMM') {
                                  ii = indexOf.call(this._shortMonthsParse, llc);
                                  return ii !== -1 ? ii : null;
                              } else {
                                  ii = indexOf.call(this._longMonthsParse, llc);
                  Severity: Major
                  Found in resources/lib/moment/moment.js and 1 other location - About 2 hrs to fix
                  resources/lib/moment/moment.js on lines 1597..1603

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

                  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

                      [ 'state', 'always', 'catch', 'pipe', 'then', 'promise', 'progress', 'done', 'fail' ]
                          .forEach( ( method ) => {
                              lifecycle[ method ] = function () {
                                  OO.ui.warnDeprecation(
                                      'Using the return value of closeWindow as a promise is deprecated. ' +
                  Severity: Major
                  Found in resources/lib/ooui/oojs-ui-windows.js and 1 other location - About 2 hrs to fix
                  resources/lib/ooui/oojs-ui-windows.js on lines 1368..1377

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language