Showing 269 of 269 total issues
Method onBeforePageDisplay
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function onBeforePageDisplay( $out, $skin ): void {
$unsupportedSkins = [ 'minerva', 'apioutput' ];
if ( in_array( $skin->getSkinName(), $unsupportedSkins, true ) ) {
return;
}
Identical blocks of code found in 2 locations. Consider refactoring. Open
close: function () {
if ( !this.shown ) {
return;
}
- 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 64.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
close: function () {
if ( !this.shown ) {
return;
}
- 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 64.
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 apply
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
apply: function () {
if ( !this.dirty ) {
// No changes to save in this module.
return;
}
Function clickHandler
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
var clickHandler = function ( e ) {
var languagesettings = $trigger.data( 'languagesettings' ),
languageSettingsOptions;
if ( languagesettings ) {
Function keypress
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
keypress: function ( e ) {
var suggestion, query;
switch ( e.keyCode ) {
case 9: // Tab -> Autocomplete
Function prepareFontSelector
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepareFontSelector: function ( target ) {
var language, fonts, $fontSelector, savedFont,
$systemFont, $fontLabel, $fontsSection;
// Get the language code from the right property -
Function setup
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.webfonts.setup = function () {
// Initialize webfonts
var mediawikiFontRepository = $.webfonts.repository;
mediawikiFontRepository.base = mw.config.get( 'wgULSFontRepositoryBasePath' );
Function initModule
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
initModule: function ( moduleName, active ) {
var $settingsTitle, $settingsText, $settingsLink,
languageSettings = this,
module = new $.fn.languagesettings.modules[ moduleName ]( languageSettings ),
$settingsMenuItems = languageSettings.$window.find( '.settings-menu-items' );
Function prepareLanguageList
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
prepareLanguageList: function () {
var languageCodeIndex,
$languageListWrapper,
$languageList,
languageList,
Function keypress
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
keypress: function ( e ) {
var altGr = false,
c, input, replacement;
if ( !this.active ) {
Function replaceTextAtSelection
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
ContentEditableEntry.prototype.replaceTextAtSelection = function (
precedingCharCount,
newText
) {
var textNode, textOffset, newOffset, newRange,
Function addRange
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
selProto.addRange = function(range, direction) {
if (implementsControlRange && implementsDocSelection && this.docSelection.type == CONTROL) {
addRangeToControlSelection(this, range);
} else {
if (isDirectionBackward(direction) && selectionHasExtend) {
Similar blocks of code found in 3 locations. Consider refactoring. Open
patterns_x: [
[ 'F', '\u090C' ],
[ 'N', '\u0933' ],
[ '\\>', '\u093D' ],
[ '\\=', '\u0944' ],
- 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 62.
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
patterns: [
[ '~b', 'ɓ' ],
[ '~B', 'Ɓ' ],
[ '~d', 'ɗ' ],
[ '~D', 'Ɗ' ],
- 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 62.
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
patterns_x: [
[ '1', '\u200d' ],
[ '2', '\u200c' ],
[ '4', '₹' ],
[ '\\+', 'ೠ' ],
- 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 62.
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 keydown
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
keydown: function ( e ) {
var ime = $( e.target ).data( 'ime' ),
firstInputmethod,
previousInputMethods,
languageCode;
Function addActionsMenuTriggers
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addActionsMenuTriggers( uls ) {
var $ulsSettingsBlock = addLanguageSettingsTrigger( uls );
var actionItemsRegistry = mw.uls.ActionsMenuItemsRegistry;
actionItemsRegistry.on( 'register', onActionItemAdded );
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var $section,
$quicklist = this.buildQuicklist(),
regions = [],
regionNames = {
Function transliterate
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
transliterate: function ( input, context, altGr ) {
var patterns, regex, contextRegex, rule, replacement, i, retval;
if ( altGr ) {
patterns = this.inputmethod.patterns_x || [];