wikimedia/mediawiki-core

View on GitHub

Showing 10,731 of 10,731 total issues

Function Sizzle has 1459 lines of code (exceeds 25 allowed). Consider refactoring.
Open

(function( window ) {

var i,
    support,
    Expr,
Severity: Major
Found in resources/lib/jquery/jquery.js - About 1 wk to fix

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

    <?php
    /**
     * API for MediaWiki 1.17+
     *
     * Copyright © 2011 Sam Reed
    Severity: Major
    Found in includes/api/ApiQueryLangBacklinks.php and 1 other location - About 1 wk to fix
    includes/api/ApiQueryIWBacklinks.php on lines 1..223

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

    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

    <?php
    /**
     * API for MediaWiki 1.17+
     *
     * Copyright © 2010 Sam Reed
    Severity: Major
    Found in includes/api/ApiQueryIWBacklinks.php and 1 other location - About 1 wk to fix
    includes/api/ApiQueryLangBacklinks.php on lines 1..222

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

    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 User.php has 2360 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Implements the User class for the %MediaWiki software.
     *
     * This program is free software; you can redistribute it and/or modify
    Severity: Major
    Found in includes/user/User.php - About 6 days to fix

      File Title.php has 2311 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Representation of a title within MediaWiki.
       *
       * See Title.md
      Severity: Major
      Found in includes/Title.php - About 6 days to fix

        Function preprocessToObj has a Cognitive Complexity of 312 (exceeds 5 allowed). Consider refactoring.
        Open

            public function preprocessToObj( $text, $flags = 0 ) {
                global $wgDisableLangConversion;
        
                $tree = $this->cacheGetTree( $text, $flags );
                if ( $tree !== false ) {
        Severity: Minor
        Found in includes/parser/Preprocessor_Hash.php - About 6 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

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

        $specialPageAliases = [
            'Activeusers'               => [ 'Көхтөөх_кыттааччылар' ],
            'Allmessages'               => [ 'Тиһик_биллэриилэрэ' ],
            'AllMyUploads'              => [ 'Билэлэрим_барыта' ],
            'Allpages'                  => [ 'Сирэй_барыта' ],
        Severity: Major
        Found in languages/messages/MessagesSah.php and 1 other location - About 6 days to fix
        languages/messages/MessagesTg_cyrl.php on lines 40..140

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

        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

        $specialPageAliases = [
            'Activeusers'               => [ 'Корбарони_фаъол' ],
            'Allmessages'               => [ 'Паёмҳои_системавӣ' ],
            'AllMyUploads'              => [ 'Тамоми_парвандаҳои_ман' ],
            'Allpages'                  => [ 'Тамоми_саҳифаҳо' ],
        Severity: Major
        Found in languages/messages/MessagesTg_cyrl.php and 1 other location - About 6 days to fix
        languages/messages/MessagesSah.php on lines 53..153

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

        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

        $specialPageAliases = [
            'Activeusers'               => [ 'Жигара_декъашхой' ],
            'Allmessages'               => [ 'ГӀирса_хаамаш' ],
            'AllMyUploads'              => [ 'Сан_массо_файлаш' ],
            'Allpages'                  => [ 'Массо_агӀонаш' ],
        Severity: Major
        Found in languages/messages/MessagesCe.php and 1 other location - About 5 days to fix
        languages/messages/MessagesNds_nl.php on lines 220..319

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

        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

        $specialPageAliases = [
            'Activeusers'               => [ 'Aktieve_gebrukers' ],
            'Allmessages'               => [ 'Alle_systeemteksten' ],
            'Allpages'                  => [ 'Alle_ziejen' ],
            'Ancientpages'              => [ 'Oudste_ziejen' ],
        Severity: Major
        Found in languages/messages/MessagesNds_nl.php and 1 other location - About 5 days to fix
        languages/messages/MessagesCe.php on lines 67..166

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

        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 WikiPage.php has 2141 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * Base representation for a MediaWiki page.
         *
         * This program is free software; you can redistribute it and/or modify
        Severity: Major
        Found in includes/page/WikiPage.php - About 5 days to fix

          File OutputPage.php has 2080 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * Preparation for the final page rendering.
           *
           * This program is free software; you can redistribute it and/or modify
          Severity: Major
          Found in includes/OutputPage.php - About 5 days to fix

            Function makeFormattedData has a Cognitive Complexity of 266 (exceeds 5 allowed). Consider refactoring.
            Open

                public function makeFormattedData( $tags ) {
                    $resolutionunit = !isset( $tags['ResolutionUnit'] ) || $tags['ResolutionUnit'] == 2 ? 2 : 3;
                    unset( $tags['ResolutionUnit'] );
            
                    foreach ( $tags as $tag => &$vals ) {
            Severity: Minor
            Found in includes/media/FormatMetadata.php - About 5 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

            Database has 268 functions (exceeds 20 allowed). Consider refactoring.
            Open

            abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAwareInterface {
                /** @var BagOStuff APC cache */
                protected $srvCache;
                /** @var LoggerInterface */
                protected $connLogger;
            Severity: Major
            Found in includes/libs/rdbms/database/Database.php - About 5 days to fix

              File autoload.php has 1899 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              // This file is generated by maintenance/generateLocalAutoload.php, do not adjust manually
              // phpcs:disable Generic.Files.LineLength
              global $wgAutoloadLocalClasses;
              
              
              Severity: Major
              Found in autoload.php - About 5 days to fix

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

                $specialPageAliases = [
                    'Allmessages'               => [ 'Барлық_хабарлар' ],
                    'Allpages'                  => [ 'Барлық_беттер' ],
                    'Ancientpages'              => [ 'Ескі_беттер' ],
                    'Block'                     => [ 'Жайды_бұғаттау', 'IP_бұғаттау' ],
                Severity: Major
                Found in languages/messages/MessagesKk_cyrl.php and 1 other location - About 5 days to fix
                languages/messages/MessagesKk_latn.php on lines 261..340

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

                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

                $specialPageAliases = [
                    'Allmessages'               => [ 'Barlıq_xabarlar' ],
                    'Allpages'                  => [ 'Barlıq_better' ],
                    'Ancientpages'              => [ 'Eski_better' ],
                    'Block'                     => [ 'Jaýdı_buğattaw', 'IP_buğattaw' ],
                Severity: Major
                Found in languages/messages/MessagesKk_latn.php and 1 other location - About 5 days to fix
                languages/messages/MessagesKk_cyrl.php on lines 269..348

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

                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 DefaultSettings.php has 1876 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Default values for MediaWiki configuration settings.
                 *
                 *
                Severity: Major
                Found in includes/DefaultSettings.php - About 5 days to fix

                  Similar blocks of code found in 2 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/gom-deva.js and 1 other location - About 5 days to fix
                  resources/lib/moment/locale/gom-latn.js on lines 5..135

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

                  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

                  ;(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/gom-latn.js and 1 other location - About 5 days to fix
                  resources/lib/moment/locale/gom-deva.js on lines 5..135

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

                  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