Showing 141 of 272 total issues
Function MWUploadWizardUploadInterface
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.UploadWizardUploadInterface = function MWUploadWizardUploadInterface( upload ) {
var ui = this;
OO.EventEmitter.call( this );
Function getWikiText
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
getWikiText: function () {
var deed, info, key,
information,
wikiText = '';
Function checkUniqueProcessor
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkUniqueProcessor( data ) {
var result, protection, pageId, ntitle, ntitleObj, img;
result = { isUnique: true };
Function makePreview
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.UploadWizardUpload.prototype.makePreview = function ( width ) {
var first, video, url, dataUrlReader,
deferred = $.Deferred(),
upload = this;
Function start
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function () {
var bar = this,
shown = false;
this.setBeginTime();
Function createLabel
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
uw.LicenseGroup.prototype.createLabel = function ( name ) {
var licenseInfo = this.getLicenseInfo( name ),
messageKey = licenseInfo.props.msg === undefined ?
'[missing msg for ' + licenseInfo.name + ']' :
licenseInfo.props.msg,
Function processDestinationCheck
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
uw.TitleDetailsWidget.prototype.processDestinationCheck = function ( result ) {
var messageParams, errors, titleString;
if ( result.unique.isUnique && result.blacklist.notBlacklisted && !result.unique.isProtected ) {
return [];
Function onGetPreferences
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function onGetPreferences( $user, &$preferences ) {
$config = Config::getConfig();
// User preference to skip the licensing tutorial, provided it's not globally disabled
if ( Config::getSetting( 'tutorial' ) != [] ) {
- 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 getHtml
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function getHtml( $campaign = null ) {
global $wgLang;
$error = null;
$errorHtml = '';
- 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 addNextButton
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
uw.ui.Upload.prototype.addNextButton = function () {
var ui = this;
this.nextButtonPromise.done( () => {
ui.$buttons.append(
Function getImageInfo
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.UploadWizardUpload.prototype.getImageInfo = function ( callback, props, width, height ) {
var requestedTitle, params;
function ok( data ) {
var found;
Function UWLocationDetailsWidget
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
uw.LocationDetailsWidget = function UWLocationDetailsWidget( config ) {
this.config = config || {};
uw.LocationDetailsWidget.super.call( this );
Function parseArrayValues
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function parseArrayValues( $array, Language $lang, $forKeys = null ) {
$parsed = [];
foreach ( $array as $key => $value ) {
if ( $forKeys !== null ) {
if ( in_array( $key, $forKeys ) ) {
- 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 modifyIfNecessary
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function modifyIfNecessary() {
foreach ( $this->parsedConfig as $cnf => $modifiers ) {
if ( $cnf === 'whileActive' && $this->isActive() ) {
$activeModifiers = $modifiers;
} elseif ( $cnf === 'afterActive' && $this->wasActive() ) {
- 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 getApiThumbnail
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.UploadWizardUpload.prototype.getApiThumbnail = function ( width, height ) {
var deferred = $.Deferred();
function thumbnailPublisher( thumbnails ) {
if ( thumbnails === null ) {
Function UWSingleLanguageInputWidget
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
uw.SingleLanguageInputWidget = function UWSingleLanguageInputWidget( config ) {
this.config = $.extend( {
inputWidgetConstructor: OO.ui.MultilineTextInputWidget.bind( null, {
classes: [ 'mwe-upwiz-singleLanguageInputWidget-text' ],
autosize: true
Function getErrors
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
getErrors: function () {
var errors = $.Deferred().resolve( [] ).promise();
var addError = function ( message ) {
errors = errors.then( ( errors ) => {
errors.push( mw.message( message ) );
Function setSerialized
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
setSerialized: function ( serialized ) {
var i;
if ( !this.interfaceBuilt ) {
// There's no interface yet! Don't load the data, just keep it
Function extractMetadataFromJpegMeta
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.UploadWizardUpload.prototype.extractMetadataFromJpegMeta = function () {
var binReader, jpegmeta,
deferred = $.Deferred(),
upload = this;
if ( this.file && this.file.type === 'image/jpeg' ) {
Function displayer
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayer() {
var totalWeight = 0.0,
fraction = 0.0,
successStateCount = 0,
errorStateCount = 0,