wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 994 of 1,238 total issues

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

        WANObjectCache $cache,
        Collation $collation,
        MessageGroups $messageGroupFactory,
        NamespaceInfo $namespaceInfo,
        MessageIndex $messageIndex,
Severity: Major
Found in src/TranslatorInterface/EntitySearch.php - About 50 mins to fix

    Method onChangesListSpecialPageQuery has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $pageName,
            &$tables,
            &$fields,
            &$conds,
            &$query_options,
    Severity: Major
    Found in src/RecentChangesTranslationFilterHookHandler.php - About 50 mins to fix

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

              Config $config,
              JobQueueGroup $jobQueueGroup,
              MessageGroupStatsTableFactory $messageGroupStatsTableFactory,
              EntitySearch $entitySearch,
              MessagePrefixStats $messagePrefixStats,
      Severity: Major
      Found in src/Statistics/MessageGroupStatsSpecialPage.php - About 50 mins to fix

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

                GroupSynchronizationCache $groupSynchronizationCache,
                JobQueueGroup $jobQueueGroup,
                LoggerInterface $logger,
                MessageIndex $messageIndex,
                TitleFactory $titleFactory,
        Severity: Major
        Found in src/Synchronization/ExternalMessageSourceStateImporter.php - About 50 mins to fix

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

                  StatsTable $table,
                  LinkRenderer $linkRenderer,
                  MessageLocalizer $localizer,
                  Language $interfaceLanguage,
                  MessageGroupReviewStore $groupReviewStore,
          Severity: Major
          Found in src/Statistics/MessageGroupStatsTable.php - About 50 mins to fix

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

                    MessageIndex $messageIndex,
                    JobQueueGroup $jobQueue,
                    RevTagStore $revTagStore,
                    IConnectionProvider $dbProvider,
                    TranslatableBundleStatusStore $translatableBundleStatusStore,
            Severity: Major
            Found in src/MessageGroupProcessing/TranslatablePageStore.php - About 50 mins to fix

              Method makeRow has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      StatsTable $table,
                      string $languageCode,
                      array $stats,
                      MessageGroup $group,
                      int $rowCount,
              Severity: Major
              Found in src/Statistics/MessageGroupStatsTable.php - About 50 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if ( i !== 0 ) {
                                        translationUnits[ i - 1 ] += '\n' + mergeText;
                                    } else {
                                        matchText = mergeText + matchText;
                                    }
                Severity: Major
                Found in resources/js/ext.translate.special.pagemigration.js - About 45 mins to fix

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

                      roundedRect: function(ctx, x, y, width, height, radius) {
                  Severity: Minor
                  Found in resources/lib/Chart.js/Chart.js - About 45 mins to fix

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

                        drawPoint: function(ctx, style, radius, x, y, rotation) {
                    Severity: Minor
                    Found in resources/lib/Chart.js/Chart.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          while ( emptyCount !== 0 ) {
                                              mergeText += translationUnits.splice( i, 1 ).toString() + '\n';
                                              emptyCount += 1;
                                          }
                      Severity: Major
                      Found in resources/js/ext.translate.special.pagemigration.js - About 45 mins to fix

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

                        function doFill(ctx, points, mapper, view, color, loop) {
                        Severity: Minor
                        Found in resources/lib/Chart.js/Chart.js - About 45 mins to fix

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

                          function getScrollInfo( within ) {
                              var overflowX = within.isWindow || within.isDocument ? '' :
                                      within.element.css( 'overflow-x' ),
                                  overflowY = within.isWindow || within.isDocument ? '' :
                                      within.element.css( 'overflow-y' ),
                          Severity: Minor
                          Found in resources/src/ext.translate.groupselector/ui.position.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

                                for (var i = 0; i < rgb.length; i++) {
                                   rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
                                }
                          Severity: Major
                          Found in resources/lib/Chart.js/Chart.js - About 45 mins to fix

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

                                public static function parseGroupFile( $filename ) {
                                    $data = file_get_contents( $filename );
                                    $documents = preg_split( "/^---$/m", $data, -1, PREG_SPLIT_NO_EMPTY );
                                    $groups = [];
                                    $template = false;
                            Severity: Minor
                            Found in scripts/yaml-tests.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() {
                                    $this->bundleMover = Services::getInstance()->getTranslatableBundleMover();
                            
                                    $mwService = MediaWikiServices::getInstance();
                                    $this->titleParser = $mwService->getTitleParser();
                            Severity: Minor
                            Found in src/PageTranslation/MoveTranslatableBundleMaintenanceScript.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

                            Avoid deeply nested control flow statements.
                            Open

                                                if (c1.valid) {
                                                    view[key] = c1.mix(c0, ease).rgbString();
                                                    continue;
                                                }
                            Severity: Major
                            Found in resources/lib/Chart.js/Chart.js - About 45 mins to fix

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

                                      PageMoveOperation $translatablePage,
                                      array $translationPagePairs,
                                      array $unitPagesPairs,
                                      array $subpagesPairs,
                                      array $nonMovableSubpages,
                              Severity: Minor
                              Found in src/PageTranslation/PageMoveCollection.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if (isNaN(value.min) || isNaN(value.max) || meta.data[i].hidden || value.min < 0 || value.max < 0) {
                                                            continue;
                                                        }
                                Severity: Major
                                Found in resources/lib/Chart.js/Chart.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                     else if (match = string.match(keyword)) {
                                        if (match[1] == "transparent") {
                                           return [0, 0, 0, 0];
                                        }
                                        rgb = colorName$1[match[1]];
                                  Severity: Major
                                  Found in resources/lib/Chart.js/Chart.js - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language