wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method getPageHeader has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getPageHeader() {
        $self = explode( '/', $this->getTitle()->getPrefixedDBkey(), 2 )[0];

        $groupOptions = [ $this->msg( 'group-all' )->text() => '' ];
        foreach ( $this->getAllGroups() as $group => $groupText ) {
Severity: Major
Found in includes/specials/pagers/UsersPager.php - About 3 hrs to fix

    Method extractSections has 96 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function extractSections( $text, $sectionId, $mode, $newText, ?PageReference $page = null ) {
            $magicScopeVariable = $this->lock();
            $this->startParse(
                $page,
                ParserOptions::newFromUser( RequestContext::getMain()->getUser() ),
    Severity: Major
    Found in includes/parser/Parser.php - About 3 hrs to fix

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

          public function execute(
              User $performingUser,
              $username = null,
              $email = null
          ) {
      Severity: Major
      Found in includes/user/PasswordReset.php - About 3 hrs to fix

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

            public function execute() {
                global $wgLang, $wgAllowSchemaUpdates;
        
                if ( !$wgAllowSchemaUpdates
                    && !( $this->hasOption( 'force' )
        Severity: Major
        Found in maintenance/update.php - About 3 hrs to fix

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

              public function execute() {
                  $username = $this->getArg( 0 );
                  $password = $this->getArg( 1 );
                  $force = $this->hasOption( 'force' );
                  $inGroups = [];
          Severity: Major
          Found in maintenance/createAndPromote.php - About 3 hrs to fix

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

            <?php
            /** Wayuu (wayuunaiki)
             *
             * @file
             * @ingroup Languages
            Severity: Major
            Found in languages/messages/MessagesGuc.php and 6 other locations - About 3 hrs to fix
            languages/messages/MessagesAlt.php on lines 1..32
            languages/messages/MessagesBew.php on lines 1..33
            languages/messages/MessagesFon.php on lines 1..36
            languages/messages/MessagesKjh.php on lines 1..34
            languages/messages/MessagesShi.php on lines 1..37
            languages/messages/MessagesWls.php on lines 1..35

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

            <?php
            /** Khakas (хакас)
             *
             * @file
             * @ingroup Languages
            Severity: Major
            Found in languages/messages/MessagesKjh.php and 6 other locations - About 3 hrs to fix
            languages/messages/MessagesAlt.php on lines 1..32
            languages/messages/MessagesBew.php on lines 1..33
            languages/messages/MessagesFon.php on lines 1..36
            languages/messages/MessagesGuc.php on lines 1..35
            languages/messages/MessagesShi.php on lines 1..37
            languages/messages/MessagesWls.php on lines 1..35

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

            <?php
            /** Tachelhit (Shilha) (Taclḥit)
             *
             * @file
             * @ingroup Languages
            Severity: Major
            Found in languages/messages/MessagesShi.php and 6 other locations - About 3 hrs to fix
            languages/messages/MessagesAlt.php on lines 1..32
            languages/messages/MessagesBew.php on lines 1..33
            languages/messages/MessagesFon.php on lines 1..36
            languages/messages/MessagesGuc.php on lines 1..35
            languages/messages/MessagesKjh.php on lines 1..34
            languages/messages/MessagesWls.php on lines 1..35

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

            <?php
            /** Fon (fɔ̀ngbè)
             *
             * @file
             * @ingroup Languages
            Severity: Major
            Found in languages/messages/MessagesFon.php and 6 other locations - About 3 hrs to fix
            languages/messages/MessagesAlt.php on lines 1..32
            languages/messages/MessagesBew.php on lines 1..33
            languages/messages/MessagesGuc.php on lines 1..35
            languages/messages/MessagesKjh.php on lines 1..34
            languages/messages/MessagesShi.php on lines 1..37
            languages/messages/MessagesWls.php on lines 1..35

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

            <?php
            /** Betawi
             *
             * @file
             * @ingroup Languages
            Severity: Major
            Found in languages/messages/MessagesBew.php and 6 other locations - About 3 hrs to fix
            languages/messages/MessagesAlt.php on lines 1..32
            languages/messages/MessagesFon.php on lines 1..36
            languages/messages/MessagesGuc.php on lines 1..35
            languages/messages/MessagesKjh.php on lines 1..34
            languages/messages/MessagesShi.php on lines 1..37
            languages/messages/MessagesWls.php on lines 1..35

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

            <?php
            /** Wallisian (Fakaʻuvea)
             *
             * @file
             * @ingroup Languages
            Severity: Major
            Found in languages/messages/MessagesWls.php and 6 other locations - About 3 hrs to fix
            languages/messages/MessagesAlt.php on lines 1..32
            languages/messages/MessagesBew.php on lines 1..33
            languages/messages/MessagesFon.php on lines 1..36
            languages/messages/MessagesGuc.php on lines 1..35
            languages/messages/MessagesKjh.php on lines 1..34
            languages/messages/MessagesShi.php on lines 1..37

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

            <?php
            /** Southern Altay (тÿштÿк алтай тил)
             *
             * @file
             * @ingroup Languages
            Severity: Major
            Found in languages/messages/MessagesAlt.php and 6 other locations - About 3 hrs to fix
            languages/messages/MessagesBew.php on lines 1..33
            languages/messages/MessagesFon.php on lines 1..36
            languages/messages/MessagesGuc.php on lines 1..35
            languages/messages/MessagesKjh.php on lines 1..34
            languages/messages/MessagesShi.php on lines 1..37
            languages/messages/MessagesWls.php on lines 1..35

            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

                public function __construct(
                    ApiQuery $query,
                    $moduleName,
                    CommentStore $commentStore,
                    WatchedItemQueryService $watchedItemQueryService,
            Severity: Major
            Found in includes/api/ApiQueryWatchlist.php and 1 other location - About 3 hrs to fix
            includes/api/ApiQueryRecentChanges.php on lines 83..104

            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

                public function __construct(
                    ApiQuery $query,
                    $moduleName,
                    CommentStore $commentStore,
                    RowCommentFormatter $commentFormatter,
            Severity: Major
            Found in includes/api/ApiQueryRecentChanges.php and 1 other location - About 3 hrs to fix
            includes/api/ApiQueryWatchlist.php on lines 74..95

            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

            NoWriteWatchedItemStore has 31 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class NoWriteWatchedItemStore implements WatchedItemStoreInterface {
            
                private WatchedItemStoreInterface $actualStore;
            
                private const DB_READONLY_ERROR = 'The watchlist is currently readonly.';
            Severity: Minor
            Found in includes/watchlist/NoWriteWatchedItemStore.php - About 3 hrs to fix

              MWHttpRequest has 31 functions (exceeds 20 allowed). Consider refactoring.
              Open

              abstract class MWHttpRequest implements LoggerAwareInterface {
                  public const SUPPORTS_FILE_POSTS = false;
              
                  /**
                   * @var int|string
              Severity: Minor
              Found in includes/http/MWHttpRequest.php - About 3 hrs to fix

                DefaultPreferencesFactory has 31 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class DefaultPreferencesFactory implements PreferencesFactory {
                    use LoggerAwareTrait;
                
                    /** @var ServiceOptions */
                    protected $options;
                Severity: Minor
                Found in includes/preferences/DefaultPreferencesFactory.php - About 3 hrs to fix

                  LinksUpdate has 31 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class LinksUpdate extends DataUpdate {
                      use ProtectedHookAccessorTrait;
                  
                      /** @var int Page ID of the article linked from */
                      protected $mId;
                  Severity: Minor
                  Found in includes/deferred/LinksUpdate/LinksUpdate.php - About 3 hrs to fix

                    MaintenanceRunner has 31 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class MaintenanceRunner {
                    
                        /**
                         * Identifies the script to execute. This may be a class name, the relative or absolute
                         * path of a script file, a plain name with or without an extension prefix, etc.
                    Severity: Minor
                    Found in maintenance/includes/MaintenanceRunner.php - About 3 hrs to fix

                      File MessagesUk.php has 326 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /** Ukrainian (українська)
                       *
                       * @file
                       * @ingroup Languages
                      Severity: Minor
                      Found in languages/messages/MessagesUk.php - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language