wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 1,238 of 1,238 total issues

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

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                    me.beginAtZero ? 0 :
                                    min < 0 && max < 0 ? max :
                                    min > 0 && max > 0 ? min :
                                    0);
                        Severity: Minor
                        Found in resources/lib/Chart.js/Chart.js and 1 other location - About 35 mins to fix
                        resources/lib/Chart.js/Chart.js on lines 12027..12030

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 47.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                    me.height = me._length = chart.height - me.margins.top - me.margins.bottom;
                        Severity: Minor
                        Found in resources/lib/Chart.js/Chart.js and 1 other location - About 35 mins to fix
                        resources/lib/Chart.js/Chart.js on lines 11817..11817

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 47.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                        (options.scales.yAxes || []).map(function(yAxisOptions) {
                                            return {options: yAxisOptions, dtype: 'linear', dposition: 'left'};
                                        })
                        Severity: Minor
                        Found in resources/lib/Chart.js/Chart.js and 1 other location - About 35 mins to fix
                        resources/lib/Chart.js/Chart.js on lines 9475..9477

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 47.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                        me.paddingLeft = Math.max((paddingLeft - offsetLeft) * me.width / (me.width - offsetLeft), 0) + 3;
                        Severity: Minor
                        Found in resources/lib/Chart.js/Chart.js and 1 other location - About 35 mins to fix
                        resources/lib/Chart.js/Chart.js on lines 11798..11798

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 47.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                        me.paddingRight = Math.max((paddingRight - offsetRight) * me.width / (me.width - offsetRight), 0) + 3;
                        Severity: Minor
                        Found in resources/lib/Chart.js/Chart.js and 1 other location - About 35 mins to fix
                        resources/lib/Chart.js/Chart.js on lines 11797..11797

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 47.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                return me.beginAtZero ? 0 :
                                    min < 0 && max < 0 ? max :
                                    min > 0 && max > 0 ? min :
                                    0;
                        Severity: Minor
                        Found in resources/lib/Chart.js/Chart.js and 1 other location - About 35 mins to fix
                        resources/lib/Chart.js/Chart.js on lines 13806..13809

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 47.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                        (options.scales.xAxes || []).map(function(xAxisOptions) {
                                            return {options: xAxisOptions, dtype: 'category', dposition: 'bottom'};
                                        }),
                        Severity: Minor
                        Found in resources/lib/Chart.js/Chart.js and 1 other location - About 35 mins to fix
                        resources/lib/Chart.js/Chart.js on lines 9478..9480

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 47.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                    me.width = me._length = chart.width - me.margins.left - me.margins.right;
                        Severity: Minor
                        Found in resources/lib/Chart.js/Chart.js and 1 other location - About 35 mins to fix
                        resources/lib/Chart.js/Chart.js on lines 11821..11821

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 47.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        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