wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

File SpecialExport.php has 425 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Copyright © 2003-2008 Brooke Vibber <bvibber@wikimedia.org>
 *
 * This program is free software; you can redistribute it and/or modify
Severity: Minor
Found in includes/specials/SpecialExport.php - About 6 hrs to fix

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

                    if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
                        this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
                    else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
                        this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
    Severity: Major
    Found in resources/lib/jquery.ui/jquery.ui.sortable.js and 1 other location - About 6 hrs to fix
    resources/lib/jquery.ui/jquery.ui.sortable.js on lines 262..265

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

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

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

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

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

    Refactorings

    Further Reading

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

                    if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
                        this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
                    else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
                        this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
    Severity: Major
    Found in resources/lib/jquery.ui/jquery.ui.sortable.js and 1 other location - About 6 hrs to fix
    resources/lib/jquery.ui/jquery.ui.sortable.js on lines 257..260

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

    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

    WebInstaller has 45 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class WebInstaller extends Installer {
    
        /**
         * @var WebInstallerOutput
         */
    Severity: Minor
    Found in includes/installer/WebInstaller.php - About 6 hrs to fix

      Function setup has 154 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        setup(props, { emit }) {
          const labelId = useGeneratedId("dialog-label");
          const backdrop = ref();
          const dialogElement = ref();
          const dialogBody = ref();
      Severity: Major
      Found in resources/lib/codex/codex.js - About 6 hrs to fix

        Function makeApi has 154 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function makeApi(sinon) {
                function throwYieldError(proxy, text, args) {
                    var msg = sinon.functionName(proxy) + text;
                    if (args.length) {
                        msg += " Received [" + slice.call(args).join(", ") + "]";
        Severity: Major
        Found in resources/lib/sinonjs/sinon.js - About 6 hrs to fix

          Method fetchOrRegenerate has 154 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function fetchOrRegenerate( $key, $ttl, $callback, array $opts, array $cbParams ) {
                  $checkKeys = $opts['checkKeys'] ?? [];
                  $graceTTL = $opts['graceTTL'] ?? self::GRACE_TTL_NONE;
                  $minAsOf = $opts['minAsOf'] ?? self::MIN_TIMESTAMP_NONE;
                  $hotTTR = $opts['hotTTR'] ?? self::HOT_TTR;
          Severity: Major
          Found in includes/libs/objectcache/WANObjectCache.php - About 6 hrs to fix

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

                    matcher.or = function (m2) {
                        if (!arguments.length) {
                            throw new TypeError("Matcher expected");
                        } else if (!isMatcher(m2)) {
                            m2 = match(m2);
            Severity: Major
            Found in resources/lib/sinonjs/sinon.js and 1 other location - About 6 hrs to fix
            resources/lib/sinonjs/sinon.js on lines 2193..2206

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

            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

                    matcher.and = function (m2) {
                        if (!arguments.length) {
                            throw new TypeError("Matcher expected");
                        } else if (!isMatcher(m2)) {
                            m2 = match(m2);
            Severity: Major
            Found in resources/lib/sinonjs/sinon.js and 1 other location - About 6 hrs to fix
            resources/lib/sinonjs/sinon.js on lines 2178..2191

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

            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 SqlBlobStore.php has 422 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * This program is free software; you can redistribute it and/or modify
             * it under the terms of the GNU General Public License as published by
             * the Free Software Foundation; either version 2 of the License, or
            Severity: Minor
            Found in includes/Storage/SqlBlobStore.php - About 6 hrs to fix

              File MessagesAr.php has 422 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /** Arabic (العربية)
               *
               * @file
               * @ingroup Languages
              Severity: Minor
              Found in languages/messages/MessagesAr.php - About 6 hrs to fix

                Method execute has 153 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function execute() {
                        $params = $this->extractRequestParams();
                
                        $prop = array_fill_keys( $params['prop'], true );
                
                
                Severity: Major
                Found in includes/api/ApiQueryImageInfo.php - About 6 hrs to fix

                  Method findColonNoLinks has 153 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function findColonNoLinks( $str, &$before, &$after ) {
                          if ( !preg_match( '/:|<|-\{/', $str, $m, PREG_OFFSET_CAPTURE ) ) {
                              # Nothing to find!
                              return false;
                          }
                  Severity: Major
                  Found in includes/parser/BlockLevelPass.php - About 6 hrs to fix

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

                    $specialPageAliases = [
                        'Allmessages'               => [ 'Ôlâ_Nôôchrichdâ' ],
                        'Allpages'                  => [ 'Ôlâ_Sajdâ' ],
                        'Categories'                => [ 'Gadâgoriin' ],
                        'Confirmemail'              => [ 'Iimäjl_bschdädigâ' ],
                    Severity: Major
                    Found in languages/messages/MessagesVmf.php and 3 other locations - About 6 hrs to fix
                    languages/messages/MessagesGan_hant.php on lines 58..81
                    languages/messages/MessagesLmo.php on lines 79..102
                    languages/messages/MessagesZh_tw.php on lines 27..50

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

                    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

                    $specialPageAliases = [
                        'Allmessages'               => [ '所有訊息' ],
                        'Ancientpages'              => [ '最舊頁面' ],
                        'Block'                     => [ '封鎖使用者' ],
                        'CreateAccount'             => [ '建立帳號' ],
                    Severity: Major
                    Found in languages/messages/MessagesZh_tw.php and 3 other locations - About 6 hrs to fix
                    languages/messages/MessagesGan_hant.php on lines 58..81
                    languages/messages/MessagesLmo.php on lines 79..102
                    languages/messages/MessagesVmf.php on lines 36..59

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

                    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

                    $specialPageAliases = [
                        'Allmessages'               => [ 'Messagg' ],
                        'BrokenRedirects'           => [ 'RedirezionS-cepada' ],
                        'Categories'                => [ 'Categurij' ],
                        'CreateAccount'             => [ 'CreaCünt' ],
                    Severity: Major
                    Found in languages/messages/MessagesLmo.php and 3 other locations - About 6 hrs to fix
                    languages/messages/MessagesGan_hant.php on lines 58..81
                    languages/messages/MessagesVmf.php on lines 36..59
                    languages/messages/MessagesZh_tw.php on lines 27..50

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

                    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

                    $specialPageAliases = [
                        'Ancientpages'              => [ '老早嗰頁面' ],
                        'BrokenRedirects'           => [ '壞吥嗰重定向頁' ],
                        'CreateAccount'             => [ '新建隻帳戶' ],
                        'Fewestrevisions'           => [ '最少改動嗰頁面' ],
                    Severity: Major
                    Found in languages/messages/MessagesGan_hant.php and 3 other locations - About 6 hrs to fix
                    languages/messages/MessagesLmo.php on lines 79..102
                    languages/messages/MessagesVmf.php on lines 36..59
                    languages/messages/MessagesZh_tw.php on lines 27..50

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

                    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

                    TextParamMixin.prototype.apiCheckValid = function ( shouldSuppressErrors ) {
                        const that = this;
                        return this.getValidity().then( () => $.Deferred().resolve( true ).promise(), () => $.Deferred().resolve( false ).promise() ).done( ( ok ) => {
                            ok = ok || shouldSuppressErrors;
                            that.setIcon( ok ? null : 'alert' );
                    Severity: Major
                    Found in resources/src/mediawiki.special.apisandbox/TextParamMixin.js and 1 other location - About 6 hrs to fix
                    resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 34..41

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

                    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

                            calendar: {
                                sameDay: '[dnes o] LT',
                                nextDay: '[zajtra o] LT',
                                nextWeek: function () {
                                    switch (this.day()) {
                    Severity: Major
                    Found in resources/lib/moment/locale/sk.js and 1 other location - About 6 hrs to fix
                    resources/lib/moment/locale/cs.js on lines 117..155

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

                    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

                                apiCheckValid: function ( shouldSuppressErrors ) {
                                    const widget = this;
                                    return this.getValidity().then( () => $.Deferred().resolve( true ).promise(), () => $.Deferred().resolve( false ).promise() ).done( ( ok ) => {
                                        ok = ok || shouldSuppressErrors;
                                        widget.setIcon( ok ? null : 'alert' );
                    Severity: Major
                    Found in resources/src/mediawiki.special.apisandbox/apisandbox.js and 1 other location - About 6 hrs to fix
                    resources/src/mediawiki.special.apisandbox/TextParamMixin.js on lines 44..51

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

                    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