wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Method validateFormData has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function validateFormData( array $formData ): Status {
        $status = Status::newGood();

        if ( $formData[ self::FIELD_LABEL ] == ''
             && $formData[ self::FIELD_DESCRIPTION ] == ''
Severity: Major
Found in repo/includes/Specials/SpecialNewItem.php - About 2 hrs to fix

    File SetReference.php has 260 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    declare( strict_types = 1 );
    
    namespace Wikibase\Repo\Api;
    Severity: Minor
    Found in repo/includes/Api/SetReference.php - About 2 hrs to fix

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

          public function execute(): void {
              if ( !WikibaseSettings::isRepoEnabled() ) {
                  $this->output( "You need to have Wikibase enabled in order to use this maintenance script!\n\n" );
                  exit;
              }
      Severity: Major
      Found in repo/maintenance/rebuildItemsPerSite.php - About 2 hrs to fix

        Method cleanTextInLangIds has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function cleanTextInLangIds( array $textInLangIds ): void {
                if ( $textInLangIds === [] ) {
                    return;
                }
        
        
        Severity: Major
        Found in lib/includes/Store/Sql/Terms/DatabaseInnerTermStoreCleaner.php - About 2 hrs to fix

          File DateFormatParser.php has 259 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace Wikibase\Repo\Parsers;
          
          use DataValues\IllegalValueException;
          Severity: Minor
          Found in repo/includes/Parsers/DateFormatParser.php - About 2 hrs to fix

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

            /***/ (function(module, exports, __webpack_require__) {
            
            var anObject = __webpack_require__("825a");
            var defineProperties = __webpack_require__("37e8");
            var enumBugKeys = __webpack_require__("7839");
            Severity: Major
            Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 2 hrs to fix

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

                  protected function validateFormData( array $formData ) {
                      $status = Status::newGood();
              
                      if ( $formData[ self::FIELD_LABEL ] == ''
                           && $formData[ self::FIELD_DESCRIPTION ] == ''
              Severity: Major
              Found in repo/includes/Specials/SpecialNewProperty.php - About 2 hrs to fix

                SqlStore has 21 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class SqlStore implements Store {
                
                    /**
                     * @var EntityChangeFactory
                     */
                Severity: Minor
                Found in repo/includes/Store/Sql/SqlStore.php - About 2 hrs to fix

                  SpecialSetLabelDescriptionAliases has 21 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class SpecialSetLabelDescriptionAliases extends SpecialModifyEntity {
                  
                      use ParameterizedDescriptionTrait;
                  
                      public const BUTTON_MESSAGE_PUBLISH = 'publishchanges';
                  Severity: Minor
                  Found in repo/includes/Specials/SpecialSetLabelDescriptionAliases.php - About 2 hrs to fix

                    DeserializedRequestAdapter has 21 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class DeserializedRequestAdapter implements
                        DeserializedAddItemStatementRequest,
                        DeserializedAddPropertyStatementRequest,
                        DeserializedGetItemRequest,
                        DeserializedGetSitelinksRequest,

                      DataTypeDefinitions has 21 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class DataTypeDefinitions {
                      
                          /**
                           * Constant for indicating that callback maps should be returned with the "VT:" and "PT:"
                           * prefixes in the array keys indicating whether the callback applies to a value type or a
                      Severity: Minor
                      Found in lib/includes/DataTypeDefinitions.php - About 2 hrs to fix

                        Function exports has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
                          createIteratorConstructor(IteratorConstructor, NAME, next);
                        
                          var getIterationMethod = function (KIND) {
                            if (KIND === DEFAULT && defaultIterator) return defaultIterator;
                        Severity: Major
                        Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 2 hrs to fix

                          Method acquireAndInsertTerms has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function acquireAndInsertTerms( Int32EntityId $entityId, Fingerprint $fingerprint ): array {
                                  $entityNumericId = $entityId->getNumericId();
                          
                                  $dbw = $this->getDbw();
                                  $queryBuilder = $dbw->newSelectQueryBuilder()
                          Severity: Major
                          Found in lib/includes/Store/Sql/Terms/DatabaseTermStoreWriterBase.php - About 2 hrs to fix

                            Method getTermMatchQueries has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function getTermMatchQueries(
                                    IReadableDatabase $dbr,
                                    TermIndexSearchCriteria $mask,
                                    string $entityType,
                                    $termType = null,
                            Severity: Major
                            Found in lib/includes/Store/Sql/Terms/DatabaseMatchingTermsLookup.php - About 2 hrs to fix

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

                                      EntityIdFormatterFactory $htmlIdFormatterFactory,
                                      EntityIdFormatterFactory $plainTextIdFormatterFactory,
                                      HtmlSnakFormatterFactory $htmlSnakFormatterFactory,
                                      StatementGrouper $statementGrouper,
                                      PropertyOrderProvider $propertyOrderProvider,
                              Severity: Major
                              Found in view/src/ViewFactory.php - About 2 hrs to fix

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

                                        FormatterLabelDescriptionLookupFactory $labelDescriptionLookupFactory,
                                        LanguageNameLookupFactory $languageNameLookupFactory,
                                        EntityIdParser $itemUriParser,
                                        string $geoShapeStorageBaseUrl,
                                        string $tabularDataStorageBaseUrl,
                                Severity: Major
                                Found in lib/includes/Formatters/WikibaseValueFormatterBuilders.php - About 2 hrs to fix

                                  File jquery.wikibase.edittoolbar.js has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  /**
                                   * @license GPL-2.0-or-later
                                   * @author H. Snater < mediawiki@snater.com >
                                   */
                                  ( function ( wb ) {
                                  Severity: Minor
                                  Found in view/resources/jquery/wikibase/toolbar/jquery.wikibase.edittoolbar.js - About 2 hrs to fix

                                    Function dispatch has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    Store.prototype.dispatch = function dispatch (_type, _payload) {
                                        var this$1$1 = this;
                                    
                                      // check object-style dispatch
                                      var ref = unifyObjectStyle(_type, _payload);
                                    Severity: Major
                                    Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 2 hrs to fix

                                      Method addFilter has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          protected function addFilter( ChangesListSpecialPage $specialPage ): void {
                                              $filterName = $this->getFilterName();
                                              $changeTypeGroup = $specialPage->getFilterGroup( 'changeType' );
                                      
                                              $out = $specialPage->getOutput();
                                      Severity: Major
                                      Found in client/includes/Hooks/ChangesListSpecialPageHookHandler.php - About 2 hrs to fix

                                        Method cleanTermInLangIdsInner has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function cleanTermInLangIdsInner( array $termInLangIds ): void {
                                                $this->logger->debug(
                                                    '{method}: deleting {count} term_in_lang rows',
                                                    [
                                                        'method' => __METHOD__,
                                        Severity: Major
                                        Found in lib/includes/Store/Sql/Terms/DatabaseInnerTermStoreCleaner.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language