Showing 11,545 of 11,545 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
OO.ui.OptionWidget.prototype.isPressable = function () {
return this.constructor.static.pressable && !this.disabled && this.isVisible();
};
- 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 68.
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
OO.ui.PageLayout.prototype.setOutlineItem = function ( outlineItem ) {
this.outlineItem = outlineItem || null;
if ( outlineItem ) {
this.setupOutlineItem();
}
- 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 68.
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
OO.ui.TabPanelLayout.prototype.setTabItem = function ( tabItem ) {
this.tabItem = tabItem || null;
if ( tabItem ) {
this.setupTabItem();
}
- 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 68.
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
OO.ui.MultilineTextInputWidget.prototype.onElementAttach = function () {
OO.ui.MultilineTextInputWidget.super.prototype.onElementAttach.call( this );
this.adjustSize();
};
- 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 68.
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 getCalendarData
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.widgets.datetime.ProlepticGregorianDateTimeFormatter.prototype.getCalendarData = function ( date ) {
const getDate = this.local ? 'getDate' : 'getUTCDate',
setDate = this.local ? 'setDate' : 'setUTCDate';
const ret = {
Function getComponentsFromDate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.widgets.datetime.DiscordianDateTimeFormatter.prototype.getComponentsFromDate = function ( date ) {
let ret, day, month;
const monthDays = [ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 ];
Function uploadWithFormData
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
uploadWithFormData: function ( file, data ) {
const deferred = $.Deferred();
for ( const key in data ) {
if ( !fieldsAllowed[ key ] ) {
Function showCurrentImage
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.GallerySlideshow.prototype.showCurrentImage = function ( init ) {
let $thumbnail, $imgLink,
$imageLi = this.getCurrentImage(),
$caption = $imageLi.find( '.gallerytext' );
Function MwRcfiltersUiTagItemWidget
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TagItemWidget = function MwRcfiltersUiTagItemWidget(
controller, filtersViewModel, invertModel, itemModel, config
) {
// Configuration initialization
config = config || {};
Function start
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Notification.prototype.start = function () {
let options, $notification, $tagMatches, autohideCount;
$area.css( 'display', '' );
Function getAccessKeyModifiers
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getAccessKeyModifiers( nav ) {
if ( !nav && cachedModifiers ) {
return cachedModifiers;
}
Function initTempUserBannerTooltip
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initTempUserBannerTooltip( $bannerEl, $tooltipEl, $buttonEl ) {
if ( !$bannerEl.length || !$tooltipEl.length || !$buttonEl.length ) {
return;
}
Function _sfc_render$u
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
const _component_cdx_icon = resolveComponent("cdx-icon");
const _component_cdx_button = resolveComponent("cdx-button");
return openBlock(), createElementBlock(
"div",
Function makeApi
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeApi(sinon) {
function valueFormatter(value) {
return "" + value;
}
Function style
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
Function copyConfig
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function copyConfig(to, from) {
var i, prop, val;
if (!isUndefined(from._isAMomentObject)) {
to._isAMomentObject = from._isAMomentObject;
Function stop
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
stop: function( type, clearQueue, gotoEnd ) {
var stopQueue = function( hooks ) {
var stop = hooks.stop;
delete hooks.stop;
stop( gotoEnd );
Function access
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
len = elems.length,
bulk = key == null;
Function adjustCSS
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function adjustCSS( elem, prop, valueParts, tween ) {
var adjusted, scale,
maxIterations = 20,
currentValue = tween ?
function() {
Function dispatch
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatch: function( nativeEvent ) {
var i, j, ret, matched, handleObj, handlerQueue,
args = new Array( arguments.length ),