wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

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

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

            EntityNamespaceLookup $namespaceChecker,
            SubscriptionLookup $subscriptionLookup,
            SiteLookup $siteLookup,
            EntityIdLookup $entityIdLookup,
            IContextSource $context,
    Severity: Minor
    Found in repo/includes/Hooks/InfoActionHookHandler.php - About 45 mins to fix

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

          private function getEntity( OutputPage $out ): ?EntityDocument {
              $entityId = $this->getEntityId( $out );
      
              if ( !$entityId ) {
                  return null;
      Severity: Minor
      Found in repo/includes/Hooks/OutputPageBeforeHTMLHookHandler.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

              RdfVocabulary $vocabulary,
              RdfWriter $writer,
              ValueSnakRdfBuilderFactory $valueSnakRdfBuilderFactory,
              EntityMentionListener $mentionedEntityTracker,
              DedupeBag $dedupe,
      Severity: Minor
      Found in repo/includes/Rdf/FullStatementRdfBuilderFactory.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/DispatchingValueSnakRdfBuilder.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/ExternalIdentifierRdfBuilder.php - About 45 mins to fix

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

                public function apply( EntityDocument $entity, Summary $summary = null ) {
                    if ( !( $entity instanceof DescriptionsProvider ) ) {
                        throw new InvalidArgumentException( '$entity must be a DescriptionsProvider' );
                    }
            
            
            Severity: Minor
            Found in repo/includes/ChangeOp/ChangeOpDescription.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/ValueSnakRdfBuilder.php - About 45 mins to fix

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

                  private function getEntityRevision( EntityId $id, $revision, $allowRedirects = false ) {
                      $prefixedId = $id->getSerialization();
                      $redirectRevision = null;
              
                      try {
              Severity: Minor
              Found in repo/includes/LinkedData/EntityDataRequestHandler.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

                      DedupeBag $dedupe,
                      RdfVocabulary $vocabulary,
                      RdfWriter $writer,
                      ValueSnakRdfBuilderFactory $valueSnakRdfBuilderFactory,
                      EntityMentionListener $mentionedEntityTracker,
              Severity: Minor
              Found in repo/includes/Rdf/TruthyStatementRdfBuilderFactory.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/EntityIdRdfBuilder.php - About 45 mins to fix

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

                          LinkRenderer $linkRenderer,
                          Title $target,
                          &$text,
                          array &$customAttribs,
                          RequestContext $context,
                  Severity: Minor
                  Found in repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php - About 45 mins to fix

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

                            LinkRenderer $linkRenderer,
                            Title $target,
                            &$text,
                            array &$customAttribs,
                            RequestContext $context,
                    Severity: Minor
                    Found in repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php - About 45 mins to fix

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

                              EntityIdParser $entityIdParser,
                              EntityDataUriManager $entityDataUriManager,
                              RepoDomainDb $repoDb,
                              HTMLCacheUpdater $htmlCacheUpdater,
                              int $batchSize,
                      Severity: Minor
                      Found in repo/includes/PurgeEntityDataJob.php - About 45 mins to fix

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

                            public function apply( EntityDocument $entity, Summary $summary = null ) {
                                if ( !( $entity instanceof LabelsProvider ) ) {
                                    throw new InvalidArgumentException( '$entity must be a LabelsProvider' );
                                }
                        
                        
                        Severity: Minor
                        Found in repo/includes/ChangeOp/ChangeOpLabel.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/LiteralValueRdfBuilder.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/GlobeCoordinateRdfBuilder.php - About 45 mins to fix

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

                                public function run( $new, IContextSource $context, string $summary ) {
                                    $filterStatus = Status::newGood();
                            
                                    if ( !$this->hookContainer->isRegistered( 'EditFilterMergedContent' ) ) {
                                        return $filterStatus;
                            Severity: Minor
                            Found in repo/includes/EditEntity/MediaWikiEditFilterHookRunner.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 setServices has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    SqlEntityIdPagerFactory $sqlEntityIdPagerFactory,
                                    array $existingEntityTypes,
                                    array $entityTypesWithoutRdfOutput,
                                    EntityPrefetcher $entityPrefetcher,
                                    EntityRevisionLookup $entityRevisionLookup,
                            Severity: Minor
                            Found in repo/maintenance/dumpRdf.php - About 45 mins to fix

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

                                  public function __construct(
                                      EntityHolder $itemHolder = null,
                                      EntityRedirect $entityRedirect = null,
                                      Title $redirectTitle = null
                                  ) {
                              Severity: Minor
                              Found in repo/includes/Content/ItemContent.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