wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Function onLoadHandler has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function onLoadHandler( $editForm ) {
    mw.hook( 'wikipage.editform' ).remove( onLoadHandler );

    // Monitor all text-entry inputs for changes/typing.
    const inputsToMonitorSelector = 'textarea, select, input:not([type="hidden"], [type="submit"])';
Severity: Major
Found in resources/src/mediawiki.editRecovery/edit.js - About 2 hrs to fix

    Function updateUI has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            updateUI: function ( params ) {
                const addPages = [];
    
                if ( !$.isPlainObject( params ) ) {
                    params = undefined;
    Severity: Major
    Found in resources/src/mediawiki.special.apisandbox/apisandbox.js - About 2 hrs to fix

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

        setup(props, { emit }) {
          const dismissed = ref(false);
          const userDismissable = computed(
            () => props.inline === false && // DEPRECATED: require use of new prop allowUserDismiss (T368444).
            (props.dismissButtonLabel.length > 0 || props.allowUserDismiss)
      Severity: Major
      Found in resources/lib/codex/codex.js - About 2 hrs to fix

        Function defake has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            FakeXMLHttpRequest.defake = function defake(fakeXhr, xhrArgs) {
                var xhr = new sinonXhr.workingXHR(); // eslint-disable-line new-cap
        
                each([
                    "open",
        Severity: Major
        Found in resources/lib/sinonjs/sinon.js - About 2 hrs to fix

          Function _sfc_render$f has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
            const _component_cdx_label = resolveComponent("cdx-label");
            const _component_cdx_message = resolveComponent("cdx-message");
            return openBlock(), createBlock(resolveDynamicComponent(_ctx.isFieldset ? "fieldset" : "div"), {
              class: normalizeClass(["cdx-field", _ctx.rootClasses]),
          Severity: Major
          Found in resources/lib/codex/codex.js - About 2 hrs to fix

            Function PerfReporter has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var PerfReporter = /*#__PURE__*/function () {
                function PerfReporter(runner) {
                  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
                  _classCallCheck(this, PerfReporter);
                  this.perf = options.perf || perf;
            Severity: Major
            Found in resources/lib/qunitjs/qunit.js - About 2 hrs to fix

              Method checkReadPermissions has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function checkReadPermissions(
                      $action,
                      User $user,
                      PermissionStatus $status,
                      $rigor,
              Severity: Major
              Found in includes/Permissions/PermissionManager.php - About 2 hrs to fix

                Method renderRevision has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function renderRevision(
                        PageRecord $page,
                        ParserOptions $parserOptions,
                        RevisionRecord $revision,
                        int $options,
                Severity: Major
                Found in includes/page/ParserOutputAccess.php - About 2 hrs to fix

                  Method readFileInfo has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function readFileInfo( Context $context, array &$fileInfo ) {
                          // Turn any 'filePath' or 'callback' key into actual 'content',
                          // and remove the key after that. The callback could return a
                          // FilePath object; if that happens, fall through to the 'filePath'
                          // handling.
                  Severity: Major
                  Found in includes/ResourceLoader/FileModule.php - About 2 hrs to fix

                    Method getLessCompiler has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getLessCompiler( array $vars = [], array $importDirs = [] ) {
                            // When called from the installer, it is possible that a required PHP extension
                            // is missing (at least for now; see T49564). If this is the case, throw an
                            // exception (caught by the installer) to prevent a fatal error later on.
                            if ( !class_exists( Less_Parser::class ) ) {
                    Severity: Major
                    Found in includes/ResourceLoader/ResourceLoader.php - About 2 hrs to fix

                      Method mergeFieldInfo has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function mergeFieldInfo( array $reqs ) {
                              $merged = [];
                      
                              // fields that are required by some primary providers but not others are not actually required
                              $sharedRequiredPrimaryFields = null;
                      Severity: Major
                      Found in includes/auth/AuthenticationRequest.php - About 2 hrs to fix

                        Method handlePage has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function handlePage() {
                                // Handle page data.
                                $this->debug( "Enter page handler." );
                                $pageInfo = [ 'revisionCount' => 0, 'successfulRevisionCount' => 0 ];
                        
                        
                        Severity: Major
                        Found in includes/import/WikiImporter.php - About 2 hrs to fix

                          Method getQueryInfo has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getQueryInfo( $options = [] ) {
                                  $ret = [
                                      'tables' => [],
                                      'fields' => [],
                                      'joins'  => [],
                          Severity: Major
                          Found in includes/Revision/RevisionStore.php - About 2 hrs to fix

                            Method indexAttributes has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function indexAttributes( $index, $schema = false ) {
                                    if ( $schema === false ) {
                                        $schemas = $this->getCoreSchemas();
                                    } else {
                                        $schemas = [ $schema ];
                            Severity: Major
                            Found in includes/libs/rdbms/database/DatabasePostgres.php - About 2 hrs to fix

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

                                  public function __construct( IContextSource $context = null, LinkRenderer $linkRenderer = null ) {
                                      if ( $context ) {
                                          $this->setContext( $context );
                                      }
                              
                              
                              Severity: Major
                              Found in includes/pager/IndexPager.php - About 2 hrs to fix

                                Method loadCoreData has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function loadCoreData( string $code ) {
                                        if ( !$code ) {
                                            throw new InvalidArgumentException( "Invalid language code requested" );
                                        }
                                        if ( $this->coreDataLoaded[$code] ?? false ) {
                                Severity: Major
                                Found in includes/language/LocalisationCache.php - About 2 hrs to fix

                                  Method doPSIR has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function doPSIR( $app13 ) {
                                          if ( !$app13 ) {
                                              throw new InvalidPSIRException( "No App13 segment given" );
                                          }
                                          // First compare hash with real thing
                                  Severity: Major
                                  Found in includes/media/JpegMetadataExtractor.php - About 2 hrs to fix

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

                                        public function execute( $par ) {
                                            $this->setHeaders();
                                            $this->outputHeader();
                                            $this->getOutput()->addModuleStyles( 'mediawiki.special' );
                                            $this->addHelpLink( 'Help:Diff' );
                                    Severity: Major
                                    Found in includes/specials/SpecialComparePages.php - About 2 hrs to fix

                                      Method execute has 55 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/SpecialPasswordPolicies.php - About 2 hrs to fix

                                        Method showForm has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            protected function showForm() {
                                                $out = $this->getOutput();
                                                // Messages: tags-edit-revision-selected, tags-edit-logentry-selected
                                                $out->wrapWikiMsg( "<strong>$1</strong>", [
                                                    "tags-edit-{$this->typeName}-selected",
                                        Severity: Major
                                        Found in includes/specials/SpecialEditTags.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language