wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

        ServiceOptions $options,
        LoggerInterface $logger,
        ActorStoreFactory $actorStoreFactory,
        BlockRestrictionStore $blockRestrictionStore,
        CommentStore $commentStore,
Severity: Major
Found in includes/block/DatabaseBlockStore.php - About 1 hr to fix

    Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            WANObjectCache $wanCache,
            BagOStuff $clusterCache,
            BagOStuff $serverCache,
            Language $contLang,
            LanguageConverterFactory $langConverterFactory,
    Severity: Major
    Found in includes/language/MessageCache.php - About 1 hr to fix

      Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              ApiQuery $query,
              $moduleName,
              RevisionStore $revisionStore,
              IContentHandlerFactory $contentHandlerFactory,
              ParserFactory $parserFactory,
      Severity: Major
      Found in includes/api/ApiQueryAllDeletedRevisions.php - About 1 hr to fix

        Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                ApiQuery $query,
                $moduleName,
                RevisionStore $revisionStore,
                IContentHandlerFactory $contentHandlerFactory,
                ParserFactory $parserFactory,
        Severity: Major
        Found in includes/api/ApiQueryAllRevisions.php - About 1 hr to fix

          Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  ApiQuery $queryModule,
                  $moduleName,
                  $paramPrefix = '',
                  RevisionStore $revisionStore = null,
                  IContentHandlerFactory $contentHandlerFactory = null,
          Severity: Major
          Found in includes/api/ApiQueryRevisionsBase.php - About 1 hr to fix

            Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    ApiQuery $query,
                    $moduleName,
                    RevisionStore $revisionStore,
                    IContentHandlerFactory $contentHandlerFactory,
                    ParserFactory $parserFactory,
            Severity: Major
            Found in includes/api/ApiQueryDeletedRevisions.php - About 1 hr to fix

              Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      LinkBatchFactory $linkBatchFactory,
                      PermissionManager $permissionManager,
                      IConnectionProvider $dbProvider,
                      RevisionStore $revisionStore,
                      NamespaceInfo $namespaceInfo,
              Severity: Major
              Found in includes/specials/SpecialContributions.php - About 1 hr to fix

                Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        PermissionManager $permissionManager,
                        IConnectionProvider $dbProvider,
                        RevisionStore $revisionStore,
                        NamespaceInfo $namespaceInfo,
                        UserNameUtils $userNameUtils,
                Severity: Major
                Found in includes/specials/SpecialDeletedContributions.php - About 1 hr to fix

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

                  $dateFormats = [
                  #   Please be cautious not to delete the invisible RLM from the beginning of the strings.
                      'mdy time' => '‏H:i',
                      'mdy date' => '‏xg j، Y "ج."',
                      'mdy both' => '‏H:i، xg j، Y "ج."',
                  Severity: Major
                  Found in languages/messages/MessagesKk_arab.php and 5 other locations - About 1 hr to fix
                  languages/messages/MessagesCs.php on lines 344..372
                  languages/messages/MessagesKk_cyrl.php on lines 112..140
                  languages/messages/MessagesKk_latn.php on lines 103..131
                  languages/messages/MessagesMk.php on lines 63..91
                  languages/messages/MessagesZh_tw.php on lines 65..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 113.

                  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

                  $dateFormats = [
                      'dmy mk time' => 'H:i',
                      'dmy mk date' => 'j.m.Y',
                      'dmy mk both' => 'H:i, j.m.Y',
                  
                  
                  Severity: Major
                  Found in languages/messages/MessagesMk.php and 5 other locations - About 1 hr to fix
                  languages/messages/MessagesCs.php on lines 344..372
                  languages/messages/MessagesKk_arab.php on lines 123..152
                  languages/messages/MessagesKk_cyrl.php on lines 112..140
                  languages/messages/MessagesKk_latn.php on lines 103..131
                  languages/messages/MessagesZh_tw.php on lines 65..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 113.

                  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

                  $dateFormats = [
                      'zh time'                => 'H:i',
                      'zh date'                => 'Y年n月j日 (l)',
                      'zh both'                => 'Y年n月j日 (D) H:i',
                  
                  
                  Severity: Major
                  Found in languages/messages/MessagesZh_tw.php and 5 other locations - About 1 hr to fix
                  languages/messages/MessagesCs.php on lines 344..372
                  languages/messages/MessagesKk_arab.php on lines 123..152
                  languages/messages/MessagesKk_cyrl.php on lines 112..140
                  languages/messages/MessagesKk_latn.php on lines 103..131
                  languages/messages/MessagesMk.php on lines 63..91

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

                  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

                  $dateFormats = [
                      'mdy time' => 'H:i',
                      'mdy date' => 'xg j, Y "j."',
                      'mdy both' => 'H:i, xg j, Y "j."',
                  
                  
                  Severity: Major
                  Found in languages/messages/MessagesKk_latn.php and 5 other locations - About 1 hr to fix
                  languages/messages/MessagesCs.php on lines 344..372
                  languages/messages/MessagesKk_arab.php on lines 123..152
                  languages/messages/MessagesKk_cyrl.php on lines 112..140
                  languages/messages/MessagesMk.php on lines 63..91
                  languages/messages/MessagesZh_tw.php on lines 65..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 113.

                  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

                  $dateFormats = [
                      'mdy time' => 'H:i',
                      'mdy date' => 'xg j, Y "ж."',
                      'mdy both' => 'H:i, xg j, Y "ж."',
                  
                  
                  Severity: Major
                  Found in languages/messages/MessagesKk_cyrl.php and 5 other locations - About 1 hr to fix
                  languages/messages/MessagesCs.php on lines 344..372
                  languages/messages/MessagesKk_arab.php on lines 123..152
                  languages/messages/MessagesKk_latn.php on lines 103..131
                  languages/messages/MessagesMk.php on lines 63..91
                  languages/messages/MessagesZh_tw.php on lines 65..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 113.

                  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

                  $dateFormats = [
                      'ČSN basic dt time' => 'H:i',
                      'ČSN basic dt date' => 'j. n. Y',
                      'ČSN basic dt both' => 'j. n. Y, H:i',
                  
                  
                  Severity: Major
                  Found in languages/messages/MessagesCs.php and 5 other locations - About 1 hr to fix
                  languages/messages/MessagesKk_arab.php on lines 123..152
                  languages/messages/MessagesKk_cyrl.php on lines 112..140
                  languages/messages/MessagesKk_latn.php on lines 103..131
                  languages/messages/MessagesMk.php on lines 63..91
                  languages/messages/MessagesZh_tw.php on lines 65..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 113.

                  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

                  $magicWords = [
                      'img_left'                  => [ '1', 'ఎడమ', 'left' ],
                      'img_right'                 => [ '1', 'కుడి', 'right' ],
                      'notoc'                     => [ '0', '__విషయసూచికవద్దు__', '__NOTOC__' ],
                      'pagename'                  => [ '1', 'పేజీపేరు', 'PAGENAME' ],
                  Severity: Major
                  Found in languages/messages/MessagesTe.php and 1 other location - About 1 hr to fix
                  languages/messages/MessagesPa.php on lines 172..180

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

                  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

                  $magicWords = [
                      'defaultsort_noerror'       => [ '0', 'ਗਲਤੀ_ਨਹੀਂ', 'noerror' ],
                      'pagesincategory_all'       => [ '0', 'ਸਬ', 'all' ],
                      'pagesincategory_files'     => [ '0', 'ਫ਼ਾਈਲਾਂ', 'files' ],
                      'pagesincategory_pages'     => [ '0', 'ਪੰਨੇ', 'pages' ],
                  Severity: Major
                  Found in languages/messages/MessagesPa.php and 1 other location - About 1 hr to fix
                  languages/messages/MessagesTe.php on lines 137..145

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

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

                      mw.widgets.datetime.DateTimeInputWidget.prototype.updateValueFromFields = function () {
                          let i, v, $field, spec, curDate, newDate,
                              anyInvalid = false,
                              anyEmpty = false,
                              allEmpty = true;
                  Severity: Minor
                  Found in resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js - About 1 hr to fix

                    Function init has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            init: function () {
                                windowManager = new OO.ui.WindowManager();
                                $( OO.ui.getTeleportTarget() ).append( windowManager.$element );
                                windowManager.addWindows( {
                                    errorAlert: new OO.ui.MessageDialog()
                    Severity: Minor
                    Found in resources/src/mediawiki.special.apisandbox/apisandbox.js - About 1 hr to fix

                      Function convertGrammar has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      mw.language.convertGrammar = function ( word, form ) {
                          const grammarForms = mw.language.getData( 'la', 'grammarForms' );
                          if ( grammarForms && grammarForms[ form ] ) {
                              return grammarForms[ form ][ word ];
                          }
                      Severity: Minor
                      Found in resources/src/mediawiki.language/languages/la.js - About 1 hr to fix

                        Function trimLength has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function trimLength( safeVal, newVal, length, lengthFn ) {
                                let startMatches, endMatches, matchesLen, inpParts, chopOff, oldChar, newChar,
                                    oldVal = safeVal;
                        
                                // Run the hook if one was provided, but only on the length
                        Severity: Minor
                        Found in resources/src/mediawiki.String.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language