wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

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

        StatementGroupRendererFactory $rendererFactory,
        SiteLinkLookup $siteLinkLookup,
        EntityIdParser $entityIdParser,
        RestrictedEntityLookup $restrictedEntityLookup,
        $siteId,
Severity: Minor
Found in client/includes/DataAccess/ParserFunctions/Runner.php - About 45 mins to fix

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

            array &$data,
            ExternalChange $externalChange,
            Title $title,
            int $count,
            Language $lang,
    Severity: Minor
    Found in client/includes/RecentChanges/ChangeLineFormatter.php - About 45 mins to fix

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

              Title $title,
              EntityContent $content,
              string $summary,
              int $undidRevId,
              int $originalRevId,
      Severity: Minor
      Found in repo/includes/Actions/SubmitEntityAction.php - About 45 mins to fix

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

            public function getRevisionHeader( RevisionRecord $rev, $complete = '' ) {
                //NOTE: This must be kept in sync with the parent implementation.
                //      Perhaps some parts could be factored out to reduce code duplication.
        
                $lang = $this->getLanguage();
        Severity: Minor
        Found in repo/includes/Diff/EntityContentDiffView.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 saveEntityContent has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                EntityContent $entityContent,
                User $user,
                $summary = '',
                $flags = 0,
                $baseRevId = false,
        Severity: Minor
        Found in repo/includes/Store/Sql/WikiPageEntityStore.php - About 45 mins to fix

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

              private function filterRequest( array $jsonResult, int $limit ) {
                  $resultsArray = [];
                  $filteredResultCount = 0;
          
                  foreach ( $jsonResult['search'] as $result ) {
          Severity: Minor
          Found in repo/includes/FederatedProperties/ApiEntitySearchHelper.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

                  OtherProjectsSidebarGeneratorFactory $otherProjectsSidebarGeneratorFactory,
                  SiteLinkLookup $siteLinkLookup,
                  EntityLookup $entityLookup,
                  UsageAccumulatorFactory $usageAccumulatorFactory,
                  string $siteId,
          Severity: Minor
          Found in client/includes/ParserOutput/ClientParserOutputDataUpdater.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/FederatedProperties/NullEntitySearchHelper.php - About 45 mins to fix

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

                      array &$fields,
                      ContentHandler $handler,
                      WikiPage $page,
                      ParserOutput $output,
                      SearchEngine $engine,
              Severity: Minor
              Found in client/includes/Hooks/TrivialHookHandler.php - About 45 mins to fix

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

                        LanguageLinkBadgeDisplay $badgeDisplay,
                        NamespaceChecker $namespaceChecker,
                        SiteLinksForDisplayLookup $siteLinkForDisplayLookup,
                        SiteLookup $siteLookup,
                        string $siteId,
                Severity: Minor
                Found in client/includes/Hooks/LangLinkHandler.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/FederatedProperties/ApiEntitySearchHelper.php - About 45 mins to fix

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

                            EntityNamespaceLookup $entityNamespaceLookup,
                            EntityIdLookup $entityIdLookup,
                            RepoDomainDb $repoDomainDb,
                            array $entityTypes = [],
                            $redirectMode = EntityIdPager::NO_REDIRECTS,
                    Severity: Minor
                    Found in repo/includes/Store/Sql/SqlEntityIdPager.php - About 45 mins to fix

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

                          public function rebuildPropertyInfo(): int {
                              $propertyNamespace = $this->entityNamespaceLookup->getEntityNamespace(
                                  Property::ENTITY_TYPE
                              );
                              if ( $propertyNamespace === null ) {
                      Severity: Minor
                      Found in repo/includes/Store/Sql/PropertyInfoTableBuilder.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 generateNewId has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function generateNewId( IDatabase $database, $type, $retry = true ) {
                              $database->startAtomic( __METHOD__ );
                      
                              $currentId = $database->newSelectQueryBuilder()
                                  ->select( 'id_value' )
                      Severity: Minor
                      Found in repo/includes/Store/Sql/SqlIdGenerator.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

                              HttpRequestFactory $httpRequestFactory,
                              array $contentModelMappings,
                              DataTypeDefinitions $dataTypeDefinitions,
                              EntitySourceDefinitions $entitySourceDefinitions,
                              string $federatedPropertiesSourceScriptUrl,
                      Severity: Minor
                      Found in repo/includes/FederatedProperties/ApiServiceFactory.php - About 45 mins to fix

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

                                EntityRedirect $redirect,
                                $summary,
                                User $user,
                                $flags = 0,
                                $baseRevId = false,
                        Severity: Minor
                        Found in repo/includes/Store/Sql/WikiPageEntityStore.php - About 45 mins to fix

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

                                  EntityDocument $entity,
                                  $summary,
                                  User $user,
                                  $flags = 0,
                                  $baseRevId = false,
                          Severity: Minor
                          Found in repo/includes/Store/Sql/WikiPageEntityStore.php - About 45 mins to fix

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

                                    DescriptionLookup $descriptionLookup,
                                    FallbackLabelDescriptionLookupFactory $labelDescriptionLookupFactory,
                                    NamespaceChecker $namespaceChecker,
                                    RepoLinker $repoLinker,
                                    SettingsArray $clientSettings,
                            Severity: Minor
                            Found in client/includes/Hooks/InfoActionHookHandler.php - About 45 mins to fix

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

                                      $sourceEntityIdSerialization,
                                      EntityRevision $entityRevision,
                                      $props = 'all',
                                      array $filterSiteIds = null,
                                      array $filterLangCodes = [],
                              Severity: Minor
                              Found in repo/includes/Api/ResultBuilder.php - About 45 mins to fix

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

                                    private function validateParameters( array $params ): void {
                                        if ( !( $this->modificationHelper->validateStatementGuid( $params['claim'] ) ) ) {
                                            $this->errorReporter->dieError( 'Invalid claim guid', 'invalid-guid' );
                                        }
                                
                                
                                Severity: Minor
                                Found in repo/includes/Api/SetQualifier.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

                                Severity
                                Category
                                Status
                                Source
                                Language