wikimedia/mediawiki-core

View on GitHub

Showing 11,461 of 11,461 total issues

Method pageInfo has 418 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function pageInfo() {
        $user = $this->getUser();
        $lang = $this->getLanguage();
        $title = $this->getTitle();
        $id = $title->getArticleID();
Severity: Major
Found in includes/actions/InfoAction.php - About 2 days to fix

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

    ;(function (global, factory) {
       typeof exports === 'object' && typeof module !== 'undefined'
           && typeof require === 'function' ? factory(require('../moment')) :
       typeof define === 'function' && define.amd ? define(['../moment'], factory) :
       factory(global.moment)
    Severity: Major
    Found in resources/lib/moment/locale/fo.js and 4 other locations - About 2 days to fix
    resources/lib/moment/locale/da.js on lines 5..64
    resources/lib/moment/locale/mt.js on lines 5..66
    resources/lib/moment/locale/se.js on lines 5..68
    resources/lib/moment/locale/yo.js on lines 5..64

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

    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

    ;(function (global, factory) {
       typeof exports === 'object' && typeof module !== 'undefined'
           && typeof require === 'function' ? factory(require('../moment')) :
       typeof define === 'function' && define.amd ? define(['../moment'], factory) :
       factory(global.moment)
    Severity: Major
    Found in resources/lib/moment/locale/mt.js and 4 other locations - About 2 days to fix
    resources/lib/moment/locale/da.js on lines 5..64
    resources/lib/moment/locale/fo.js on lines 6..67
    resources/lib/moment/locale/se.js on lines 5..68
    resources/lib/moment/locale/yo.js on lines 5..64

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

    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

    ;(function (global, factory) {
       typeof exports === 'object' && typeof module !== 'undefined'
           && typeof require === 'function' ? factory(require('../moment')) :
       typeof define === 'function' && define.amd ? define(['../moment'], factory) :
       factory(global.moment)
    Severity: Major
    Found in resources/lib/moment/locale/yo.js and 4 other locations - About 2 days to fix
    resources/lib/moment/locale/da.js on lines 5..64
    resources/lib/moment/locale/fo.js on lines 6..67
    resources/lib/moment/locale/mt.js on lines 5..66
    resources/lib/moment/locale/se.js on lines 5..68

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

    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

    ;(function (global, factory) {
       typeof exports === 'object' && typeof module !== 'undefined'
           && typeof require === 'function' ? factory(require('../moment')) :
       typeof define === 'function' && define.amd ? define(['../moment'], factory) :
       factory(global.moment)
    Severity: Major
    Found in resources/lib/moment/locale/da.js and 4 other locations - About 2 days to fix
    resources/lib/moment/locale/fo.js on lines 6..67
    resources/lib/moment/locale/mt.js on lines 5..66
    resources/lib/moment/locale/se.js on lines 5..68
    resources/lib/moment/locale/yo.js on lines 5..64

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

    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

    ;(function (global, factory) {
       typeof exports === 'object' && typeof module !== 'undefined'
           && typeof require === 'function' ? factory(require('../moment')) :
       typeof define === 'function' && define.amd ? define(['../moment'], factory) :
       factory(global.moment)
    Severity: Major
    Found in resources/lib/moment/locale/se.js and 4 other locations - About 2 days to fix
    resources/lib/moment/locale/da.js on lines 5..64
    resources/lib/moment/locale/fo.js on lines 6..67
    resources/lib/moment/locale/mt.js on lines 5..66
    resources/lib/moment/locale/yo.js on lines 5..64

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

    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

    File FileModule.php has 858 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 2 of the License, or
    Severity: Major
    Found in includes/ResourceLoader/FileModule.php - About 2 days to fix

      File WikiImporter.php has 855 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * MediaWiki page data importer.
       *
       * Copyright © 2003,2005 Brooke Vibber <bvibber@wikimedia.org>
      Severity: Major
      Found in includes/import/WikiImporter.php - About 2 days to fix

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

        ;(function (global, factory) {
           typeof exports === 'object' && typeof module !== 'undefined'
               && typeof require === 'function' ? factory(require('../moment')) :
           typeof define === 'function' && define.amd ? define(['../moment'], factory) :
           factory(global.moment)
        Severity: Major
        Found in resources/lib/moment/locale/ar-dz.js and 4 other locations - About 2 days to fix
        resources/lib/moment/locale/ar-kw.js on lines 5..65
        resources/lib/moment/locale/ar-ma.js on lines 6..66
        resources/lib/moment/locale/ar-tn.js on lines 5..65
        resources/lib/moment/locale/sw.js on lines 5..65

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

        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

        ;(function (global, factory) {
           typeof exports === 'object' && typeof module !== 'undefined'
               && typeof require === 'function' ? factory(require('../moment')) :
           typeof define === 'function' && define.amd ? define(['../moment'], factory) :
           factory(global.moment)
        Severity: Major
        Found in resources/lib/moment/locale/ar-tn.js and 4 other locations - About 2 days to fix
        resources/lib/moment/locale/ar-dz.js on lines 5..65
        resources/lib/moment/locale/ar-kw.js on lines 5..65
        resources/lib/moment/locale/ar-ma.js on lines 6..66
        resources/lib/moment/locale/sw.js on lines 5..65

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

        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

        ;(function (global, factory) {
           typeof exports === 'object' && typeof module !== 'undefined'
               && typeof require === 'function' ? factory(require('../moment')) :
           typeof define === 'function' && define.amd ? define(['../moment'], factory) :
           factory(global.moment)
        Severity: Major
        Found in resources/lib/moment/locale/ar-kw.js and 4 other locations - About 2 days to fix
        resources/lib/moment/locale/ar-dz.js on lines 5..65
        resources/lib/moment/locale/ar-ma.js on lines 6..66
        resources/lib/moment/locale/ar-tn.js on lines 5..65
        resources/lib/moment/locale/sw.js on lines 5..65

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

        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

        ;(function (global, factory) {
           typeof exports === 'object' && typeof module !== 'undefined'
               && typeof require === 'function' ? factory(require('../moment')) :
           typeof define === 'function' && define.amd ? define(['../moment'], factory) :
           factory(global.moment)
        Severity: Major
        Found in resources/lib/moment/locale/sw.js and 4 other locations - About 2 days to fix
        resources/lib/moment/locale/ar-dz.js on lines 5..65
        resources/lib/moment/locale/ar-kw.js on lines 5..65
        resources/lib/moment/locale/ar-ma.js on lines 6..66
        resources/lib/moment/locale/ar-tn.js on lines 5..65

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

        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

        ;(function (global, factory) {
           typeof exports === 'object' && typeof module !== 'undefined'
               && typeof require === 'function' ? factory(require('../moment')) :
           typeof define === 'function' && define.amd ? define(['../moment'], factory) :
           factory(global.moment)
        Severity: Major
        Found in resources/lib/moment/locale/ar-ma.js and 4 other locations - About 2 days to fix
        resources/lib/moment/locale/ar-dz.js on lines 5..65
        resources/lib/moment/locale/ar-kw.js on lines 5..65
        resources/lib/moment/locale/ar-tn.js on lines 5..65
        resources/lib/moment/locale/sw.js on lines 5..65

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

        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

        File mediawiki.jqueryMsg.js has 852 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*!
        * Experimental advanced wikitext parser-emitter.
        * See: https://www.mediawiki.org/wiki/Extension:UploadWizard/MessageParser for docs
        *
        * @author neilk@wikimedia.org
        Severity: Major
        Found in resources/src/mediawiki.jqueryMsg/mediawiki.jqueryMsg.js - About 2 days to fix

          Function run has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring.
          Open

              public function run( $resultPageSet = null ) {
                  $user = $this->getUser();
                  /* Get the parameters of the request. */
                  $params = $this->extractRequestParams();
          
          
          Severity: Minor
          Found in includes/api/ApiQueryRecentChanges.php - About 2 days 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

          File RecentChange.php has 850 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * Utility class for creating and accessing recent change entries.
           *
           * This program is free software; you can redistribute it and/or modify
          Severity: Major
          Found in includes/changes/RecentChange.php - About 2 days to fix

            Method execute has 409 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function execute() {
                    $this->useTransactionalTimeLimit();
            
                    $user = $this->getUser();
                    $params = $this->extractRequestParams();
            Severity: Major
            Found in includes/api/ApiEditPage.php - About 2 days to fix

              File SpecialMovePage.php has 848 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * This program is free software; you can redistribute it and/or modify
               * it under the terms of the GNU General Public License as published by
               * the Free Software Foundation; either version 2 of the License, or
              Severity: Major
              Found in includes/specials/SpecialMovePage.php - About 2 days to fix

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

                ;(function (global, factory) {
                   typeof exports === 'object' && typeof module !== 'undefined'
                       && typeof require === 'function' ? factory(require('../moment')) :
                   typeof define === 'function' && define.amd ? define(['../moment'], factory) :
                   factory(global.moment)
                Severity: Major
                Found in resources/lib/moment/locale/tzm-latn.js and 4 other locations - About 2 days to fix
                resources/lib/moment/locale/bm.js on lines 5..62
                resources/lib/moment/locale/tzm.js on lines 5..64
                resources/lib/moment/locale/uz-latn.js on lines 5..64
                resources/lib/moment/locale/uz.js on lines 5..62

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

                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

                ;(function (global, factory) {
                   typeof exports === 'object' && typeof module !== 'undefined'
                       && typeof require === 'function' ? factory(require('../moment')) :
                   typeof define === 'function' && define.amd ? define(['../moment'], factory) :
                   factory(global.moment)
                Severity: Major
                Found in resources/lib/moment/locale/uz.js and 4 other locations - About 2 days to fix
                resources/lib/moment/locale/bm.js on lines 5..62
                resources/lib/moment/locale/tzm-latn.js on lines 5..64
                resources/lib/moment/locale/tzm.js on lines 5..64
                resources/lib/moment/locale/uz-latn.js on lines 5..64

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

                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

                Severity
                Category
                Status
                Source
                Language