wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 994 of 1,238 total issues

Function hasOnly has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function hasOnly( $language, $type ) {
        $deletions = $this->getDeletions( $language );
        $additions = $this->getAdditions( $language );
        $renames = $this->getRenames( $language );
        $changes = $this->getChanges( $language );
Severity: Minor
Found in src/MessageSync/MessageSourceChange.php - About 55 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 levenshtein has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function levenshtein( string $str1, string $str2, int $length1, int $length2 ): int {
        if ( $length1 === 0 ) {
            return $length2;
        }

Severity: Minor
Found in src/Utilities/StringComparators/EditDistanceStringComparator.php - About 55 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 handleNew has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function handleNew(
        MessageSourceChange $sourceChanges,
        string $msgKey,
        string $sourceLang
    ): void {
Severity: Minor
Found in src/MessageGroupProcessing/ManageMessageGroupsActionApi.php - About 55 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 calculateAggregateGroup has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private static function calculateAggregateGroup(
        array &$stats,
        AggregateMessageGroup $group,
        string $code,
        int $flags
Severity: Minor
Found in src/Statistics/MessageGroupStats.php - About 55 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 get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function get(
        array $stats,
        MessageGroup $group,
        bool $noComplete,
        bool $noEmpty
Severity: Minor
Found in src/Statistics/MessageGroupStatsTable.php - About 55 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 pluralFormCheck has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function pluralFormCheck( string $text, ?array $expectedKeywords ): array {
        [ , $instanceMap ] = UnicodePlural::parsePluralForms( $text );

        foreach ( $instanceMap as $forms ) {
            $actualKeywords = [];
Severity: Minor
Found in src/Validation/Validators/UnicodePluralValidator.php - About 55 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 parseTags has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function parseTags( $patterns ) {
        $messageKeys = $this->getKeys();

        $matches = [];

Severity: Minor
Found in messagegroups/MessageGroupBase.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute( $parameters ): void {
        $this->setHeaders();
        $this->addHelpLink( 'Help:Extension:Translate/Page translation administration' );

        $out = $this->getOutput();
Severity: Minor
Found in src/MessageGroupProcessing/AggregateGroupsSpecialPage.php - About 55 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 getMessage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMessage( $key, $code ) {
        $cache = $this->getMessageGroupCache( $code );
        if ( $cache->exists() ) {
            $msg = $cache->get( $key );

Severity: Minor
Found in messagegroups/FileBasedMessageGroup.php - About 55 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 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        array $priorityLanguages,
        bool $forcePriorityLanguages,
        string $priorityReason,
        array $noFuzzyUnits,
        bool $translateTitle,
Severity: Major
Found in src/PageTranslation/TranslatablePageSettings.php - About 50 mins to fix

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

            TranslatablePage $page,
            string $code,
            User $user,
            int $flags,
            string $summary,
    Severity: Major
    Found in src/PageTranslation/Hooks.php - About 50 mins to fix

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

              Title $source,
              Title $target,
              bool $moveSubPages,
              User $user,
              string $moveReason,
      Severity: Major
      Found in src/PageTranslation/TranslatableBundleMover.php - About 50 mins to fix

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

                Title $source,
                Title $target,
                array $pagesToMove,
                array $pagesToRedirect,
                User $performer,
        Severity: Major
        Found in src/PageTranslation/TranslatableBundleMover.php - About 50 mins to fix

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

                  ParserOutput $output,
                  WikiPageMessageGroup $group,
                  Language $targetLanguage,
                  Language $sourceLanguage,
                  bool $showOutdated,
          Severity: Major
          Found in src/PageTranslation/TranslationPage.php - About 50 mins to fix

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

                    LinkTarget $oldLinkTarget,
                    LinkTarget $newLinkTarget,
                    UserIdentity $userIdentity,
                    int $oldid,
                    int $newid,
            Severity: Major
            Found in src/PageTranslation/Hooks.php - About 50 mins to fix

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

                      Title $source,
                      ?Title $target,
                      User $user,
                      string $reason,
                      bool $moveSubPages,
              Severity: Major
              Found in src/PageTranslation/TranslatableBundleMover.php - About 50 mins to fix

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

                        WikiPage $wikiPage,
                        User $user,
                        TextContent $content,
                        $summary,
                        $minor,
                Severity: Major
                Found in src/PageTranslation/Hooks.php - About 50 mins to fix

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

                          $name, &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts
                  Severity: Major
                  Found in src/TranslatorInterface/CleanChangesFilters.php - About 50 mins to fix

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

                            WebRequest $req,
                            MessageSourceChange $sourceChanges,
                            string $id,
                            string $key,
                            string $language,
                    Severity: Major
                    Found in src/Synchronization/ManageGroupsSpecialPage.php - About 50 mins to fix

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

                              MessageGroup $group,
                              MessageSourceChange $sourceChanges,
                              WebRequest $req,
                              string $language,
                              array &$postponed,
                      Severity: Major
                      Found in src/Synchronization/ManageGroupsSpecialPage.php - About 50 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language