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/ConceptUriSearchHelper.php - About 45 mins to fix

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

            $linkRenderer,
            $target,
            $isKnown,
            &$text,
            &$extraAttribs,
    Severity: Minor
    Found in repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.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/PropertyDataTypeSearchHelper.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/FedPropertiesTypeDispatchingEntitySearchHelper.php - About 45 mins to fix

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

                  ApiMain $mainModule,
                  string $moduleName,
                  ItemMergeInteractor $interactor,
                  ApiErrorReporter $errorReporter,
                  callable $resultBuilderInstantiator,
          Severity: Minor
          Found in repo/includes/Api/MergeItems.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/EntityTermSearchHelper.php - About 45 mins to fix

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

                  public static function onRevisionFromEditComplete(
                      WikiPage $wikiPage,
                      RevisionRecord $revisionRecord,
                      $baseID,
                      UserIdentity $user
              Severity: Minor
              Found in repo/includes/RepoHooks.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

                      $maxLength,
                      array $languageCodes,
                      EntityIdParser $idParser,
                      TermsCollisionDetectorFactory $termsCollisionDetectorFactory,
                      TermLookup $termLookup,
              Severity: Minor
              Found in repo/includes/Validators/TermValidatorFactory.php - About 45 mins to fix

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

                        ApiMain $apiMain,
                        string $moduleName,
                        IBufferingStatsdDataFactory $dataFactory,
                        ApiHelperFactory $apiHelperFactory,
                        EntityIdFormatterFactory $entityIdFormatterFactory,
                Severity: Minor
                Found in repo/includes/Api/FormatEntities.php - About 45 mins to fix

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

                          ApiMain $mainModule,
                          string $moduleName,
                          ApiHelperFactory $apiHelperFactory,
                          EntityIdParser $entityIdParser,
                          StatementGuidParser $statementGuidParser,
                  Severity: Minor
                  Found in repo/includes/Api/GetClaims.php - About 45 mins to fix

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

                        private function searchEntities( $text, $languageCode, $entityType, $limit, $prefixSearch, $strictLanguage ) {
                    Severity: Minor
                    Found in repo/includes/Api/EntityTermSearchHelper.php - About 45 mins to fix

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

                              RdfWriter $writer,
                              $propertyValueNamespace,
                              $propertyValueLName,
                              $dataType,
                              $snakNamespace,
                      Severity: Minor
                      Found in repo/includes/Rdf/Values/TimeRdfBuilder.php - About 45 mins to fix

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

                                RdfWriter $writer,
                                $propertyValueNamespace,
                                $propertyValueLName,
                                $dataType,
                                $snakNamespace,
                        Severity: Minor
                        Found in repo/includes/Rdf/Values/ObjectUriRdfBuilder.php - About 45 mins to fix

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

                              private function validateSiteLinkSerialization( $serialization, $siteCode, SiteList $sites = null ) {
                                  $this->assertArray( $serialization, 'An array was expected, but not found' );
                          
                                  if ( !array_key_exists( 'site', $serialization ) ) {
                                      throw new ChangeOpDeserializationException( 'Site must be provided', 'no-site' );
                          Severity: Minor
                          Found in repo/includes/ChangeOp/Deserialization/SiteLinksChangeOpDeserializer.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 addValue has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  RdfWriter $writer,
                                  $propertyValueNamespace,
                                  $propertyValueLName,
                                  $dataType,
                                  $snakNamespace,
                          Severity: Minor
                          Found in repo/includes/Rdf/Values/TimeRdfBuilder.php - About 45 mins to fix

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

                                    RdfWriter $writer,
                                    $propertyValueNamespace,
                                    $propertyValueLName,
                                    $dataType,
                                    $snakNamespace,
                            Severity: Minor
                            Found in repo/includes/Rdf/Values/GlobeCoordinateRdfBuilder.php - About 45 mins to fix

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

                                      RdfWriter $writer,
                                      $propertyValueNamespace,
                                      $propertyValueLName,
                                      $dataType,
                                      $snakNamespace,
                              Severity: Minor
                              Found in repo/includes/Rdf/Values/MonolingualTextRdfBuilder.php - About 45 mins to fix

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

                                        Statement $statement,
                                        GuidGenerator $guidGenerator,
                                        StatementGuidValidator $guidValidator,
                                        StatementGuidParser $guidParser,
                                        SnakValidator $snakValidator,
                                Severity: Minor
                                Found in repo/includes/ChangeOp/ChangeOpStatement.php - About 45 mins to fix

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

                                          EntityDocument $newEntity,
                                          string $summary,
                                          $flags,
                                          $token,
                                          $watch = null,
                                  Severity: Minor
                                  Found in repo/includes/EditEntity/StatsdSaveTimeRecordingEditEntity.php - About 45 mins to fix

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

                                        private function addLabels( $entityNamespace, $entityLName, TermList $labels, array $labelPredicates ) {
                                            if ( !$labelPredicates ) {
                                                // If we want no predicates, no need to bother with the rest.
                                                return;
                                            }
                                    Severity: Minor
                                    Found in repo/includes/Rdf/TermsRdfBuilder.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