wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

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

<?php
/** Tyap
 *
 * @file
 * @ingroup Languages
Severity: Major
Found in languages/messages/MessagesKcg.php and 2 other locations - About 2 hrs to fix
languages/messages/MessagesGuw.php on lines 1..30
languages/messages/MessagesTk.php on lines 1..35

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

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

$namespaceAliases = [
    'Imaxe'               => NS_FILE,
    'Imaxe_alderique'     => NS_FILE_TALK,
    'Discusión'           => NS_TALK,
    'Usuariu_discusión'   => NS_USER_TALK,
Severity: Major
Found in languages/messages/MessagesAst.php and 3 other locations - About 2 hrs to fix
includes/export/DumpNamespaceFilter.php on lines 43..59
languages/messages/MessagesBcc.php on lines 31..48
languages/messages/MessagesGag.php on lines 29..47

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

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

        $constants = [
            "NS_MAIN"           => NS_MAIN,
            "NS_TALK"           => NS_TALK,
            "NS_USER"           => NS_USER,
            "NS_USER_TALK"      => NS_USER_TALK,
Severity: Major
Found in includes/export/DumpNamespaceFilter.php and 3 other locations - About 2 hrs to fix
languages/messages/MessagesAst.php on lines 29..46
languages/messages/MessagesBcc.php on lines 31..48
languages/messages/MessagesGag.php on lines 29..47

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

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

            'GrantRiskGroups' => [
                'basic' => 'low',
                'editpage' => 'low',
                'createeditmovepage' => 'low',
                'editprotected' => 'vandalism',
Severity: Major
Found in includes/config-schema.php and 2 other locations - About 2 hrs to fix
includes/MainConfigSchema.php on lines 9087..9124
includes/config-schema.php on lines 1741..1768

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

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

<?php
/** Gun (Gungbe)
 *
 * @file
 * @ingroup Languages
Severity: Major
Found in languages/messages/MessagesGuw.php and 2 other locations - About 2 hrs to fix
languages/messages/MessagesKcg.php on lines 1..29
languages/messages/MessagesTk.php on lines 1..35

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

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

$namespaceAliases = [
    'مدیا' => NS_MEDIA,
    'ویژه' => NS_SPECIAL,
    'بحث' => NS_TALK,
    'کاربر' => NS_USER,
Severity: Major
Found in languages/messages/MessagesBcc.php and 3 other locations - About 2 hrs to fix
includes/export/DumpNamespaceFilter.php on lines 43..59
languages/messages/MessagesAst.php on lines 29..46
languages/messages/MessagesGag.php on lines 29..47

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

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

$namespaceAliases = [
    # Turkish namespaces
    'Medya'              => NS_MEDIA,
    'Özel'               => NS_SPECIAL,
    'Tartışma'           => NS_TALK,
Severity: Major
Found in languages/messages/MessagesGag.php and 3 other locations - About 2 hrs to fix
includes/export/DumpNamespaceFilter.php on lines 43..59
languages/messages/MessagesAst.php on lines 29..46
languages/messages/MessagesBcc.php on lines 31..48

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

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

            'GrantPermissionGroups' => [
                'basic' => 'hidden',
                'editpage' => 'page-interaction',
                'createeditmovepage' => 'page-interaction',
                'editprotected' => 'page-interaction',
Severity: Major
Found in includes/config-schema.php and 2 other locations - About 2 hrs to fix
includes/MainConfigSchema.php on lines 9087..9124
includes/config-schema.php on lines 1769..1796

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

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

        'default' =>
            [
                // Hidden grants are implicitly present
                'basic'               => 'hidden',

Severity: Major
Found in includes/MainConfigSchema.php and 2 other locations - About 2 hrs to fix
includes/config-schema.php on lines 1741..1768
includes/config-schema.php on lines 1769..1796

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

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

<?php
/** Turkmen (Türkmençe)
 *
 * @file
 * @ingroup Languages
Severity: Major
Found in languages/messages/MessagesTk.php and 2 other locations - About 2 hrs to fix
languages/messages/MessagesGuw.php on lines 1..30
languages/messages/MessagesKcg.php on lines 1..29

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

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 convertGrammar has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        convertGrammar: function ( word, form ) {
            form = form.toLowerCase();
            switch ( form ) {
                case 'ഉദ്ദേശിക':
                case 'dative':
Severity: Major
Found in resources/lib/jquery.i18n/src/languages/ml.js - About 2 hrs to fix

    Function algorithmNoTypo has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              algorithmNoTypo: function algorithmNoTypo(searchLowerCodes, prepared, searchLowerCode) {
                var targetLowerCodes = prepared._targetLowerCodes;
                var searchLen = searchLowerCodes.length;
                var targetLen = targetLowerCodes.length;
                var searchI = 0; // where we at
    Severity: Major
    Found in resources/lib/qunitjs/qunit.js - About 2 hrs to fix

      Function setMatcher has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
          if ( postFilter && !postFilter[ expando ] ) {
              postFilter = setMatcher( postFilter );
          }
          if ( postFinder && !postFinder[ expando ] ) {
      Severity: Major
      Found in resources/lib/jquery/jquery.js - About 2 hrs to fix

        Function handleStrictParse$1 has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function handleStrictParse$1(weekdayName, format, strict) {
                var i,
                    ii,
                    mom,
                    llc = weekdayName.toLocaleLowerCase();
        Severity: Major
        Found in resources/lib/moment/moment.js - About 2 hrs to fix

          Function _mouseDrag has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _mouseDrag: function(event) {
                  var that = this;
                  this.dragged = true;
          
                  if (this.options.disabled)
          Severity: Major
          Found in resources/lib/jquery.ui/jquery.ui.selectable.js - About 2 hrs to fix

            Method getPermissionStatus has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getPermissionStatus(
                    $action,
                    User $user,
                    LinkTarget $page,
                    $rigor = self::RIGOR_SECURE,
            Severity: Major
            Found in includes/Permissions/PermissionManager.php - About 2 hrs to fix

              Method getRobotPolicy has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getRobotPolicy( $action, ParserOutput $pOutput = null ) {
                      $context = $this->getContext();
                      $mainConfig = $context->getConfig();
                      $articleRobotPolicies = $mainConfig->get( MainConfigNames::ArticleRobotPolicies );
                      $namespaceRobotPolicies = $mainConfig->get( MainConfigNames::NamespaceRobotPolicies );
              Severity: Major
              Found in includes/page/Article.php - About 2 hrs to fix

                Method writeRevision has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function writeRevision( $row, $slotRows = null ) {
                        $rev = $this->getRevisionStore()->newRevisionFromRowAndSlots(
                            $row,
                            $slotRows,
                            0,
                Severity: Major
                Found in includes/export/XmlDumpWriter.php - About 2 hrs to fix

                  Method renderNewRevision has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function renderNewRevision() {
                          if ( $this->isContentOverridden ) {
                              // The code below only works with a RevisionRecord object. We could construct a
                              // fake RevisionRecord (here or in setContent), but since this does not seem
                              // needed at the moment, we'll just fail for now.
                  Severity: Major
                  Found in includes/diff/DifferenceEngine.php - About 2 hrs to fix

                    Method tableNamesWithIndexClauseOrJOIN has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function tableNamesWithIndexClauseOrJOIN(
                            $tables,
                            $use_index = [],
                            $ignore_index = [],
                            $join_conds = []
                    Severity: Major
                    Found in includes/libs/rdbms/platform/SQLPlatform.php - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language