Showing 11,545 of 11,545 total issues
Method newRevisionFromRowAndSlots
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function newRevisionFromRowAndSlots(
stdClass $row,
$slots,
int $queryFlags = 0,
?PageIdentity $page = null,
Method rcPreferences
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function rcPreferences( User $user, MessageLocalizer $l10n, &$defaultPreferences ) {
$rcMaxAge = $this->options->get( MainConfigNames::RCMaxAge );
$rcMax = ceil( $rcMaxAge / ( 3600 * 24 ) );
$defaultPreferences['rcdays'] = [
'type' => 'float',
Method execute
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$authority = $this->getAuthority();
// Fail early if the user is sitewide blocked.
$block = $authority->getBlock();
Method generateThumbnail
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateThumbnail( File $file, array $params, $thumbName, $thumbPath ) {
$attemptFailureEpoch = $this->getConfig( MainConfigNames::AttemptFailureEpoch );
$services = MediaWikiServices::getInstance()->getObjectCacheFactory();
File DateTimeFormatter.js
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
( function () {
/**
* @class
* @classdesc Provides various methods needed for formatting dates and times.
File LocalSettingsGenerator.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
File MessagesVi.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** Vietnamese (Tiếng Việt)
*
* @file
* @ingroup Languages
Similar blocks of code found in 2 locations. Consider refactoring. Open
function nOrMore(n, p) {
return function() {
var originalPos = pos,
result = [],
parsed = p();
- 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 104.
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
if ( config.formatter instanceof mw.widgets.datetime.DateTimeFormatter ) {
this.formatter = config.formatter;
} else if ( $.isPlainObject( config.formatter ) ) {
this.formatter = new mw.widgets.datetime.ProlepticGregorianDateTimeFormatter( config.formatter );
} else {
- 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 104.
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
if ( config.formatter instanceof mw.widgets.datetime.DateTimeFormatter ) {
this.formatter = config.formatter;
} else if ( $.isPlainObject( config.formatter ) ) {
this.formatter = new mw.widgets.datetime.ProlepticGregorianDateTimeFormatter( config.formatter );
} else {
- 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 104.
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
function nOrMore( n, p ) {
return function () {
var originalPos = pos,
result = [],
parsed = p();
- 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 104.
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 handleAdds( IReadableDatabase $dbr, $output ) {
fwrite( $output, "# Additions\n" );
foreach ( $this->getNewCatsIterator( $dbr, __METHOD__ ) as $batch ) {
$pages = [];
- 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 151.
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 handleRestores( IReadableDatabase $dbr, $output ) {
fwrite( $output, "# Restores\n" );
// This will only find those restores that were not deleted later.
foreach ( $this->getRestoredCatsIterator( $dbr, __METHOD__ ) as $batch ) {
- 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 151.
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 diffCleanupMerge
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
DiffMatchPatch.prototype.diffCleanupMerge = function (diffs) {
diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
var pointer = 0;
var countDelete = 0;
var countInsert = 0;
Method beginAccountLink
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function beginAccountLink( User $user, array $reqs, $returnToUrl ) {
$session = $this->request->getSession();
$session->remove( self::ACCOUNT_LINK_STATE );
if ( !$this->canLinkAccounts() ) {
Method tempDelete
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function tempDelete() {
$article = $this->getArticle();
$title = $this->getTitle();
$context = $this->getContext();
$user = $context->getUser();
Method getAllowedParams
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllowedParams() {
return [
'limit' => [
ParamValidator::PARAM_DEFAULT => 10,
ParamValidator::PARAM_TYPE => 'limit',
Method run
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function run( $resultPageSet = null ) {
$db = $this->getDB();
$params = $this->extractRequestParams();
$this->addTables( 'category' );
Method getAllowedParams
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllowedParams() {
$smallLimit = $this->getMain()->canApiHighLimits() ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_SML1;
return [
'start' => [
ParamValidator::PARAM_TYPE => 'timestamp',
Method maybeAlterFormDefaults
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function maybeAlterFormDefaults( &$fields ) {
// This will be overwritten by request data
$fields['Target']['default'] = (string)$this->target;
if ( $this->target ) {