wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Avoid too many return statements within this method.
Open

        return null;
Severity: Major
Found in repo/rest-api/src/Application/Validation/StatementValidator.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return $value;
    Severity: Major
    Found in lib/includes/Units/UnitConverter.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return null;
      Severity: Major
      Found in lib/includes/Units/UnitConverter.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return $value->transform( $targetUnit, [ $this->math, 'product' ], $mult );
        Severity: Major
        Found in lib/includes/Units/UnitConverter.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return false;
          Severity: Major
          Found in lib/includes/Formatters/ShowCalendarModelDecider.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return $resolutionResult;
            Severity: Major
            Found in lib/includes/Store/RedirectResolvingLatestRevisionLookup.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return true;
              Severity: Major
              Found in lib/includes/Formatters/ShowCalendarModelDecider.php - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return true;
                Severity: Major
                Found in client/data-bridge/src/data-access/ApiRepoConfigRepository.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return Promise.resolve();
                  Severity: Major
                  Found in client/data-bridge/src/store/actions.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return this.dispatch( 'addError', [ error ] );
                    Severity: Major
                    Found in client/data-bridge/src/store/actions.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return false;
                      Severity: Major
                      Found in client/data-bridge/src/data-access/ApiRepoConfigRepository.ts - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return [ 'signatureToCheck' => $signatureToCheck, 'data' => $data ];
                        Severity: Major
                        Found in lib/includes/SimpleCacheWithBagOStuff.php - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return this.dispatch( 'addError', [ { type: ErrorTypes.UNSUPPORTED_DATAVALUE_TYPE } ] );
                          Severity: Major
                          Found in client/data-bridge/src/store/actions.ts - About 30 mins to fix

                            Function d44e has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            /***/ (function(module, exports, __webpack_require__) {
                            
                            var defineProperty = __webpack_require__("9bf2").f;
                            var has = __webpack_require__("5135");
                            var wellKnownSymbol = __webpack_require__("b622");
                            Severity: Minor
                            Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 25 mins 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

                            Function execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function execute() {
                                    $continue = $this->getParameter( 'continue' );
                                    $preferSource = $this->getParameter( 'prefersource' );
                            
                                    $pages = $this->getPageSet()->getGoodPages();
                            Severity: Minor
                            Found in client/includes/Api/Description.php - About 25 mins 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

                            Function doQuery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function doQuery( array $params, ApiPageSet $resultPageSet = null ): ?IResultWrapper {
                                    if ( !$params['entities'] ) {
                                        return null;
                                    }
                            
                            
                            Severity: Minor
                            Found in client/includes/Api/ApiListEntityUsage.php - About 25 mins 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

                            Function getEditCommentMulti has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function getEditCommentMulti( EntityChange $change, Title $target = null ) {
                                    $info = $change->getInfo();
                            
                                    if ( isset( $info['changes'] ) ) {
                                        if ( $info['changes'] === [] ) {
                            Severity: Minor
                            Found in client/includes/RecentChanges/RecentChangeFactory.php - About 25 mins 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

                            Function execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function execute() {
                                    $referenceJson = $this->getParameter( 'reference' );
                                    $referenceJsonStatus = FormatJson::parse( $referenceJson, FormatJson::FORCE_ASSOC );
                            
                                    if ( !$referenceJsonStatus->isGood() ) {
                            Severity: Minor
                            Found in client/includes/Api/ApiFormatReference.php - About 25 mins 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

                            Function prepareChangeAttributes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function prepareChangeAttributes( EntityChange $change ) {
                                    $rcinfo = $change->getMetadata();
                            
                                    $fields = $change->getFields();
                                    $fields['entity_type'] = $change->getEntityId()->getEntityType();
                            Severity: Minor
                            Found in client/includes/RecentChanges/RecentChangeFactory.php - About 25 mins 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

                            Function addFilter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function addFilter( ChangesListSpecialPage $specialPage ): void {
                                    $filterName = $this->getFilterName();
                                    $changeTypeGroup = $specialPage->getFilterGroup( 'changeType' );
                            
                                    $out = $specialPage->getOutput();
                            Severity: Minor
                            Found in client/includes/Hooks/ChangesListSpecialPageHookHandler.php - About 25 mins 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

                            Severity
                            Category
                            Status
                            Source
                            Language