Showing 272 of 272 total issues
Similar blocks of code found in 3 locations. Consider refactoring. Open
ui.$buttons.append(
$( '<div>' )
.addClass( 'mwe-upwiz-file-next-all-ok mwe-upwiz-file-endchoice' )
.append(
new OO.ui.HorizontalLayout( {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 97.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function load
has 75 lines of code (exceeds 25 allowed). Consider refactoring. 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 ) => {
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( width !== undefined || height !== undefined ) {
if ( props.indexOf( 'url' ) === -1 ) {
props.push( 'url' );
}
if ( width !== undefined ) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 95.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( width !== undefined || height !== undefined ) {
if ( props.indexOf( 'url' ) === -1 ) {
props.push( 'url' );
}
if ( width !== undefined ) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 95.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File uw.deed.ThirdParty.js
has 290 lines of code (exceeds 250 allowed). Consider refactoring. 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
uw.ui.Thanks = function UWUIThanks( config ) {
var homeButtonTarget,
homeButtonHref,
homeButtonUrl,
thanksMessage,
Method addJsVars
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addJsVars( $subPage ) {
$config = Config::getConfig( $this->campaign );
if ( array_key_exists( 'trackingCategory', $config ) ) {
if ( array_key_exists( 'campaign', $config['trackingCategory'] ) ) {
Similar blocks of code found in 3 locations. Consider refactoring. Open
this.complianceField = new uw.FieldLayout( this.complianceCheck, {
label: $( '<div>' ).append(
$( '<li>' )
.addClass( 'mwe-upwiz-label-title' )
.append( mw.message( 'mwe-upwiz-source-thirdparty-compliance-label', this.uploadCount, mw.user ).parseDom() )
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
this.originRadioField = new uw.FieldLayout( this.originRadio, {
label: $( '<div>' ).append(
$( '<li>' )
.addClass( 'mwe-upwiz-label-title' )
.append(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
this.licenseInputField = new uw.FieldLayout( this.licenseInput, {
label: $( '<div>' ).append(
$( '<li>' )
.addClass( 'mwe-upwiz-label-title' )
.append( mw.message( 'mwe-upwiz-source-ownwork-question', this.uploadCount, mw.user ).parseDom() )
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 92.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function getPhoto
has 71 lines of code (exceeds 25 allowed). Consider refactoring. 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
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
( function ( uw ) {
/**
* @extends OO.ui.LicenseGroup
*
Method getParsedConfig
has 68 lines of code (exceeds 25 allowed). Consider refactoring. 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
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
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
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)/;
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.retryButtonAllFailed = new OO.ui.ButtonWidget( {
label: mw.message( 'mwe-upwiz-file-retry' ).text(),
flags: [ 'progressive' ]
} ).on( 'click', () => {
upload.hideEndButtons();
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 86.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.retryButtonSomeFailed = new OO.ui.ButtonWidget( {
label: mw.message( 'mwe-upwiz-file-retry' ).text(),
flags: [ 'progressive' ]
} ).on( 'click', () => {
upload.hideEndButtons();
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 86.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function submit
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
submit: function () {
var details = this,
wikitext, captions, promise, languageCodes, allLanguages, errorString;
this.$containerDiv.find( 'form' ).trigger( 'submit' );