wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

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

/***/ (function(module, exports, __webpack_require__) {

var isObject = __webpack_require__("861d");

// `ToPrimitive` abstract operation
Severity: Minor
Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - 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 TaintedIconvue_type_template_id_6df35c90_render has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function TaintedIconvue_type_template_id_6df35c90_render(_ctx, _cache, $props, $setup, $data, $options) {
Severity: Minor
Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 45 mins to fix

    Function StatementsChanger has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            api,
            revisionStore,
            statementsChangerState,
            statementSerializer,
            statementDeserializer,
    Severity: Minor
    Found in view/resources/wikibase/entityChangers/StatementsChanger.js - About 45 mins to fix

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

      /***/ (function(module, exports, __webpack_require__) {
      
      var path = __webpack_require__("428f");
      var global = __webpack_require__("da84");
      
      
      Severity: Minor
      Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - 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

      Avoid deeply nested control flow statements.
      Open

            if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
              createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
            } catch (error) {
              CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
            }
      Severity: Major
      Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 45 mins to fix

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

                SiteLinkLookup $siteLinkLookup,
                LoggerInterface $logger,
                ClientDomainDb $clientDb,
                UserIdentity $user,
                $siteId,
        Severity: Minor
        Found in client/includes/UpdateRepo/UpdateRepo.php - About 45 mins to fix

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

                  Language $language,
                  SiteLinkCommentCreator $siteLinkCommentCreator,
                  EntitySourceDefinitions $entitySourceDefinitions,
                  ClientDomainDb $clientDomainDb,
                  CentralIdLookup $centralIdLookup = null,
          Severity: Minor
          Found in client/includes/RecentChanges/RecentChangeFactory.php - About 45 mins to fix

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

                    JobQueueGroupFactory $jobQueueGroupFactory,
                    ClientDomainDbFactory $clientDomainDbFactory,
                    DatabaseEntitySource $entitySource,
                    NamespaceChecker $namespaceChecker,
                    SettingsArray $clientSettings,
            Severity: Minor
            Found in client/includes/Hooks/UpdateRepoHookHandler.php - About 45 mins to fix

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

                      array &$data,
                      ExternalChange $externalChange,
                      Title $title,
                      int $count,
                      Language $lang,
              Severity: Minor
              Found in client/includes/RecentChanges/ChangeLineFormatter.php - About 45 mins to fix

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

                        LanguageFallbackChainFactory $languageFallbackChainFactory,
                        OutputFormatSnakFormatterFactory $snakFormatterFactory,
                        PropertyDataTypeLookup $propertyDataTypeLookup,
                        EntityIdParser $repoItemUriParser,
                        FallbackLabelDescriptionLookupFactory $fallbackLabelDescriptionLookupFactory,
                Severity: Minor
                Found in client/includes/DataAccess/DataAccessSnakFormatterFactory.php - About 45 mins to fix

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

                      public function needsTargetSpecificSummary( Diff $siteLinkDiff, Title $title ) {
                          if ( $siteLinkDiff->isEmpty() ) {
                              return false;
                          }
                  
                  
                  Severity: Minor
                  Found in client/includes/RecentChanges/SiteLinkCommentCreator.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

                          UsageLookup $usageLookup,
                          TitleFactory $titleFactory,
                          PageStore $pageStore,
                          LinkBatchFactory $linkBatchFactory,
                          string $siteId,
                  Severity: Minor
                  Found in client/includes/Changes/AffectedPagesFinder.php - About 45 mins to fix

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

                            ExternalChange $externalChange,
                            Title $title,
                            int $count,
                            string $flag,
                            Language $lang,
                    Severity: Minor
                    Found in client/includes/RecentChanges/ChangeLineFormatter.php - About 45 mins to fix

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

                          private function addDataToResponse(
                              array $pageIds,
                              array $descriptionsByPageId,
                              array $sourcesByPageId,
                              $continue
                      Severity: Minor
                      Found in client/includes/Api/Description.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

                              ApiQuery $query,
                              string $moduleName,
                              AliasTermBuffer $aliasTermBuffer,
                              EntityIdLookup $idLookup,
                              TermBuffer $termBuffer,
                      Severity: Minor
                      Found in client/includes/Api/PageTerms.php - About 45 mins to fix

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

                                SiteLinkLookup $siteLinkLookup,
                                EntityLookup $entityLookup,
                                UsageAccumulator $usageAccumulator,
                                HookContainer $hookContainer,
                                LoggerInterface $logger,
                        Severity: Minor
                        Found in client/includes/Hooks/SiteLinksForDisplayLookup.php - About 45 mins to fix

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

                                  Language $language,
                                  PropertyIdResolver $propertyIdResolver,
                                  SnaksFinder $snaksFinder,
                                  SnakFormatter $snakFormatter,
                                  EntityLookup $entityLookup,
                          Severity: Minor
                          Found in client/includes/DataAccess/StatementTransclusionInteractor.php - About 45 mins to fix

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

                                    $changesList,
                                    &$data,
                                    $block,
                                    $rc,
                                    &$classes = [],
                            Severity: Minor
                            Found in client/includes/Hooks/ChangesListLinesHandler.php - About 45 mins to fix

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

                                      StatsdDataFactoryInterface $statsdDataFactory,
                                      $siteId,
                                      $siteGroup,
                                      $trackLuaFunctionCallsPerSiteGroup,
                                      $trackLuaFunctionCallsPerWiki,
                              Severity: Minor
                              Found in client/includes/DataAccess/Scribunto/LuaFunctionCallTracker.php - About 45 mins to fix

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

                                        StatementTransclusionInteractor $plainTextTransclusionInteractor,
                                        StatementTransclusionInteractor $richWikitextTransclusionInteractor,
                                        EntityIdParser $entityIdParser,
                                        ContentLanguages $termsLanguages,
                                        UsageAccumulator $usageAccumulator,
                                Severity: Minor
                                Found in client/includes/DataAccess/Scribunto/WikibaseLuaEntityBindings.php - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language