wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 1,238 of 1,238 total issues

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

    opaquer: function (ratio) {
        var alpha = this.values.alpha;
        this.setValues('alpha', alpha + (alpha * ratio));
        return this;
    },
Severity: Minor
Found in resources/lib/Chart.js/Chart.js and 1 other location - About 40 mins to fix
resources/lib/Chart.js/Chart.js on lines 1901..1905

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 49.

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

        for (i = 0, ilen = rects.length; i < ilen; ++i) {
            me.updateElement(rects[i], i, reset);
        }
Severity: Minor
Found in resources/lib/Chart.js/Chart.js and 1 other location - About 40 mins to fix
resources/lib/Chart.js/Chart.js on lines 5522..5524

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 49.

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 3 locations. Consider refactoring.
Open

            if ( obj === undefined || obj.missing === '' ) {
                $errorBox.text( mw.msg( 'pm-page-does-not-exist', pageTitle ) ).removeClass( 'hide' );
                return $.Deferred().reject();
            }
Severity: Major
Found in resources/js/ext.translate.special.pagemigration.js and 2 other locations - About 40 mins to fix
resources/js/ext.translate.special.pagemigration.js on lines 59..62
resources/js/ext.translate.special.pagemigration.js on lines 103..114

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 49.

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 3 locations. Consider refactoring.
Open

            if ( obj.revisions === undefined ) {
                $errorBox.text( mw.msg( 'pm-old-translations-missing', pageTitle ) ).removeClass( 'hide' );
                return $.Deferred().reject();
            } else {
                // FB over here refers to FuzzyBot
Severity: Major
Found in resources/js/ext.translate.special.pagemigration.js and 2 other locations - About 40 mins to fix
resources/js/ext.translate.special.pagemigration.js on lines 59..62
resources/js/ext.translate.special.pagemigration.js on lines 97..100

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 49.

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 3 locations. Consider refactoring.
Open

            if ( obj === undefined || obj.missing ) {
                $errorBox.text( mw.msg( 'pm-page-does-not-exist', pageTitle ) ).removeClass( 'hide' );
                return $.Deferred().reject();
            }
Severity: Major
Found in resources/js/ext.translate.special.pagemigration.js and 2 other locations - About 40 mins to fix
resources/js/ext.translate.special.pagemigration.js on lines 97..100
resources/js/ext.translate.special.pagemigration.js on lines 103..114

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 49.

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

        for (i = 0, ilen = arcs.length; i < ilen; ++i) {
            me.updateElement(arcs[i], i, reset);
        }
Severity: Minor
Found in resources/lib/Chart.js/Chart.js and 1 other location - About 40 mins to fix
resources/lib/Chart.js/Chart.js on lines 4894..4896

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 49.

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

    public function getByTag( string $tag ): array {
        $dbr = $this->dbProvider->getReplicaDatabase( self::VIRTUAL_DOMAIN );
        $rows = $dbr->newSelectQueryBuilder()
            ->select( [ 'tc_key', 'tc_value', 'tc_exptime', 'tc_tag' ] )
            ->from( self::TABLE_NAME )
Severity: Minor
Found in src/Cache/PersistentDatabaseCache.php and 1 other location - About 40 mins to fix
src/Cache/PersistentDatabaseCache.php on lines 28..38

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 94.

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

    public function get( string ...$keynames ): array {
        $dbr = $this->dbProvider->getReplicaDatabase( self::VIRTUAL_DOMAIN );
        $rows = $dbr->newSelectQueryBuilder()
            ->select( [ 'tc_key', 'tc_value', 'tc_exptime', 'tc_tag' ] )
            ->from( self::TABLE_NAME )
Severity: Minor
Found in src/Cache/PersistentDatabaseCache.php and 1 other location - About 40 mins to fix
src/Cache/PersistentDatabaseCache.php on lines 41..51

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 94.

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

Consider simplifying this complex logical expression.
Open

                if (
                    e.type === 'keydown' &&
                    e.altKey === true &&
                    e.ctrlKey === false &&
                    e.shiftKey === false &&
Severity: Major
Found in resources/js/ext.translate.editor.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

        if (helpers$1.isObject(value)) {
            t = +value.top || 0;
            r = +value.right || 0;
            b = +value.bottom || 0;
            l = +value.left || 0;
    Severity: Major
    Found in resources/lib/Chart.js/Chart.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if (helpers_core.isObject(value)) {
                  t = +value.top || 0;
                  r = +value.right || 0;
                  b = +value.bottom || 0;
                  l = +value.left || 0;
      Severity: Major
      Found in resources/lib/Chart.js/Chart.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                    if (i === me.zeroLineIndex && options.offset === offsetGridLines) {
                        // Draw the first index specially
                        lineWidth = gridLines.zeroLineWidth;
                        lineColor = gridLines.zeroLineColor;
                        borderDash = gridLines.zeroLineBorderDash || [];
        Severity: Major
        Found in resources/lib/Chart.js/Chart.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                  if ( $title && $type === 'addition' && $title->exists() ) {
                      // The message has for some reason dropped out from cache
                      // or, perhaps it is being reused. In any case treat it
                      // as a change for display, so the admin can see if
                      // action is needed and let the message be processed.
          Severity: Major
          Found in src/Synchronization/ManageGroupsSpecialPage.php - About 40 mins to fix

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

                    for (i = 0, ilen = points.length; i < ilen; ++i) {
                        points[i].pivot();
                    }
            Severity: Minor
            Found in resources/lib/Chart.js/Chart.js and 1 other location - About 40 mins to fix
            resources/lib/Chart.js/Chart.js on lines 5911..5913

            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 48.

            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

                    for (i = 0, ilen = points.length; i < ilen; ++i) {
                        points[i].pivot();
                    }
            Severity: Minor
            Found in resources/lib/Chart.js/Chart.js and 1 other location - About 40 mins to fix
            resources/lib/Chart.js/Chart.js on lines 6522..6524

            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 48.

            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 determineLimits has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function determineLimits(angle, pos, size, min, max) {
            Severity: Minor
            Found in resources/lib/Chart.js/Chart.js - About 35 mins to fix

              Function determineUnitForFormatting has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {
              Severity: Minor
              Found in resources/lib/Chart.js/Chart.js - About 35 mins to fix

                Function getMessages has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        getMessages: function ( messageGroup, language, offset, limit, filter ) {
                Severity: Minor
                Found in resources/js/ext.translate.messagetable.js - About 35 mins to fix

                  Function createEvent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function createEvent(type, chart, x, y, nativeEvent) {
                  Severity: Minor
                  Found in resources/lib/Chart.js/Chart.js - About 35 mins to fix

                    Function measureText has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        helpers$1.measureText = function(ctx, data, gc, longest, string) {
                    Severity: Minor
                    Found in resources/lib/Chart.js/Chart.js - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language