Showing 141 of 272 total issues
Method onGetPreferences
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
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' ) != [] ) {
Function load
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.controller.Deed.prototype.load = function ( uploads ) {
var self = this,
// select "provide same information for all files" by default
defaultDeedInterface = 'common',
localUploads = uploads.filter( ( upload ) => {
File uw.deed.ThirdParty.js
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* This file is part of the MediaWiki extension UploadWizard.
*
* UploadWizard is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Function UWUIThanks
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.ui.Thanks = function UWUIThanks( config ) {
var homeButtonTarget,
homeButtonHref,
homeButtonUrl,
thanksMessage,
Method addJsVars
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function addJsVars( $subPage ) {
$config = Config::getConfig( $this->campaign );
if ( array_key_exists( 'trackingCategory', $config ) ) {
if ( array_key_exists( 'campaign', $config['trackingCategory'] ) ) {
Function getPhoto
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getPhoto: function ( photoIdMatches ) {
var checker = this;
var photoId = photoIdMatches[ 1 ];
return this.flickrRequest( {
Function setFormFields
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.deed.ThirdParty.prototype.setFormFields = function ( $selector ) {
var $formFields = $( '<div>' ).addClass( 'mwe-upwiz-deed-form-internal' ), self = this;
this.$form = $( '<form>' );
File uw.LicenseGroup.js
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
( function ( uw ) {
/**
* @extends OO.ui.LicenseGroup
*
Method getParsedConfig
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getParsedConfig( Language $lang = null ) {
if ( $lang === null ) {
$lang = $this->context->getLanguage();
}
Function UWMetadataContent
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.MetadataContent = function UWMetadataContent( upload, config ) {
var $titleDiv,
$filenameDiv,
$thumbnailDiv,
self = this;
Function uploadChunk
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mw.FormDataTransport.prototype.uploadChunk = function ( file, offset ) {
var params = this.createParams( this.tempname, offset ),
transport = this,
bytesAvailable = file.size,
chunk;
Function prefillDate
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
prefillDate: function () {
var dateObj, metadata, dateTimeRegex, matches, dateStr, saneTime,
dateMode = 'calendar',
yyyyMmDdRegex = /^(\d\d\d\d)[:/-](\d\d)[:/-](\d\d)\D.*/,
timeRegex = /\D(\d\d):(\d\d):(\d\d)/;
Function submit
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
submit: function () {
var details = this,
wikitext, captions, promise, languageCodes, allLanguages, errorString;
this.$containerDiv.find( 'form' ).trigger( 'submit' );
Function UploadWizardDeedChooser
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mw.UploadWizardDeedChooser = function ( config, deeds, uploads ) {
var chooser = this,
$radioContainer,
$formContainer;
Function UWCopyMetadataWidget
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.CopyMetadataWidget = function UWCopyMetadataWidget( config ) {
var metadataType, defaultStatus, copyMetadataMsg,
checkboxes = [],
$copyMetadataWrapperDiv = $( '<div>' ),
$copyMetadataDiv = $( '<div>' );
Campaign
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Campaign {
/**
* The campaign configuration.
*
Method execute
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute() {
$params = $this->extractRequestParams();
$limit = $params['limit'];
Function getTransformedCanvasElement
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mw.UploadWizardUpload.prototype.getTransformedCanvasElement = function ( image, constraints ) {
var angle, scaling, width, height,
dimensions, dx, dy, x, y, $canvas, ctx,
scaleConstraints = constraints,
rotation = 0;
Method execute
has 54 lines of code (exceeds 25 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;
Method getConfigForJSON
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getConfigForJSON( $campaign, $oldConfig ) {
$config = [
'enabled' => $campaign->campaign_enabled === '1',
'display' => [
'headerLabelPage' => $oldConfig['headerLabelPage'],