wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 994 of 1,238 total issues

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

        LanguageNameUtils $languageNameUtils,
        TranslationStashReader $stash,
        UserOptionsLookup $userOptionsLookup,
        LanguageFactory $languageFactory,
        ServiceOptions $options
Severity: Minor
Found in src/TranslatorSandbox/TranslationStashSpecialPage.php - About 35 mins to fix

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

            ApiMain $mainModule,
            string $moduleName,
            IConnectionProvider $dbProvider,
            UserFactory $userFactory,
            MessageIndex $messageIndex
    Severity: Minor
    Found in src/TranslatorSandbox/TranslationStashActionApi.php - About 35 mins to fix

      Method validateMessage has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              IContextSource $context,
              Content $content,
              Status $status,
              string $summary,
              User $user
      Severity: Minor
      Found in src/HookHandler.php - About 35 mins to fix

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

                LinkRenderer $linkRenderer,
                ConfigHelper $configHelper,
                MessageLocalizer $messageLocalizer,
                Language $language,
                MessageGroupMetadata $messageGroupMetadata
        Severity: Minor
        Found in src/Statistics/StatsTable.php - About 35 mins to fix

          Method checkNonSourceAdditionsForRename has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  MessageSourceChange $changes,
                  string $sourceLanguage,
                  string $targetLanguage,
                  MessageCollection $wiki,
                  array $wikiKeys
          Severity: Minor
          Found in src/Synchronization/ExternalMessageSourceStateComparator.php - About 35 mins to fix

            Method searchProfileForm has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    SpecialSearch $search,
                    string &$form,
                    string $profile,
                    string $term,
                    array $opts
            Severity: Minor
            Found in src/HookHandler.php - About 35 mins to fix

              Method getGroupSyncInfoHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      string $className,
                      string $summaryMsgKey,
                      string $descriptionMsgKey,
                      string $htmlContent,
                      string $preHtmlContent = null
              Severity: Minor
              Found in src/Synchronization/DisplayGroupSynchronizationInfo.php - About 35 mins to fix

                Method backport has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        FileBasedMessageGroup $group,
                        string $source,
                        string $targetPath,
                        array $keyCompatibilityMap,
                        string $language
                Severity: Minor
                Found in src/Synchronization/BackportTranslationsMaintenanceScript.php - About 35 mins to fix

                  Method addMessageUpdateChanges has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          FileBasedMessageGroup $group,
                          string $language,
                          MessageSourceChange $changes,
                          int $reason,
                          MessageGroupCache $cache
                  Severity: Minor
                  Found in src/Synchronization/ExternalMessageSourceStateComparator.php - About 35 mins to fix

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

                            ?string $sourceLanguageCode,
                            ?array $priorityLanguageCodes,
                            bool $allowOnlyPriorityLanguages,
                            ?string $description,
                            ?string $label
                    Severity: Minor
                    Found in src/MessageBundleTranslation/MessageBundleMetadata.php - About 35 mins to fix

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

                              RevTagStore $revTagStore,
                              JobQueueGroup $jobQueue,
                              LanguageNameUtils $languageNameUtils,
                              MessageIndex $messageIndex,
                              MessageGroupMetadata $messageGroupMetadata
                      Severity: Minor
                      Found in src/MessageBundleTranslation/MessageBundleStore.php - About 35 mins to fix

                        Method onAfterImportPage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function onAfterImportPage( $title, $foreignTitle, $revCount, $sRevCount, $pageInfo ) {
                        Severity: Minor
                        Found in src/MessageGroupProcessing/TranslatableBundleImporter.php - About 35 mins to fix

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

                                  ApiQuery $query,
                                  string $moduleName,
                                  HookRunner $hookRunner,
                                  MessageGroupMetadata $messageGroupMetadata,
                                  MessageGroupSubscription $groupSubscription
                          Severity: Minor
                          Found in src/MessageGroupProcessing/QueryMessageGroupsActionApi.php - About 35 mins to fix

                            Method handleRename has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    MessageGroup $group,
                                    MessageSourceChange $sourceChanges,
                                    string $msgKey,
                                    string $keyToRename,
                                    string $sourceLanguage
                            Severity: Minor
                            Found in src/MessageGroupProcessing/ManageMessageGroupsActionApi.php - About 35 mins to fix

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

                                      WikiImporterFactory $wikiImporterFactory,
                                      TranslatablePageParser $translatablePageParser,
                                      RevisionLookup $revisionLookup,
                                      NamespaceInfo $namespaceInfo,
                                      TitleFactory $titleFactory
                              Severity: Minor
                              Found in src/MessageGroupProcessing/TranslatableBundleImporter.php - About 35 mins to fix

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

                                        ApiMain $main,
                                        string $action,
                                        JobQueueGroup $jobQueueGroup,
                                        MessageGroupMetadata $messageGroupMetadata,
                                        AggregateGroupManager $aggregateGroupManager
                                Severity: Minor
                                Found in src/MessageGroupProcessing/AggregateGroupsActionApi.php - About 35 mins to fix

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

                                          MessageGroupSubscriptionStore $groupSubscriptionStore,
                                          JobQueueGroup $jobQueueGroup,
                                          UserIdentityLookup $userIdentityLookup,
                                          LoggerInterface $logger,
                                          ServiceOptions $options
                                  Severity: Minor
                                  Found in src/MessageGroupProcessing/MessageGroupSubscription.php - About 35 mins to fix

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

                                            ProgressStatsTableFactory $progressStatsTableFactory,
                                            LinkRenderer $linkRenderer,
                                            MessageGroupReviewStore $groupReviewStore,
                                            MessageGroupMetadata $messageGroupMetadata,
                                            bool $haveTranslateWorkflowStates
                                    Severity: Minor
                                    Found in src/Statistics/MessageGroupStatsTableFactory.php - About 35 mins to fix

                                      Method shouldIgnore has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              string $messageKey,
                                              ValidationIssue $issue,
                                              string $messageGroupId,
                                              string $targetLanguage,
                                              array $pattern
                                      Severity: Minor
                                      Found in src/Validation/ValidationRunner.php - About 35 mins to fix

                                        Function execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public function execute() {
                                                $spec = $this->getArg( 0 );
                                                $patterns = explode( ',', trim( $spec ) );
                                                $ids = MessageGroups::expandWildcards( $patterns );
                                        
                                        
                                        Severity: Minor
                                        Found in scripts/expand-groupspec.php - About 35 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