wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Function parserCore has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def parserCore(fp, pos, beginmark=None, endmark=None):
    if beginmark and endmark:
        start = False
    else:
        start = True
Severity: Minor
Found in maintenance/language/zhtable/Makefile.py - About 1 hr 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

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

$namespaceNames = [
    NS_SPECIAL          => 'Ispetziale',
    NS_TALK             => 'Cuntierra',
    NS_USER             => 'Usuàriu',
    NS_USER_TALK        => 'Cuntierra_usuàriu',
Severity: Major
Found in languages/messages/MessagesSc.php and 5 other locations - About 1 hr to fix
languages/messages/MessagesAng.php on lines 8..22
languages/messages/MessagesLez.php on lines 24..38
languages/messages/MessagesLfn.php on lines 14..28
languages/messages/MessagesMhr.php on lines 19..33
languages/messages/MessagesPdc.php on lines 16..30

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

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

$namespaceNames = [
    NS_TALK             => 'Dischbedutt',
    NS_USER             => 'Yuuser',
    NS_USER_TALK        => 'Yuuser_Dischbedutt',
    NS_PROJECT_TALK     => '$1_Dischbedutt',
Severity: Major
Found in languages/messages/MessagesPdc.php and 5 other locations - About 1 hr to fix
languages/messages/MessagesAng.php on lines 8..22
languages/messages/MessagesLez.php on lines 24..38
languages/messages/MessagesLfn.php on lines 14..28
languages/messages/MessagesMhr.php on lines 19..33
languages/messages/MessagesSc.php on lines 14..28

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

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

$namespaceNames = [
    NS_SPECIAL          => 'Spesial',
    NS_TALK             => 'Discute',
    NS_USER             => 'Usor',
    NS_USER_TALK        => 'Usor_Discute',
Severity: Major
Found in languages/messages/MessagesLfn.php and 5 other locations - About 1 hr to fix
languages/messages/MessagesAng.php on lines 8..22
languages/messages/MessagesLez.php on lines 24..38
languages/messages/MessagesMhr.php on lines 19..33
languages/messages/MessagesPdc.php on lines 16..30
languages/messages/MessagesSc.php on lines 14..28

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

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

$namespaceNames = [
    NS_SPECIAL          => 'Лӱмын_ыштыме',
    NS_TALK             => 'Каҥашымаш',
    NS_USER             => 'Пайдаланыше',
    NS_USER_TALK        => 'Пайдаланышын_каҥашымашыже',
Severity: Major
Found in languages/messages/MessagesMhr.php and 5 other locations - About 1 hr to fix
languages/messages/MessagesAng.php on lines 8..22
languages/messages/MessagesLez.php on lines 24..38
languages/messages/MessagesLfn.php on lines 14..28
languages/messages/MessagesPdc.php on lines 16..30
languages/messages/MessagesSc.php on lines 14..28

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

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

$namespaceAliases = [
    'Дискусси'                    => NS_TALK,
    'Архайæджы_дискусси'          => NS_USER_TALK,
    'Дискусси_$1'                 => NS_PROJECT_TALK,
    'Ныв'                         => NS_FILE,
Severity: Major
Found in languages/messages/MessagesOs.php and 4 other locations - About 1 hr to fix
languages/messages/MessagesAng.php on lines 24..38
languages/messages/MessagesBa.php on lines 29..43
languages/messages/MessagesOr.php on lines 59..73
languages/messages/MessagesSzl.php on lines 44..59

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

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

$namespaceNames = [
    NS_MEDIA            => 'Медиа',
    NS_TALK             => 'Веревирд_авун',
    NS_USER             => 'Уртах',
    NS_USER_TALK        => 'Уртахдин_веревирд_авун',
Severity: Major
Found in languages/messages/MessagesLez.php and 5 other locations - About 1 hr to fix
languages/messages/MessagesAng.php on lines 8..22
languages/messages/MessagesLfn.php on lines 14..28
languages/messages/MessagesMhr.php on lines 19..33
languages/messages/MessagesPdc.php on lines 16..30
languages/messages/MessagesSc.php on lines 14..28

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

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

$namespaceNames = [
    NS_SPECIAL          => 'Syndrig',
    NS_TALK             => 'Mōtung',
    NS_USER             => 'Brūcend',
    NS_USER_TALK        => 'Brūcendmōtung',
Severity: Major
Found in languages/messages/MessagesAng.php and 5 other locations - About 1 hr to fix
languages/messages/MessagesLez.php on lines 24..38
languages/messages/MessagesLfn.php on lines 14..28
languages/messages/MessagesMhr.php on lines 19..33
languages/messages/MessagesPdc.php on lines 16..30
languages/messages/MessagesSc.php on lines 14..28

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

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

$namespaceAliases = [
    'ବ୍ୟବହାରକାରି'          => NS_USER,
    'ବ୍ୟବହାରକାରିଁକ_ଆଲୋଚନା' => NS_USER_TALK,
    'ବ୍ୟବାହାରକାରୀ'          => NS_USER,
    'ବ୍ୟବାହାରକାରୀଙ୍କ_ଆଲୋଚନା' => NS_USER_TALK,
Severity: Major
Found in languages/messages/MessagesOr.php and 4 other locations - About 1 hr to fix
languages/messages/MessagesAng.php on lines 24..38
languages/messages/MessagesBa.php on lines 29..43
languages/messages/MessagesOs.php on lines 35..49
languages/messages/MessagesSzl.php on lines 44..59

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

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

$namespaceAliases = [
    'Ярҙамсы'                     => NS_SPECIAL,
    'Фекер_алышыу'                => NS_TALK,
    'Ҡатнашыусы_м-н_фекер_алышыу' => NS_USER_TALK,
    '$1_б-са_фекер_алышыу'        => NS_PROJECT_TALK,
Severity: Major
Found in languages/messages/MessagesBa.php and 4 other locations - About 1 hr to fix
languages/messages/MessagesAng.php on lines 24..38
languages/messages/MessagesOr.php on lines 59..73
languages/messages/MessagesOs.php on lines 35..49
languages/messages/MessagesSzl.php on lines 44..59

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

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

$namespaceAliases = [
    // Aliases for Polish namespaces (T36988).
    'Specjalna'            => NS_SPECIAL,
    'Dyskusja'             => NS_TALK,
    'Użytkownik'           => NS_USER,
Severity: Major
Found in languages/messages/MessagesSzl.php and 4 other locations - About 1 hr to fix
languages/messages/MessagesAng.php on lines 24..38
languages/messages/MessagesBa.php on lines 29..43
languages/messages/MessagesOr.php on lines 59..73
languages/messages/MessagesOs.php on lines 35..49

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

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

$namespaceAliases = [
    'Gesprec'       => NS_TALK,
    'Motung'        => NS_TALK,
    'Brucend'       => NS_USER,
    'Brucendmotung' => NS_USER_TALK,
Severity: Major
Found in languages/messages/MessagesAng.php and 4 other locations - About 1 hr to fix
languages/messages/MessagesBa.php on lines 29..43
languages/messages/MessagesOr.php on lines 59..73
languages/messages/MessagesOs.php on lines 35..49
languages/messages/MessagesSzl.php on lines 44..59

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

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

    function togglingHandler( $toggle, $collapsible, e, options ) {
        options = options || {};

        if ( e ) {
            if (
Severity: Minor
Found in resources/src/jquery/jquery.makeCollapsible.js - About 1 hr to fix

    Function newFromUserInput has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Title.newFromUserInput = function ( title, defaultNamespace, options ) {
        let namespace = parseInt( defaultNamespace ) || NS_MAIN;
    
        // merge options into defaults
        options = Object.assign( {
    Severity: Minor
    Found in resources/src/mediawiki.Title/Title.js - About 1 hr to fix

      Function fn has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          fn(state) {
            return __async(this, null, function* () {
              const {
                rects
              } = state;
      Severity: Minor
      Found in resources/lib/codex/codex.js - About 1 hr to fix

        Function setup has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          setup(props, { emit }) {
            const {
              rootElement,
              assignTemplateRef,
              onFocus,
        Severity: Minor
        Found in resources/lib/codex/codex.js - About 1 hr to fix

          Function hasDontEnumBug has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  var hasDontEnumBug = (function () {
                      var obj = {
                          constructor: function () {
                              return "0";
                          },
          Severity: Minor
          Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

            Function stub has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function stub(object, property, func) {
                        if (!!func && typeof func !== "function" && typeof func !== "object") {
                            throw new TypeError("Custom stub should be a function or a property descriptor");
                        }
            
            
            Severity: Minor
            Found in resources/lib/sinonjs/sinon.js - About 1 hr to fix

              Function diff has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function diff(input, units, asFloat) {
                      var that, zoneDelta, output;
              
                      if (!this.isValid()) {
                          return NaN;
              Severity: Minor
              Found in resources/lib/moment/moment.js - About 1 hr to fix

                Function populate has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                OO.ui.ToolGroup.prototype.populate = function () {
                    const toolFactory = this.toolbar.getToolFactory(),
                        names = {},
                        add = [],
                        remove = [],
                Severity: Minor
                Found in resources/lib/ooui/oojs-ui-toolbars.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language