Showing 141 of 272 total issues
File mw.UploadWizardDetails.js
has 912 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
( function ( uw ) {
var NS_FILE = mw.config.get( 'wgNamespaceIds' ).file;
/**
Function UWDeedOwnWork
has 285 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.deed.OwnWork = function UWDeedOwnWork( config, uploads, api ) {
var self = this,
prefAuthName = mw.user.options.get( 'upwiz_licensename' ),
revealOptionContent = function ( $parent, $child ) {
// hide sub-content for all options
Function buildInterface
has 238 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildInterface: function () {
var descriptionRequired, uri,
details = this,
config = mw.UploadWizard.config,
captionsAvailable = config.wikibase.enabled && config.wikibase.captions;
File mw.UploadWizardUpload.js
has 541 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Represents the upload -- in its local and remote state. (Possibly those could be separate objects too...)
* This is our 'model' object if we are thinking MVC. Needs to be better factored, lots of feature envy with the UploadWizard
* states:
* 'new' 'transporting' 'transported' 'metadata' 'stashed' 'details' 'submitting-details' 'complete' 'error'
File mw.FlickrChecker.js
has 498 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable camelcase, no-underscore-dangle */
/**
* @param ui
* @param selectButton
File UploadWizard.config.php
has 482 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* Upload Wizard Configuration
* Do not modify this file, instead use localsettings.php and set:
* $wgUploadWizardConfig[ 'name'] = 'value';
File uw.deed.OwnWork.js
has 449 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
File CampaignSchema.php
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
use MediaWiki\Extension\UploadWizard\Config;
return [
Function UWUIUpload
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.ui.Upload = function UWUIUpload( config ) {
var upload = this;
this.config = config;
Function UWDeedThirdParty
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
uw.deed.ThirdParty = function UWDeedThirdParty( config, uploads, api ) {
var deed = this;
uw.deed.Abstract.call( this, 'thirdparty', config, uploads );
Function getPhotos
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getPhotos: function ( mode, options ) {
this.selectButton.setLabel( mw.message( 'mwe-upwiz-select-flickr' ).text() );
this.selectButton.setDisabled( true );
var req = $.extend( {}, options, {
File uw.ui.Upload.js
has 368 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 lazyload
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.lazyload = function(options) {
var elements = this;
var $container;
var settings = {
threshold : 0,
Method generateReadHtml
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function generateReadHtml() {
$config = $this->campaign->getParsedConfig();
$campaignTitle = $config['title'] ?? $this->campaign->getName();
$campaignDescription = $config['description'] ?? '';
Function getParsedConfig
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getParsedConfig( Language $lang = null ) {
if ( $lang === null ) {
$lang = $this->context->getLanguage();
}
- 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 validateWikiTextSubmitResult
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
validateWikiTextSubmitResult: function ( params, result ) {
var wx, warningsKeys, existingFile, existingFileUrl, existingFileExt, ourFileExt, code, message,
details = this,
warnings = null,
ignoreTheseWarnings = false,
Function checkUnique
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
checkUnique: function ( title ) {
var checker = this,
NS_FILE = mw.config.get( 'wgNamespaceIds' ).file,
titleObj, prefix, ext;
Function addJsVars
has a Cognitive Complexity of 25 (exceeds 5 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'] ) ) {
- 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 Campaign.php
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace MediaWiki\Extension\UploadWizard;
use InvalidArgumentException;
Function UploadWizardLicenseInput
has 83 lines of code (exceeds 25 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;