Showing 1,432 of 2,096 total issues
Function showCopyrightTooltip
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showCopyrightTooltip( $entityview, $origin, gravity, viewName ) {
if ( !mw.config.exists( 'wbCopyright' ) ) {
return;
}
File WikibaseValueFormatterBuilders.php
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace Wikibase\Lib\Formatters;
File jquery.wikibase.sitelinklistview.js
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license GPL-2.0-or-later
* @author H. Snater < mediawiki@snater.com >
*/
( function ( wb ) {
Function f30a
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ApiProxy; });
/* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("b774");
Function _drawEditMode
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawEditMode: function () {
var self = this,
pageNameInputOptions = {},
dir = $( document.documentElement ).prop( 'dir' );
Function parseDateFormat
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private function parseDateFormat( $format ) {
$length = strlen( $format );
$number = $this->getNumberPattern();
$notFollowedByNumber = '(?!' . $number . ')';
- 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
MediaWikiEditEntity
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class MediaWikiEditEntity implements EditEntity {
private EntityRevisionLookup $entityRevisionLookup;
private EntityTitleStoreLookup $titleLookup;
private EntityStore $entityStore;
Method appModule
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function appModule() {
$clientSettings = WikibaseClient::getSettings();
return new FileModule(
[
'scripts' => [
Method attemptSave
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function attemptSave( EntityDocument $newEntity, string $summary, $flags, $token, $watch = null, array $tags = [] ) {
$this->checkReadOnly( $newEntity ); // throws, exception formatted by MediaWiki (cf. MWExceptionRenderer::getExceptionTitle)
$this->checkEntityId( $newEntity->getId() ); // throws internal error (unexpected condition)
$watch = $this->getDesiredWatchState( $watch );
Function 4d64
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
var toIndexedObject = __webpack_require__("fc6a");
var toLength = __webpack_require__("50c4");
var toAbsoluteIndex = __webpack_require__("23cb");
- 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 getStatus
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private function getStatus( WebRequest $req, RevisionRecord $latestRevision ): Status {
if ( $req->getCheck( 'restore' ) ) { // nearly the same as undoafter without undo
$olderRevision = $this->revisionLookup->getRevisionById( $req->getInt( 'restore' ) );
if ( !$olderRevision ) {
- 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 SearchEntities.php
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace Wikibase\Repo\Api;
Method getLocalizedYear
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getLocalizedYear( $isoTimestamp, $precision ) {
preg_match( '/^(\D*)(\d*)/', $isoTimestamp, $matches );
[ , $sign, $year ] = $matches;
$isBCE = $sign === '-';
File jquery.wikibase.entitytermsview.js
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license GPL-2.0-or-later
* @author H. Snater < mediawiki@snater.com >
*/
( function ( wb ) {
File PatchedPropertyValidator.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare( strict_types=1 );
namespace Wikibase\Repo\RestApi\Application\UseCases\PatchProperty;
use LogicException;
Function f30a
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ApiProxy; });
/* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("b774");
- 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 initFormats
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function initFormats() {
if ( $this->mimeTypes !== null && $this->fileExtensions !== null ) {
return;
}
- 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 constructor
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(plugin, hook) {
this.target = null;
this.targetQueue = [];
this.onQueue = [];
this.plugin = plugin;
File jquery.ui.tagadata.js
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* 'tag-a-data' jQuery widget
*
* 'tag-a-data' is based on the original jQuery extension 'tag-it' v2.0 (06/2011) by
* Levy Carneiro Jr.
File GetEntities.php
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace Wikibase\Repo\Api;