wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 1,238 of 1,238 total issues

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

    public function onTitleQuickPermissions( $title, $user, $action, &$errors, $doExpensiveQueries, $short ) {
Severity: Minor
Found in src/TranslatorSandbox/TranslateSandboxHookHandler.php - About 45 mins to fix

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

            MessageGroup $group,
            MessageSourceChange $changes,
            string $language,
            string $type,
            array $params,
    Severity: Minor
    Found in src/Synchronization/ManageGroupsSpecialPage.php - About 45 mins to fix

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

          public function validate( array $config ): void {
              $schema = $this->baseSchema;
      
              foreach ( $config as $key => $section ) {
                  $extra = [];
      Severity: Minor
      Found in src/MessageGroupConfiguration/MessageGroupConfigurationParser.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 getData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getData(): array {
              $text = $this->dataProvider->getDefinition();
              if ( trim( $text ) === '' ) {
                  return [];
              }
      Severity: Minor
      Found in src/TranslatorInterface/Aid/TTMServerAid.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 getGroupErrorInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getGroupErrorInfo( string $groupId ): GroupSynchronizationResponse {
              $groupMessageErrorTag = $this->getGroupMessageErrorTag( $groupId );
              $groupMessageEntries = $this->cache->getByTag( $groupMessageErrorTag );
      
              $groupErrorKey = $this->getGroupErrorKey( $groupId );
      Severity: Minor
      Found in src/Synchronization/GroupSynchronizationCache.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 formatRename has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              MessageGroup $group,
              array $addedMsg,
              array $deletedMsg,
              string $language,
              bool $isEqual,
      Severity: Minor
      Found in src/Synchronization/ManageGroupsSpecialPage.php - About 45 mins to fix

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

                array $currentMsg,
                MessageSourceChange $sourceChanges,
                string $languageCode,
                int $groupNamespace,
                string $selectedVal,
        Severity: Minor
        Found in src/Synchronization/ManageGroupsSpecialPage.php - About 45 mins to fix

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

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

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

                    MessageSourceChange $changes,
                    string $key,
                    string $renameKey,
                    string $sourceContent,
                    string $wikiContent,
            Severity: Minor
            Found in src/Synchronization/ExternalMessageSourceStateComparator.php - About 45 mins to fix

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

                  public function onPageSaveComplete(
                      $wikiPage,
                      $user,
                      $summary,
                      $flags,
              Severity: Minor
              Found in src/MessageBundleTranslation/Hooks.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 newRenameJob has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      Title $target,
                      string $targetStr,
                      string $replacement,
                      $fuzzy,
                      string $content,
              Severity: Minor
              Found in src/Synchronization/UpdateMessageJob.php - About 45 mins to fix

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

                        LoggerInterface $logger,
                        MessageBundleStore $messageBundleStore,
                        LinkRenderer $linkRenderer,
                        TitleFactory $titleFactory,
                        JobQueueGroup $jobQueueGroup,
                Severity: Minor
                Found in src/MessageBundleTranslation/Hooks.php - About 45 mins to fix

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

                          $wikiPage,
                          $user,
                          $summary,
                          $flags,
                          $revisionRecord,
                  Severity: Minor
                  Found in src/MessageBundleTranslation/Hooks.php - About 45 mins to fix

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

                        private static function registerHookHandlers( array $hooks ): void {
                            if ( defined( 'MW_PHPUNIT_TEST' ) && MediaWikiServices::hasInstance() ) {
                                // When called from a test case's setUp() method,
                                // we can use HookContainer, but we cannot use SettingsBuilder.
                                $hookContainer = MediaWikiServices::getInstance()->getHookContainer();
                    Severity: Minor
                    Found in src/HookHandler.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 execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function execute( $par ): void {
                            $graphOpts = new TranslationStatsGraphOptions();
                            $graphOpts->bindArray( $this->getRequest()->getValues() );
                    
                            $pars = explode( ';', (string)$par );
                    Severity: Minor
                    Found in src/Statistics/TranslationStatsSpecialPage.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 indexOf has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function indexOf( stdClass $row ): ?array {
                            if ( $this->opts->getValue( 'count' ) === 'reviewers' ) {
                                $date = $this->formatTimestamp( $row->log_timestamp );
                    
                                if ( isset( $this->seenUsers[$date][$row->log_actor] ) ) {
                    Severity: Minor
                    Found in src/Statistics/ReviewPerLanguageStats.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 findAndMarkSourceRenames has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function findAndMarkSourceRenames( MessageSourceChange $changes, string $sourceLanguage ): void {
                            // Now check for renames. To identify renames we need to compare
                            // the contents of the added messages with the deleted ones and
                            // identify messages that match.
                            $deletions = $changes->getDeletions( $sourceLanguage );
                    Severity: Minor
                    Found in src/Synchronization/ExternalMessageSourceStateComparator.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 $groupId,
                            string $name,
                            int $pageId,
                            int $revisionId,
                            ?string $description,
                    Severity: Minor
                    Found in src/MessageBundleTranslation/MessageBundleMessageGroup.php - About 45 mins to fix

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

                          public function execute() {
                              $this->checkUserRightsAny( self::RIGHT );
                              $block = $this->getUser()->getBlock();
                              if ( $block && $block->isSitewide() ) {
                                  $this->dieBlocked( $block );
                      Severity: Minor
                      Found in src/Synchronization/ManageGroupSynchronizationCacheActionApi.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 syncStatus has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function syncStatus( array $bundlesWithDifference, string $differenceType ): void {
                              if ( !$bundlesWithDifference ) {
                                  $this->output( "No \"$differenceType\" bundle statuses\n" );
                                  return;
                              }
                      Severity: Minor
                      Found in src/Diagnostics/SyncTranslatableBundleStatusMaintenanceScript.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

                      Severity
                      Category
                      Status
                      Source
                      Language