Showing 1,432 of 2,096 total issues
File SpecialSetLabelDescriptionAliases.php
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Wikibase\Repo\Specials;
use InvalidArgumentException;
Method parseDateFormat
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseDateFormat( $format ) {
$length = strlen( $format );
$number = $this->getNumberPattern();
$notFollowedByNumber = '(?!' . $number . ')';
Function ddb0
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var DOMIterables = __webpack_require__("fdbc");
var ArrayIteratorMethods = __webpack_require__("e260");
- 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
RepoHooks
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
final class RepoHooks {
/**
* Handler for the BeforePageDisplay hook, that conditionally adds the wikibase
* mobile styles and injects the wikibase.ui.entitysearch module replacing the
File EditEntityAction.php
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace Wikibase\Repo\Actions;
File EntityDataRequestHandler.php
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Wikibase\Repo\LinkedData;
use HttpError;
Function mergeParams
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private mergeParams<action1 extends ApiAction, action2 extends ApiAction>(
params1: ApiParams<action1>,
params2: ApiParams<action2>,
): ApiParams<action1&action2>|false {
const paramNames = new Set( [
- 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
File wikibase.ui.entityViewInit.js
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license GPL-2.0-or-later
* @author H. Snater < mediawiki@snater.com >
* @author Daniel Werner < daniel.a.r.werner@gmail.com >
* @author Adrian Heine <adrian.heine@wikimedia.de>
File actions.ts
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { DataValue } from '@wmde/wikibase-datamodel-types';
import ApiErrors from '@/data-access/error/ApiErrors';
import SavingError from '@/data-access/error/SavingError';
import { Store } from 'vuex';
import Application, { InitializedApplicationState, SavingState } from '@/store/Application';
File Resources.php
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
use MediaWiki\MediaWikiServices;
Function 6eeb
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var createNonEnumerableProperty = __webpack_require__("9112");
var has = __webpack_require__("5135");
- 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 draw
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw: function () {
var self = this,
newValue = this._newDataValue;
function _render() {
File SpecialSetSiteLink.php
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Wikibase\Repo\Specials;
use InvalidArgumentException;
File SpecialNewItem.php
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace Wikibase\Repo\Specials;
Method writePropertyPredicates
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function writePropertyPredicates( $localName, $repositoryName, $propertyRdfType, $normalizedPropertyRdfType ) {
$this->writer->say( RdfVocabulary::NS_ONTOLOGY, 'directClaim' )->is(
$this->vocabulary->propertyNamespaceNames[$repositoryName][RdfVocabulary::NSP_DIRECT_CLAIM],
$localName
);
Method writePropertyPredicates
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function writePropertyPredicates( $localName, $repositoryName, $propertyRdfType, $normalizedPropertyRdfType ) {
$this->writer->say( RdfVocabulary::NS_ONTOLOGY, 'directClaim' )->is(
$this->vocabulary->propertyNamespaceNames[$repositoryName][RdfVocabulary::NSP_DIRECT_CLAIM],
$localName
);
Method __construct
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(
array $conceptUris,
array $dataUris,
EntitySourceDefinitions $entitySourceDefinitions,
array $rdfTurtleNodePrefixes,
Function filterEntitySerializationUsingLangCodes
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private function filterEntitySerializationUsingLangCodes( array $serialization ) {
if ( $this->filterLangCodes ) {
if ( array_key_exists( 'labels', $serialization ) ) {
foreach ( $serialization['labels'] as $langCode => $languageArray ) {
if ( !in_array( $langCode, $this->filterLangCodes ) ) {
- 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 filterEntitySerializationUsingLangCodes
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private function filterEntitySerializationUsingLangCodes(
array $serialization,
array $langCodes
) {
if ( $langCodes ) {
- 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
File jquery.wikibase.sitelinkview.js
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license GPL-2.0-or-later
* @author H. Snater < mediawiki@snater.com >
*/
( function ( wb ) {