wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Function fae3 has 1484 lines of code (exceeds 25 allowed). Consider refactoring.
Open

/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
Severity: Major
Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 wk to fix

    File tainted-ref.common.js has 2470 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module.exports =
    /******/ (function(modules) { // webpackBootstrap
    /******/     // The module cache
    /******/     var installedModules = {};
    /******/
    Severity: Major
    Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 6 days to fix

      File WikibaseRepo.ServiceWiring.php has 1857 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      declare( strict_types = 1 );
      
      use DataValues\Deserializers\DataValueDeserializer;
      Severity: Major
      Found in repo/WikibaseRepo.ServiceWiring.php - About 5 days to fix

        Function fae3 has a Cognitive Complexity of 229 (exceeds 5 allowed). Consider refactoring.
        Open

        /***/ (function(module, __webpack_exports__, __webpack_require__) {
        
        "use strict";
        // ESM COMPAT FLAG
        __webpack_require__.r(__webpack_exports__);
        Severity: Minor
        Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 4 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

        WikibaseRepo has 165 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class WikibaseRepo {
        
            /**
             * @warning This is for use with bootstrap code in WikibaseRepo.datatypes.php only!
             * Program logic should use WikibaseRepo::getDataTypeValidatorFactory() instead!
        Severity: Major
        Found in repo/includes/WikibaseRepo.php - About 3 days to fix

          File WbRestApi.ServiceWiring.php has 1254 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php declare( strict_types=1 );
          
          use MediaWiki\CommentStore\CommentStore;
          use MediaWiki\Context\RequestContext;
          use MediaWiki\MediaWikiServices;
          Severity: Major
          Found in repo/rest-api/src/WbRestApi.ServiceWiring.php - About 3 days to fix

            File resources.php has 1025 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            use MediaWiki\MediaWikiServices;
            use MediaWiki\ResourceLoader\Context;
            use MediaWiki\ResourceLoader\ResourceLoader;
            Severity: Major
            Found in view/resources.php - About 2 days to fix

              File WikibaseClient.ServiceWiring.php has 942 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              declare( strict_types = 1 );
              
              use DataValues\Deserializers\DataValueDeserializer;
              Severity: Major
              Found in client/WikibaseClient.ServiceWiring.php - About 2 days to fix

                File WikibaseRepo.php has 838 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                namespace Wikibase\Repo;
                
                use DataValues\Deserializers\DataValueDeserializer;
                Severity: Major
                Found in repo/includes/WikibaseRepo.php - About 2 days to fix

                  File RepoHooks.php has 718 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  namespace Wikibase\Repo;
                  
                  use LogEntry;
                  Severity: Major
                  Found in repo/includes/RepoHooks.php - About 1 day to fix

                    WbRestApi has 86 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class WbRestApi {
                    
                        public static function getGetItem( ContainerInterface $services = null ): GetItem {
                            return ( $services ?: MediaWikiServices::getInstance() )
                                ->get( 'WbRestApi.GetItem' );
                    Severity: Major
                    Found in repo/rest-api/src/WbRestApi.php - About 1 day to fix

                      exports has 82 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      /******/ ({
                      
                      /***/ "00e9":
                      /***/ (function(module, __webpack_exports__, __webpack_require__) {
                      
                      
                      Severity: Major
                      Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 day to fix

                        WikibaseClient has 79 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        final class WikibaseClient {
                        
                            private function __construct() {
                                // should not be instantiated
                            }
                        Severity: Major
                        Found in client/includes/WikibaseClient.php - About 1 day to fix

                          File ResultBuilder.php has 647 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          namespace Wikibase\Repo\Api;
                          
                          use MediaWiki\Api\ApiResult;
                          Severity: Major
                          Found in repo/includes/Api/ResultBuilder.php - About 1 day to fix

                            Function 7dd0 has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                            Open

                            /***/ (function(module, exports, __webpack_require__) {
                            
                            "use strict";
                            
                            var $ = __webpack_require__("23e7");
                            Severity: Minor
                            Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 day 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 snakview.js has 502 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            ( function ( wb, dv ) {
                                'use strict';
                            
                                // Back-up components already initialized in the namespace to re-apply them after initializing
                                // the snakview widget.
                            Severity: Major
                            Found in view/resources/jquery/wikibase/snakview/snakview.js - About 1 day to fix

                              File WikibaseRepo.entitytypes.php has 489 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              
                              /**
                               * Definition of entity types for use with Wikibase.
                               * The array returned by the code below is supposed to be merged with the content of
                              Severity: Minor
                              Found in repo/WikibaseRepo.entitytypes.php - About 7 hrs to fix

                                File jquery.wikibase.statementview.js has 488 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                ( function ( wb ) {
                                    'use strict';
                                
                                    var PARENT = $.ui.EditableTemplatedWidget,
                                        datamodel = require( 'wikibase.datamodel' ),
                                Severity: Minor
                                Found in view/resources/jquery/wikibase/jquery.wikibase.statementview.js - About 7 hrs to fix

                                  File WikibaseLibrary.php has 483 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  <?php
                                  
                                  declare( strict_types = 1 );
                                  
                                  namespace Wikibase\Client\DataAccess\Scribunto;
                                  Severity: Minor
                                  Found in client/includes/DataAccess/Scribunto/WikibaseLibrary.php - About 7 hrs to fix

                                    File Wikibase.i18n.alias.php has 464 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    <?php
                                    
                                    /**
                                     * Aliases for the special pages of the Wikibase Repository extension.
                                     *
                                    Severity: Minor
                                    Found in repo/Wikibase.i18n.alias.php - About 7 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language