Showing 1,432 of 2,096 total issues
Function _setOption
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setOption: function ( key, value ) {
if ( key === 'value' ) {
if ( value !== null
&& !$.isPlainObject( value )
&& !( value instanceof datamodel.Snak )
Function _onMulPulsatingDotClicked
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_onMulPulsatingDotClicked: function ( _event ) {
if ( !this._popup ) {
var $target = $( this.element ).find( '.mw-pulsating-dot-popup-container' );
var dontShowMulPopupCheckbox = new OO.ui.CheckboxInputWidget( {
Function _create
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_create: function () {
var self = this;
this._cache = {};
Method register
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function register() {
// These functions will be exposed to the Lua module.
// They are member functions on a Lua table which is private to the module, thus
// these can't be called from user code, unless explicitly exposed in Lua.
$lib = [
Function 23e7
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
var createNonEnumerableProperty = __webpack_require__("9112");
Method buildTermSearchMatchPageEntry
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function buildTermSearchMatchPageEntry( TermSearchResult $match, ?array $props ): array {
$entityId = $match->getEntityId();
if ( $entityId !== null ) {
$entry = [
'id' => $entityId->getSerialization(),
Method validateEntitySpecificParameters
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function validateEntitySpecificParameters(
array $preparedParameters,
EntityDocument $entity,
int $baseRevId
): void {
Method resolveMentionedEntities
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function resolveMentionedEntities(): void {
$hasRedirect = false;
$this->markStubEntityDataForPrefetching( $this->entitiesResolved );
Method createEntityChangeOp
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function createEntityChangeOp( array $changeRequest ) {
$this->assertArray( $changeRequest['sitelinks'], 'List of sitelinks must be an array' );
$siteLinksChangeOps = new ChangeOps();
$sites = $this->siteLinkTargetProvider->getSiteList( $this->siteLinkGroups );
Method convertToFormattableSummary
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function convertToFormattableSummary( EditSummary $editSummary ): FormatableSummary {
switch ( true ) {
case $editSummary instanceof PatchPropertyEditSummary:
return $this->wholeEntityEditSummaryConverter->newSummaryForPropertyPatch( $editSummary );
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute() {
if ( !ExtensionRegistry::getInstance()->isLoaded( 'WikibaseRepository' ) ) {
$this->fatalError(
"You need to have Wikibase enabled in order to use this "
. "maintenance script!\n\n",
Method validate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function validate(
?string $itemId,
string $siteId,
array $sitelink,
string $basePath = ''
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute() {
if ( WikibaseRepo::getSettings()
->getSetting( 'enablePopulateWithRandomEntitiesAndTermsScript' ) !== true
) {
$this->output(
Method throwUseCaseError
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function throwUseCaseError( ValidationError $validationError ): void {
$context = $validationError->getContext();
switch ( $validationError->getCode() ) {
case LanguageCodeValidator::CODE_INVALID_LANGUAGE_CODE:
throw UseCaseError::newPatchResultInvalidKey( '', $context[LanguageCodeValidator::CONTEXT_LANGUAGE_CODE] );
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute( PatchPropertyDescriptionsRequest $request ): PatchPropertyDescriptionsResponse {
$deserializedRequest = $this->useCaseValidator->validateAndDeserialize( $request );
$propertyId = $deserializedRequest->getPropertyId();
$this->assertPropertyExists->execute( $propertyId );
Method format
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function format( $value ) {
if ( !( $value instanceof TimeValue ) ) {
throw new InvalidArgumentException( 'Data value type mismatch. Expected a TimeValue.' );
}
Method toStandardUnits
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function toStandardUnits( UnboundedQuantityValue $value ) {
$fromUnit = $value->getUnit();
if ( $fromUnit === '1' ) {
// Won't convert unitless values
Method saveLinksOfItem
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function saveLinksOfItem( Item $item ): bool {
//First check whether there's anything to update
$newLinks = $item->getSiteLinkList()->toArray();
$oldLinks = $this->getSiteLinksForItem( $item->getId() );
Function 3f4e
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setupDevtoolsPlugin", function() { return setupDevtoolsPlugin; });
/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("abc5");
- Read upRead up
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 termFallbackResolver
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
wikibase.view.termFallbackResolver = ( function ( wb ) {
'use strict';
var SELF = {};
- Read upRead up
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"