wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Method getRankedSearchResults has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $text,
        $languageCode,
        $entityType,
        $limit,
        $strictLanguage,
Severity: Minor
Found in repo/includes/Api/EntityIdSearchHelper.php - About 45 mins to fix

    Method getRankedSearchResults has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $text,
            $languageCode,
            $entityType,
            $limit,
            $strictLanguage,
    Severity: Minor
    Found in repo/includes/Api/EntitySearchHelper.php - About 45 mins to fix

      Method factory has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              DataTypeFactory $dataTypeFactory,
              EntityIdFormatterFactory $entityIdFormatterFactory,
              EntityTitleLookup $entityTitleLookup,
              FallbackLabelDescriptionLookupFactory $labelDescriptionLookupFactory,
              PropertyInfoLookup $propertyInfoLookup,
      Severity: Minor
      Found in repo/includes/Specials/SpecialListPropertiesDispatchingFactory.php - About 45 mins to fix

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

                ApiQuery $query,
                string $moduleName,
                AliasTermBuffer $aliasTermBuffer,
                EntityIdLookup $idLookup,
                TermBuffer $termBuffer,
        Severity: Minor
        Found in repo/includes/Api/EntityTerms.php - About 45 mins to fix

          Method factory has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  SiteLookup $siteLookup,
                  EntityTitleLookup $entityTitleLookup,
                  LanguageNameLookupFactory $languageNameLookupFactory,
                  LoggerInterface $logger,
                  SettingsArray $repoSettings,
          Severity: Minor
          Found in repo/includes/Specials/SpecialItemByTitle.php - About 45 mins to fix

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

                    RevisionLookup $revisionLookup,
                    TitleFactory $titleFactory,
                    EntityIdParser $idParser,
                    EntityRevisionLookup $entityRevisionLookup,
                    EntityTitleStoreLookup $entityTitleStoreLookup,
            Severity: Minor
            Found in repo/includes/Api/EntityLoadingHelper.php - About 45 mins to fix

              Function getParser has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function getParser(): ValueParser {
                      $params = $this->extractRequestParams();
              
                      $options = $this->getOptionsObject( $params['options'] );
              
              
              Severity: Minor
              Found in repo/includes/Api/ParseValue.php - About 45 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method factory has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      ApiMain $mainModule,
                      string $moduleName,
                      IBufferingStatsdDataFactory $stats,
                      ChangeOpFactoryProvider $changeOpFactoryProvider,
                      EntityFactory $entityFactory,
              Severity: Minor
              Found in repo/includes/Api/SetAliases.php - About 45 mins to fix

                Method attemptSaveMerge has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        Item $fromItem,
                        Item $toItem,
                        ?string $summary,
                        IContextSource $context,
                        bool $bot,
                Severity: Minor
                Found in repo/includes/Interactors/ItemMergeInteractor.php - About 45 mins to fix

                  Function parseBadges has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function parseBadges( array $badges, Status $status ) {
                          $badgesObjects = [];
                  
                          foreach ( $badges as $badge ) {
                              try {
                  Severity: Minor
                  Found in repo/includes/Specials/SpecialSetSiteLink.php - About 45 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                          ApiMain $mainModule,
                          string $moduleName,
                          FingerprintChangeOpFactory $termChangeOpFactory,
                          bool $federatedPropertiesEnabled,
                          EntityFactory $entityFactory,
                  Severity: Minor
                  Found in repo/includes/Api/SetLabel.php - About 45 mins to fix

                    Function getFormFields has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function getFormFields(): array {
                            $formFields = [
                                self::FIELD_LANG => [
                                    'name' => self::FIELD_LANG,
                                    'class' => HTMLContentLanguageField::class,
                    Severity: Minor
                    Found in repo/includes/Specials/SpecialNewItem.php - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function loadEntityRevision has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function loadEntityRevision(
                            EntityId $entityId,
                            $revId = 0,
                            $mode = null
                        ) {
                    Severity: Minor
                    Found in repo/includes/Api/EntityLoadingHelper.php - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                            ApiMain $mainModule,
                            string $moduleName,
                            FingerprintChangeOpFactory $termChangeOpFactory,
                            bool $federatedPropertiesEnabled,
                            EntityFactory $entityFactory,
                    Severity: Minor
                    Found in repo/includes/Api/SetDescription.php - About 45 mins to fix

                      Method initRepoJobServices has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              EntityLookup $entityLookup,
                              EntityStore $entityStore,
                              SummaryFormatter $summaryFormatter,
                              LoggerInterface $logger,
                              MediaWikiEditEntityFactory $editEntityFactory,
                      Severity: Minor
                      Found in repo/includes/UpdateRepo/UpdateRepoJob.php - About 45 mins to fix

                        Function validateParameters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function validateParameters( array $params ): void {
                                $entityReferenceBySiteLinkGiven = isset( $params['site'] ) && isset( $params['title'] );
                                $entityReferenceBySiteLinkPartial = ( isset( $params['site'] ) xor isset( $params['title'] ) );
                                $entityIdGiven = isset( $params['id'] );
                                $shouldCreateNewWithSomeType = isset( $params['new'] );
                        Severity: Minor
                        Found in repo/includes/Api/ModifyEntity.php - About 45 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Method onArticleDeleteComplete has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                WikiPage $wikiPage,
                                User $user,
                                $reason,
                                $id,
                                ?Content $content,
                        Severity: Minor
                        Found in repo/includes/RepoHooks.php - About 45 mins to fix

                          Method onFormat has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public static function onFormat( &$comment, $pre, $auto, $post, $title, $local ) {
                          Severity: Minor
                          Found in repo/includes/RepoHooks.php - About 45 mins to fix

                            Method getRankedSearchResults has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    $text,
                                    $languageCode,
                                    $entityType,
                                    $limit,
                                    $strictLanguage,
                            Severity: Minor
                            Found in repo/includes/Api/CombinedEntitySearchHelper.php - About 45 mins to fix

                              Method getRankedSearchResults has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      $text,
                                      $languageCode,
                                      $entityType,
                                      $limit,
                                      $strictLanguage,
                              Severity: Minor
                              Found in repo/includes/Api/TypeDispatchingEntitySearchHelper.php - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language