wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 2,096 of 2,096 total issues

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

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

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

            LabelsSyntaxValidator $labelsSyntaxValidator,
            PropertyLabelsContentsValidator $labelsContentsValidator,
            DescriptionsSyntaxValidator $descriptionsSyntaxValidator,
            PropertyDescriptionsContentsValidator $descriptionsContentsValidator,
            AliasesValidator $aliasesValidator,

      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

                PropertyId $id,
                string $dataType,
                Labels $labels,
                Descriptions $descriptions,
                Aliases $aliases,
        Severity: Minor
        Found in repo/rest-api/src/Domain/ReadModel/Property.php - About 45 mins to fix

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

              public function getHtml( StatementList $statementList ) {
                  $statementLists = $this->statementGrouper->groupStatements( $statementList );
                  $html = '';
          
                  foreach ( $statementLists as $key => $statements ) {
          Severity: Minor
          Found in view/src/StatementSectionsView.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,
                  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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language