wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Function ControllerViewFactory has 173 lines of code (exceeds 25 allowed). Consider refactoring.
Open

wikibase.view.ControllerViewFactory = ( function ( wb ) {
    'use strict';

    var ViewFactory = require( './ViewFactory.js' ),
        ToolbarViewController = require( './ToolbarViewController.js' );
Severity: Major
Found in view/resources/wikibase/view/ControllerViewFactory.js - About 6 hrs to fix

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

    ( function () {
        'use strict';
    
        // TODO: Get rid of MediaWiki context detection by submitting a message provider as option.
    
    
    Severity: Minor
    Found in view/resources/jquery/wikibase/jquery.wikibase.entityselector.js - About 6 hrs to fix

      EntityHandler has 47 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class EntityHandler extends ContentHandler {
      
          /**
           * Added to parser options for EntityContent.
           *
      Severity: Minor
      Found in repo/includes/Content/EntityHandler.php - About 6 hrs to fix

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

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

          File MediaWikiEditEntity.php has 435 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          declare( strict_types = 1 );
          
          namespace Wikibase\Repo\EditEntity;
          Severity: Minor
          Found in repo/includes/EditEntity/MediaWikiEditEntity.php - About 6 hrs to fix

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

            <?php declare( strict_types=1 );
            
            namespace Wikibase\Repo\RestApi;
            
            use MediaWiki\MediaWikiServices;
            Severity: Minor
            Found in repo/rest-api/src/WbRestApi.php - About 6 hrs to fix

              File EntityHandler.php has 428 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              namespace Wikibase\Repo\Content;
              
              use Article;
              Severity: Minor
              Found in repo/includes/Content/EntityHandler.php - About 6 hrs to fix

                Function exports has 155 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = ( function ( wb ) {
                    'use strict';
                
                    var ViewController = require( './ViewController.js' ),
                        ENTITY_CHANGERS = wb.entityChangers;
                Severity: Major
                Found in view/resources/wikibase/view/ToolbarViewController.js - About 6 hrs to fix

                  File ViewFactory.js has 425 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  ( function ( wb ) {
                      'use strict';
                  
                      var MODULE = wb.view,
                          EventSingletonManager = require( '../../jquery/jquery.util.EventSingletonManager.js' ),
                  Severity: Minor
                  Found in view/resources/wikibase/view/ViewFactory.js - About 6 hrs to fix

                    WikibaseLibrary has 45 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class WikibaseLibrary extends LibraryBase implements ParserOutputProvider {
                    
                        /**
                         * @var WikibaseLanguageIndependentLuaBindings|null
                         */
                    Severity: Minor
                    Found in client/includes/DataAccess/Scribunto/WikibaseLibrary.php - About 6 hrs to fix

                      Function 23e7 has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                      Open

                      /***/ (function(module, exports, __webpack_require__) {
                      
                      var global = __webpack_require__("da84");
                      var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
                      var createNonEnumerableProperty = __webpack_require__("9112");
                      Severity: Minor
                      Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 5 hrs 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

                      ResultBuilder has 42 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class ResultBuilder {
                      
                          /**
                           * @var ApiResult
                           */
                      Severity: Minor
                      Found in repo/includes/Api/ResultBuilder.php - About 5 hrs to fix

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

                        /**
                         * @license GPL-2.0-or-later
                         * @author H. Snater < mediawiki@snater.com >
                         * @author Bene* < benestar.wikimedia@gmail.com >
                         */

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

                          <?php
                          
                          namespace Wikibase\Client;
                          
                          use DataValues\Deserializers\DataValueDeserializer;
                          Severity: Minor
                          Found in client/includes/WikibaseClient.php - About 5 hrs to fix

                            Function exports has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                            Open

                            module.exports = ( function ( wb ) {
                                'use strict';
                            
                                var ViewController = require( './ViewController.js' ),
                                    ENTITY_CHANGERS = wb.entityChangers;
                            Severity: Minor
                            Found in view/resources/wikibase/view/ToolbarViewController.js - About 5 hrs 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 PatchedItemValidator.php has 399 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php declare( strict_types=1 );
                            
                            namespace Wikibase\Repo\RestApi\Application\UseCases\PatchItem;
                            
                            use LogicException;

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

                              /**
                               * @license GPL-2.0-or-later
                               * @author Marius Hoch < hoo@online.de >
                               */
                              ( function ( wb ) {
                              Severity: Minor
                              Found in client/resources/jquery.wikibase/jquery.wikibase.linkitem.js - About 5 hrs to fix

                                File EditEntity.php has 395 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                
                                declare( strict_types = 1 );
                                
                                namespace Wikibase\Repo\Api;
                                Severity: Minor
                                Found in repo/includes/Api/EditEntity.php - About 5 hrs to fix

                                  Function addDevtools has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function addDevtools (app, store) {
                                    Object(esm["setupDevtoolsPlugin"])(
                                      {
                                        id: 'org.vuejs.vuex',
                                        app: app,
                                  Severity: Major
                                  Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 5 hrs to fix

                                    File jquery.ui.suggester.js has 372 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    ( function () {
                                        'use strict';
                                    
                                        require( './jquery.ui.ooMenu.js' );
                                    
                                    
                                    Severity: Minor
                                    Found in client/resources/jquery.ui/jquery.ui.suggester.js - About 4 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language