Showing 11,545 of 11,545 total issues
Function searchCategories
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.widgets.CategoryMultiselectWidget.prototype.searchCategories = function ( input, searchType ) {
const deferred = $.Deferred(),
cacheKey = input + searchType.toString();
// Check cache
Method truncateHtml
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function truncateHtml( $text, $length, $ellipsis = '...' ) {
# Use the localized ellipsis character
if ( $ellipsis == '...' ) {
$ellipsis = $this->msg( 'ellipsis' )->escaped();
}
Method getAllowedParams
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllowedParams() {
return [
'allrev' => false,
'start' => [
ParamValidator::PARAM_TYPE => 'timestamp'
Method selectUploadModule
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function selectUploadModule() {
// chunk or one and only one of the following parameters is needed
if ( !$this->mParams['chunk'] ) {
$this->requireOnlyOneParameter( $this->mParams,
'filekey', 'file', 'url' );
File ApiQueryAllImages.php
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* API for MediaWiki 1.12+
*
Method processFormInternal
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function processFormInternal(
array $data,
Authority $performer,
BlockUserFactory $blockUserFactory,
BlockUtils $blockUtils
Method doTagRow
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doTagRow(
$tag, $hitcount, $showManageActions, $showDeleteActions, $showEditLinks
) {
$newRow = '';
$newRow .= Xml::tags( 'td', null, Xml::element( 'code', null, $tag ) );
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (format === 'dddd') {
ii = indexOf.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
- 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 111.
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
} else if (format === 'ddd') {
ii = indexOf.call(this._shortWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
- 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 111.
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
public function __construct(
LinkBatchFactory $linkBatchFactory,
IContentHandlerFactory $contentHandlerFactory,
GroupPermissionsLookup $groupPermissionsLookup,
RevisionLookup $revisionLookup,
- 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 158.
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
public function __construct(
LinkBatchFactory $linkBatchFactory,
DatabaseBlockStore $blockStore,
BlockRestrictionStore $blockRestrictionStore,
IConnectionProvider $dbProvider,
- 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 158.
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 setupDefaults
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.widgets.datetime.ProlepticGregorianDateTimeFormatter.static.setupDefaults = function () {
mw.widgets.datetime.DateTimeFormatter.static.setupDefaults.call( this );
if ( this.fullMonthNames && !this.shortMonthNames ) {
this.shortMonthNames = {};
Function conditionParse
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
function conditionParse( $root, spec ) {
let v, fields, func;
const op = spec[ 0 ];
let l = spec.length;
Function step
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
function step() {
if (canceled) return reject('canceled');
var startMs = Date.now();
// This code is copy/pasted 3 times for performance reasons [options.keys, options.key, no keys]
Function trigger
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
trigger: function( event, data, elem, onlyHandlers ) {
var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
eventPath = [ elem || document ],
type = hasOwn.call( event, "type" ) ? event.type : event,
Method doModify
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doModify( CommentStoreComment $summary ): PageUpdateStatus {
$wikiPage = $this->getWikiPage(); // TODO: use for legacy hooks only!
// Update article, but only if changed.
$status = PageUpdateStatus::newEmpty( false );
Method newLoad
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function newLoad(
$specificTarget,
$specificType,
$fromPrimary,
$vagueTarget = null
Method getTitle
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTitle() {
if ( $this->mTitle !== false ) {
return $this->mTitle;
}
if ( !is_string( $this->mDesiredDestName ) ) {
Method getNearMatchInternal
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getNearMatchInternal( $searchterm ) {
$allSearchTerms = [ $searchterm ];
if ( $this->languageConverter->hasVariants() ) {
$allSearchTerms = array_unique( array_merge(
Method updateActiveUsers
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function updateActiveUsers() {
$activeUserDays = MediaWikiServices::getInstance()->getMainConfig()->get(
MainConfigNames::ActiveUserDays );
// Users that made edits at least this many days ago are "active"