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

        string $itemId,
        string $statementId,
        array $editTags,
        bool $isBot,
        ?string $comment,

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

        public function __construct( string $propertyId, array $statement, array $editTags, bool $isBot, ?string $comment, ?string $username ) {

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

          public function __construct( string $propertyId,
              array $patch,
              array $editTags,
              bool $isBot,
              ?string $comment,

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

                HtmlTermRenderer $htmlTermRenderer,
                LabelDescriptionLookup $labelDescriptionLookup,
                TemplateFactory $templateFactory,
                EditSectionGenerator $sectionEditLinkGenerator,
                TermsListView $termsListView,
        Severity: Minor
        Found in view/src/SimpleEntityTermsView.php - About 45 mins to fix

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

                  string $propertyId,
                  array $patch,
                  array $editTags,
                  bool $isBot,
                  ?string $comment,

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

                private function validateSitelinks(
                    ?string $itemId,
                    array $serialization,
                    array $sitesToValidate = null,
                    string $basePath = ''
            Severity: Minor
            Found in repo/rest-api/src/Application/Validation/SitelinksValidator.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

                    string $itemId,
                    array $patch,
                    array $editTags,
                    bool $isBot,
                    ?string $comment,
            Severity: Minor
            Found in repo/rest-api/src/Application/UseCases/PatchItem/PatchItemRequest.php - About 45 mins to fix

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

                      string $propertyId,
                      string $languageCode,
                      array $editTags,
                      bool $isBot,
                      ?string $comment,

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

                        string $itemId,
                        array $patch,
                        array $editTags,
                        bool $isBot,
                        ?string $comment,

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

                          string $itemId,
                          string $languageCode,
                          array $editTags,
                          bool $isBot,
                          ?string $comment,

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

                            string $itemId,
                            array $patch,
                            array $editTags,
                            bool $isBot,
                            ?string $comment,

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

                              AddItemStatementValidator $validator,
                              AssertItemExists $assertItemExists,
                              ItemWriteModelRetriever $itemRetriever,
                              ItemUpdater $itemUpdater,
                              GuidGenerator $guidGenerator,

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

                                string $statementId,
                                array $statement,
                                array $editTags,
                                bool $isBot,
                                ?string $comment,

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

                              public function __construct( string $itemId, array $statement, array $editTags, bool $isBot, ?string $comment, ?string $username ) {

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

                                    StatementGuid $guid,
                                    PredicateProperty $property,
                                    Value $value,
                                    Rank $rank,
                                    Qualifiers $qualifiers,
                            Severity: Minor
                            Found in repo/rest-api/src/Domain/ReadModel/Statement.php - About 45 mins to fix

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

                                      string $itemId,
                                      array $patch,
                                      array $editTags,
                                      bool $isBot,
                                      ?string $comment,

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

                                    public function __construct( string $propertyId,
                                        array $patch,
                                        array $editTags,
                                        bool $isBot,
                                        ?string $comment,

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

                                          string $itemId,
                                          array $patch,
                                          array $editTags,
                                          bool $isBot,
                                          ?string $comment,

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

                                        public function deserialize( array $serialization, string $basePath = '' ): Reference {
                                            if ( count( $serialization ) && array_is_list( $serialization ) ) {
                                                throw new InvalidFieldException( '', $serialization, $basePath );
                                            }
                                    
                                    
                                    Severity: Minor
                                    Found in repo/rest-api/src/Application/Serialization/ReferenceDeserializer.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 assertValidStatements has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        private function assertValidStatements( array $serialization, Item $originalItem, array $originalStatementsSerialization ): void {
                                            $validationError = $this->statementsValidator->validateModifiedStatements(
                                                $originalStatementsSerialization,
                                                $originalItem->getStatements(),
                                                $serialization['statements'] ?? [],

                                    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