Showing 141 of 272 total issues
Function UWUIDetails
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.ui.Details = function UWUIDetails() {
var details = this;
function startDetails() {
details.emit( 'start-details' );
Function initialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.PatentDialog.prototype.initialize = function () {
var filenames = [],
label = new OO.ui.LabelWidget(),
panels = new OO.ui.PanelLayout( { padded: true, expanded: false } );
Function load
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.ui.Details.prototype.load = function ( uploads ) {
uw.ui.Step.prototype.load.call( this, uploads );
if ( mw.UploadWizard.config.wikibase.enabled && mw.UploadWizard.config.wikibase.captions ) {
this.$div.prepend(
Function getStashImageInfo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mw.UploadWizardUpload.prototype.getStashImageInfo = function ( callback, props, width, height ) {
var params = {
prop: 'stashimageinfo',
siifilekey: this.fileKey,
siiprop: props.join( '|' )
Function getApi
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getApi: function ( options ) {
var api = new mw.Api( options );
api.ajax = function ( parameters, ajaxOptions ) {
var original, override;
Function setValues
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setValues: function ( values, groupName ) {
var selectedGroups = [];
var input = this;
this.getItems().forEach( ( group ) => {
Function execute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
public function execute( $subPage ) {
// side effects: if we can't upload, will print error page to wgOut
// and return false
if ( !( $this->isUploadAllowed() && $this->isUserUploadAllowed( $this->getUser() ) ) ) {
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 UploadWizardLicenseInput
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
mw.UploadWizardLicenseInput = function ( config, count, api ) {
mw.UploadWizardLicenseInput.super.call( this );
OO.ui.mixin.GroupElement.call( this );
this.count = count;
- 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 UWUITutorial
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.ui.Tutorial = function UWUITutorial() {
var ui = this;
uw.ui.Step.call(
this,
Function UWDeedInterface
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.deed.Abstract = function UWDeedInterface( name, config, uploads ) {
var tcName, details, field, input;
this.name = name;
this.config = config;
uw.deed.Abstract.prototype.instanceCount++;
Function getWikiText
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.CategoriesDetailsWidget.prototype.getWikiText = function () {
var hiddenCats, missingCatsWikiText, categories, wikiText;
hiddenCats = [];
if ( mw.UploadWizard.config.autoAdd.categories ) {
Function buildCollectionLinks
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildCollectionLinks: function ( appendId, data ) {
var $elem = $( '<ul>' );
if ( appendId ) {
$elem.attr( 'id', 'mwe-upwiz-files-collection-chooser' );
}
Method execute
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute() {
$services = $this->getServiceContainer();
$username = $this->getOption( 'user', 'Maintenance script' );
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function ( grunt ) {
const conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
Function setImageURL
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setImageURL: function ( index ) {
var upload = this.imageUploads[ index ];
var photoId = upload.photoId;
var checker = this;
Function applyCopiedStatements
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.MetadataContent.prototype.applyCopiedStatements = function ( statementWidgets ) {
var self = this;
// 1. remove all existing statementWidgets
Object.keys( this.statementWidgets ).forEach( ( propId ) => {
Function processError
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
processError: function ( code, result ) {
var recoverable = [
'abusefilter-disallowed',
'abusefilter-warning',
'spamblacklist',
Function updateAuthorFieldForAI
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.deed.ThirdParty.prototype.updateAuthorFieldForAI = function () {
if ( this.templateOptions.aiGenerated.input.isSelected() ) {
this.authorInputField.setLabel(
$( '<li>' )
.addClass( 'mwe-upwiz-label-title' )
Function setTransportWarning
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mw.ApiUploadHandler.prototype.setTransportWarning = function ( code, result ) {
var param, duplicates, links;
switch ( code ) {
case 'duplicate':
Function setDuplicateError
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mw.ApiUploadHandler.prototype.setDuplicateError = function ( code, result, localDuplicates, foreignDuplicates, unknownAmount ) {
var allDuplicates = $.extend( {}, localDuplicates, foreignDuplicates ),
$extra = $( '<div>' ),
$ul = $( '<ul>' ).appendTo( $extra ),
$a,