wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Method getContent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getContent( EntityId $entityId, $revision, $language, $editLink, TermLanguageFallbackChain $preferredLanguages ) {
        try {
            $request = $this->requestFactory->create(
                $this->formatUrl( $entityId, $revision, $language, $editLink, $preferredLanguages ),
                [ 'timeout' => $this->ssrServerTimeout ],
Severity: Minor
Found in view/src/Termbox/Renderer/TermboxRemoteRenderer.php - About 1 hr to fix

    Function e163 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    /***/ (function(module, exports, __webpack_require__) {
    
    var has = __webpack_require__("5135");
    var toObject = __webpack_require__("7b0b");
    var sharedKey = __webpack_require__("f772");
    Severity: Minor
    Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr 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 06cf has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    /***/ (function(module, exports, __webpack_require__) {
    
    var DESCRIPTORS = __webpack_require__("83ab");
    var propertyIsEnumerableModule = __webpack_require__("d1e7");
    var createPropertyDescriptor = __webpack_require__("5c6c");
    Severity: Minor
    Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr 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 ae93 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    /***/ (function(module, exports, __webpack_require__) {
    
    "use strict";
    
    var fails = __webpack_require__("d039");
    Severity: Minor
    Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr 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 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            EntityIdParser $entityIdParser,
            EntityLookup $entityLookup,
            UsageAccumulator $usageAccumulator,
            Serializer $entitySerializer,
            Serializer $statementSerializer,
    Severity: Major
    Found in client/includes/DataAccess/Scribunto/EntityAccessor.php - About 1 hr to fix

      Function getConflictsForItem has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getConflictsForItem( ItemId $itemId, SiteLinkList $siteLinkList, int $db = null ): array {
              $conflicts = [];
              $siteLinksToClear = [];
      
              foreach ( $siteLinkList->toArray() as $siteLink ) {
      Severity: Minor
      Found in repo/includes/Store/BagOStuffSiteLinkConflictLookup.php - About 1 hr 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 execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function execute( $subPage ) {
              parent::execute( $subPage );
      
              $this->checkPermissions();
              $this->checkBlocked();
      Severity: Minor
      Found in repo/includes/Specials/SpecialMergeItems.php - About 1 hr 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 execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function execute( $subPage ) {
              parent::execute( $subPage );
      
              $request = $this->getRequest();
              $subPageParts = $subPage ? explode( '/', $subPage, 2 ) : [];
      Severity: Minor
      Found in repo/includes/Specials/SpecialItemDisambiguation.php - About 1 hr 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 factory has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              ApiMain $mainModule,
              string $moduleName,
              IBufferingStatsdDataFactory $stats,
              ApiHelperFactory $apiHelperFactory,
              DataTypeFactory $dataTypeFactory,
      Severity: Major
      Found in repo/includes/Api/ParseValue.php - About 1 hr to fix

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

                array $tags,
                ChangeOpFactoryProvider $changeOpFactoryProvider,
                SpecialPageCopyrightView $copyrightView,
                SummaryFormatter $summaryFormatter,
                EntityTitleLookup $entityTitleLookup,
        Severity: Major
        Found in repo/includes/Specials/SpecialSetLabel.php - About 1 hr to fix

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

                  ApiMain $mainModule,
                  string $moduleName,
                  ApiErrorReporter $errorReporter,
                  StatementChangeOpFactory $statementChangeOpFactory,
                  StatementModificationHelper $modificationHelper,
          Severity: Major
          Found in repo/includes/Api/RemoveClaims.php - About 1 hr to fix

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

                    HTMLCacheUpdater $htmlCacheUpdater,
                    EntityDataFormatProvider $entityDataFormatProvider,
                    EntityDataSerializationService $serializationService,
                    EntityDataUriManager $entityDataUriManager,
                    EntityIdParser $entityIdParser,
            Severity: Major
            Found in repo/includes/Specials/SpecialEntityData.php - About 1 hr to fix

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

                      ApiMain $mainModule,
                      string $moduleName,
                      ApiErrorReporter $errorReporter,
                      StatementChangeOpFactory $statementChangeOpFactory,
                      StatementModificationHelper $modificationHelper,
              Severity: Major
              Found in repo/includes/Api/SetClaimValue.php - About 1 hr to fix

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

                        ApiMain $mainModule,
                        string $moduleName,
                        ApiErrorReporter $errorReporter,
                        StatementChangeOpFactory $statementChangeOpFactory,
                        StatementModificationHelper $modificationHelper,
                Severity: Major
                Found in repo/includes/Api/RemoveQualifiers.php - About 1 hr to fix

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

                          array $tags,
                          ChangeOpFactoryProvider $changeOpFactoryProvider,
                          SpecialPageCopyrightView $copyrightView,
                          SummaryFormatter $summaryFormatter,
                          EntityTitleLookup $entityTitleLookup,
                  Severity: Major
                  Found in repo/includes/Specials/SpecialSetAliases.php - About 1 hr to fix

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

                            ApiMain $mainModule,
                            string $moduleName,
                            DataTypeFactory $dataTypeFactory,
                            ValueParserFactory $valueParserFactory,
                            DataTypeValidatorFactory $dataTypeValidatorFactory,
                    Severity: Major
                    Found in repo/includes/Api/ParseValue.php - About 1 hr to fix

                      Function validateFormData has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function validateFormData( array $formData ): Status {
                              $status = Status::newGood();
                      
                              if ( $formData[ self::FIELD_LABEL ] == ''
                                   && $formData[ self::FIELD_DESCRIPTION ] == ''
                      Severity: Minor
                      Found in repo/includes/Specials/SpecialNewItem.php - About 1 hr 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 10 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              array $tags,
                              ChangeOpFactoryProvider $changeOpFactoryProvider,
                              SpecialPageCopyrightView $copyrightView,
                              SummaryFormatter $summaryFormatter,
                              EntityTitleLookup $entityTitleLookup,
                      Severity: Major
                      Found in repo/includes/Specials/SpecialSetDescription.php - About 1 hr to fix

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

                                ApiMain $mainModule,
                                string $moduleName,
                                callable $errorReporterInstantiator,
                                StatementChangeOpFactory $statementChangeOpFactory,
                                StatementModificationHelper $modificationHelper,
                        Severity: Major
                        Found in repo/includes/Api/SetQualifier.php - About 1 hr to fix

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

                                  LanguageNameUtils $languageNameUtils,
                                  Config $mwConfig,
                                  AnonymousEditWarningBuilder $anonymousEditWarningBuilder,
                                  ChangeOpFactoryProvider $changeOpFactoryProvider,
                                  MediaWikiEditEntityFactory $editEntityFactory,
                          Severity: Major
                          Found in repo/includes/Specials/SpecialSetLabelDescriptionAliases.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language