wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

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

    public function execute( $par ) {
        $this->setHeaders();
        $this->outputHeader();

        $out = $this->getOutput();
Severity: Major
Found in includes/specials/SpecialListGroupRights.php - About 3 hrs to fix

    SpecialRecentChanges has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SpecialRecentChanges extends ChangesListSpecialPage {
    
        /** @var array */
        private $watchlistFilterGroupDefinition;
    
    
    Severity: Minor
    Found in includes/specials/SpecialRecentChanges.php - About 3 hrs to fix

      LogPager has 26 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class LogPager extends ReverseChronologicalPager {
          /** @var array Log types */
          private $types = [];
      
          /** @var string Events limited to those by performer when set */
      Severity: Minor
      Found in includes/logging/LogPager.php - About 3 hrs to fix

        Method bench has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function bench( array $benchs ) {
                $this->startBench();
                $count = $this->getOption( 'count', $this->defaultCount );
                $verbose = $this->hasOption( 'verbose' );
        
        
        Severity: Major
        Found in maintenance/includes/Benchmarker.php - About 3 hrs to fix

          Method getLine has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getLine( array $feed, RecentChange $rc, $actionComment ) {
                  $mainConfig = MediaWikiServices::getInstance()->getMainConfig();
                  $canonicalServer = $mainConfig->get( MainConfigNames::CanonicalServer );
                  $serverName = $mainConfig->get( MainConfigNames::ServerName );
                  $scriptPath = $mainConfig->get( MainConfigNames::ScriptPath );
          Severity: Major
          Found in includes/recentchanges/RCFeed/MachineReadableRCFeedFormatter.php - About 3 hrs to fix

            TextPassDumper has 26 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class TextPassDumper extends BackupDumper {
                /** @var BaseDump|null */
                public $prefetch = null;
                /** @var string */
                private $thisPage;
            Severity: Minor
            Found in maintenance/includes/TextPassDumper.php - About 3 hrs to fix

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

                      if ( factor.from.y !== factor.to.y ) {
                          props = props.concat( vProps );
                          el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
                          el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
                      }
              Severity: Major
              Found in resources/lib/jquery.ui/jquery.ui.effect-scale.js and 1 other location - About 3 hrs to fix
              resources/lib/jquery.ui/jquery.ui.effect-scale.js on lines 182..186

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 95.

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

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

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

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

              Refactorings

              Further Reading

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

                          child.from = {
                              height: c_original.height * factor.from.y,
                              width: c_original.width * factor.from.x,
                              outerHeight: c_original.outerHeight * factor.from.y,
                              outerWidth: c_original.outerWidth * factor.from.x
              Severity: Major
              Found in resources/lib/jquery.ui/jquery.ui.effect-scale.js and 1 other location - About 3 hrs to fix
              resources/lib/jquery.ui/jquery.ui.effect-scale.js on lines 241..246

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 95.

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

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

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

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

              Refactorings

              Further Reading

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

                          child.to = {
                              height: c_original.height * factor.to.y,
                              width: c_original.width * factor.to.x,
                              outerHeight: c_original.height * factor.to.y,
                              outerWidth: c_original.width * factor.to.x
              Severity: Major
              Found in resources/lib/jquery.ui/jquery.ui.effect-scale.js and 1 other location - About 3 hrs to fix
              resources/lib/jquery.ui/jquery.ui.effect-scale.js on lines 235..240

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 95.

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

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

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

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

              Refactorings

              Further Reading

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

                      if ( factor.from.x !== factor.to.x ) {
                          props = props.concat( hProps );
                          el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
                          el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
                      }
              Severity: Major
              Found in resources/lib/jquery.ui/jquery.ui.effect-scale.js and 1 other location - About 3 hrs to fix
              resources/lib/jquery.ui/jquery.ui.effect-scale.js on lines 175..179

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 95.

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

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

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

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

              Refactorings

              Further Reading

              File MessagesNds_nl.php has 291 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /** Low Saxon (Netherlands) (Nedersaksies)
               *
               * @file
               * @ingroup Languages
              Severity: Minor
              Found in languages/messages/MessagesNds_nl.php - About 3 hrs to fix

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

                <?php
                
                namespace MediaWiki\HTMLForm\Field;
                
                use MediaWiki\HTMLForm\HTMLFormActionFieldLayout;
                Severity: Major
                Found in includes/htmlform/fields/HTMLSelectNamespaceWithButton.php and 1 other location - About 2 hrs to fix
                includes/htmlform/fields/HTMLTextFieldWithButton.php on lines 1..36

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

                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

                <?php
                
                namespace MediaWiki\HTMLForm\Field;
                
                use MediaWiki\HTMLForm\HTMLFormActionFieldLayout;
                Severity: Major
                Found in includes/htmlform/fields/HTMLTextFieldWithButton.php and 1 other location - About 2 hrs to fix
                includes/htmlform/fields/HTMLSelectNamespaceWithButton.php on lines 1..36

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

                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 isFileMetadataValid( $image ) {
                        $data = $image->getMetadataArray();
                        if ( $data === [ '_error' => self::BROKEN_FILE ] ) {
                            // Do not repetitively regenerate metadata on broken file.
                            return self::METADATA_GOOD;
                Severity: Major
                Found in includes/media/GIFHandler.php and 1 other location - About 2 hrs to fix
                includes/media/PNGHandler.php on lines 116..138

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

                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

                                    case AuthenticationResponse::FAIL:
                                        $this->logger->debug( "Login failed in primary authentication by $id" );
                                        if ( $res->createRequest || $state['maybeLink'] ) {
                                            $res->createRequest = new CreateFromLoginAuthenticationRequest(
                                                $res->createRequest, $state['maybeLink']
                Severity: Major
                Found in includes/auth/AuthManager.php and 1 other location - About 2 hrs to fix
                includes/auth/AuthManager.php on lines 611..631

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

                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

                                        case AuthenticationResponse::FAIL:
                                            $this->logger->debug( "Login failed in primary authentication by $id" );
                                            if ( $res->createRequest || $state['maybeLink'] ) {
                                                $res->createRequest = new CreateFromLoginAuthenticationRequest(
                                                    $res->createRequest, $state['maybeLink']
                Severity: Major
                Found in includes/auth/AuthManager.php and 1 other location - About 2 hrs to fix
                includes/auth/AuthManager.php on lines 686..701

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

                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 isFileMetadataValid( $image ) {
                        $data = $image->getMetadataArray();
                        if ( $data === [ '_error' => self::BROKEN_FILE ] ) {
                            // Do not repetitively regenerate metadata on broken file.
                            return self::METADATA_GOOD;
                Severity: Major
                Found in includes/media/PNGHandler.php and 1 other location - About 2 hrs to fix
                includes/media/GIFHandler.php on lines 135..157

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

                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(
                        ServiceOptions $options,
                        PageIdentity $page,
                        RevisionStore $revisionStore,
                        RevisionRenderer $revisionRenderer,
                Severity: Major
                Found in includes/Storage/DerivedPageDataUpdater.php and 1 other location - About 2 hrs to fix
                includes/page/MovePage.php on lines 104..149

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

                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(
                        Title $oldTitle,
                        Title $newTitle,
                        ServiceOptions $options,
                        IConnectionProvider $dbProvider,
                Severity: Major
                Found in includes/page/MovePage.php and 1 other location - About 2 hrs to fix
                includes/Storage/DerivedPageDataUpdater.php on lines 344..392

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

                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

                Method __construct has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function __construct(
                        array $options = [],
                        string $localBasePath = null,
                        string $remoteBasePath = null
                    ) {
                Severity: Major
                Found in includes/ResourceLoader/FileModule.php - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language