wikimedia/mediawiki-core

View on GitHub

Showing 11,779 of 11,779 total issues

File SkinTemplate.php has 1059 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Copyright © Gabriel Wicke -- http://www.aulinx.de/
 *
 * This program is free software; you can redistribute it and/or modify
Severity: Major
Found in includes/skins/SkinTemplate.php - About 2 days to fix

    User has 136 functions (exceeds 20 allowed). Consider refactoring.
    Open

    #[AllowDynamicProperties]
    class User implements Authority, UserIdentity, UserEmailContact {
        use DebugInfoTrait;
        use ProtectedHookAccessorTrait;
        use WikiAwareEntityTrait;
    Severity: Major
    Found in includes/user/User.php - About 2 days to fix

      File has 135 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class File implements MediaHandlerState {
          use ProtectedHookAccessorTrait;
      
          // Bitfield values akin to the revision deletion constants
          public const DELETED_FILE = 1;
      Severity: Major
      Found in includes/filerepo/file/File.php - About 2 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/gd.js and 1 other location - About 2 days to fix
        resources/lib/moment/locale/ga.js on lines 5..106

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

        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/ga.js and 1 other location - About 2 days to fix
        resources/lib/moment/locale/gd.js on lines 5..106

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

        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

        Method buildDomTreeArrayFromText has 523 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function buildDomTreeArrayFromText( $text, $flags ) {
                $forInclusion = ( $flags & self::DOM_FOR_INCLUSION );
                $langConversionDisabled = ( $flags & self::DOM_LANG_CONVERSION_DISABLED );
        
                $xmlishElements = $this->parser->getStripList();
        Severity: Major
        Found in includes/parser/Preprocessor_Hash.php - About 2 days to fix

          File Sanitizer.php has 1036 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * HTML sanitizer for %MediaWiki.
           *
           * Copyright © 2002-2005 Brooke Vibber <bvibber@wikimedia.org> et al
          Severity: Major
          Found in includes/parser/Sanitizer.php - About 2 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/ur.js and 1 other location - About 2 days to fix
            resources/lib/moment/locale/sd.js on lines 5..92

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

            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/sd.js and 1 other location - About 2 days to fix
            resources/lib/moment/locale/ur.js on lines 6..93

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

            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 7 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/en-ie.js and 6 other locations - About 2 days to fix
            resources/lib/moment/locale/en-au.js on lines 5..79
            resources/lib/moment/locale/en-gb.js on lines 5..79
            resources/lib/moment/locale/en-in.js on lines 5..79
            resources/lib/moment/locale/en-nz.js on lines 5..79
            resources/lib/moment/locale/en-sg.js on lines 5..79
            resources/lib/moment/locale/tet.js on lines 7..79

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

            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 7 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/en-gb.js and 6 other locations - About 2 days to fix
            resources/lib/moment/locale/en-au.js on lines 5..79
            resources/lib/moment/locale/en-ie.js on lines 5..79
            resources/lib/moment/locale/en-in.js on lines 5..79
            resources/lib/moment/locale/en-nz.js on lines 5..79
            resources/lib/moment/locale/en-sg.js on lines 5..79
            resources/lib/moment/locale/tet.js on lines 7..79

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

            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 7 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/en-in.js and 6 other locations - About 2 days to fix
            resources/lib/moment/locale/en-au.js on lines 5..79
            resources/lib/moment/locale/en-gb.js on lines 5..79
            resources/lib/moment/locale/en-ie.js on lines 5..79
            resources/lib/moment/locale/en-nz.js on lines 5..79
            resources/lib/moment/locale/en-sg.js on lines 5..79
            resources/lib/moment/locale/tet.js on lines 7..79

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

            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 7 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/tet.js and 6 other locations - About 2 days to fix
            resources/lib/moment/locale/en-au.js on lines 5..79
            resources/lib/moment/locale/en-gb.js on lines 5..79
            resources/lib/moment/locale/en-ie.js on lines 5..79
            resources/lib/moment/locale/en-in.js on lines 5..79
            resources/lib/moment/locale/en-nz.js on lines 5..79
            resources/lib/moment/locale/en-sg.js on lines 5..79

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

            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 7 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/en-au.js and 6 other locations - About 2 days to fix
            resources/lib/moment/locale/en-gb.js on lines 5..79
            resources/lib/moment/locale/en-ie.js on lines 5..79
            resources/lib/moment/locale/en-in.js on lines 5..79
            resources/lib/moment/locale/en-nz.js on lines 5..79
            resources/lib/moment/locale/en-sg.js on lines 5..79
            resources/lib/moment/locale/tet.js on lines 7..79

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

            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 7 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/en-sg.js and 6 other locations - About 2 days to fix
            resources/lib/moment/locale/en-au.js on lines 5..79
            resources/lib/moment/locale/en-gb.js on lines 5..79
            resources/lib/moment/locale/en-ie.js on lines 5..79
            resources/lib/moment/locale/en-in.js on lines 5..79
            resources/lib/moment/locale/en-nz.js on lines 5..79
            resources/lib/moment/locale/tet.js on lines 7..79

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

            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 7 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/en-nz.js and 6 other locations - About 2 days to fix
            resources/lib/moment/locale/en-au.js on lines 5..79
            resources/lib/moment/locale/en-gb.js on lines 5..79
            resources/lib/moment/locale/en-ie.js on lines 5..79
            resources/lib/moment/locale/en-in.js on lines 5..79
            resources/lib/moment/locale/en-sg.js on lines 5..79
            resources/lib/moment/locale/tet.js on lines 7..79

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

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

            <?php
            /**
             * Parser functions provided by MediaWiki core
             *
             * This program is free software; you can redistribute it and/or modify
            Severity: Major
            Found in includes/parser/CoreParserFunctions.php - About 2 days to fix

              File GlobalFunctions.php has 1026 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * Global functions used everywhere.
               *
               * This program is free software; you can redistribute it and/or modify
              Severity: Major
              Found in includes/GlobalFunctions.php - About 2 days to fix

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

                    function translate(number, withoutSuffix, key) {
                        var result = number + ' ';
                        switch (key) {
                            case 'ss':
                                if (number === 1) {
                Severity: Major
                Found in resources/lib/moment/locale/bs.js and 1 other location - About 2 days to fix
                resources/lib/moment/locale/hr.js on lines 14..74

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

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                    function translate(number, withoutSuffix, key) {
                        var result = number + ' ';
                        switch (key) {
                            case 'ss':
                                if (number === 1) {
                Severity: Major
                Found in resources/lib/moment/locale/hr.js and 1 other location - About 2 days to fix
                resources/lib/moment/locale/bs.js on lines 15..75

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

                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