Showing 11,545 of 11,545 total issues
Method exportExtractedData
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function exportExtractedData( array $info ) {
if ( $info['globals'] ) {
// Create a copy of the keys to allow fast access via isset also for null values
// Since php8.1 always a read-only copy is created when the whole object is passed on function calls
// (like for array_key_exists). See T366547 - https://wiki.php.net/rfc/restrict_globals_usage
Method executeInternal
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function executeInternal( $isDryRun ) {
$generatorName = $this->mAllowGenerator ? $this->mParams['generator'] : null;
if ( isset( $generatorName ) ) {
$dbSource = $this->mDbSource;
if ( !$dbSource instanceof ApiQuery ) {
Method outputChangesList
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function outputChangesList( $rows, $opts ) {
$dbr = $this->getDB();
$user = $this->getUser();
$output = $this->getOutput();
Method makeNamespaceRow
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function makeNamespaceRow( int $ns, string $localName ): string {
$canonicalName = $this->namespaceInfo->getCanonicalName( $ns );
if ( $canonicalName ) {
$canonicalName = strtr( $canonicalName, '_', ' ' );
} else {
Method reformat
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function reformat( $preference, $text, $options = [] ) {
$userFormatId = self::PREFERENCE_IDS[$preference] ?? self::NONE;
foreach ( self::TARGET_FORMATS as $source => $_ ) {
if ( isset( self::RULES[$userFormatId][$source] ) ) {
# Specific rules
File MessagesNb.php
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** Norwegian Bokmål (norsk bokmål)
*
* @file
* @ingroup Languages
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function __construct(
LinkRenderer $linkRenderer,
LinkBatchFactory $linkBatchFactory,
LinkCache $linkCache,
RepoGroup $repoGroup,
- 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 148.
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(
Config $config,
HookContainer $hookContainer,
Language $contentLanguage,
NamespaceInfo $namespaceInfo,
- 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 148.
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
ChangesLimitAndDateButtonWidget.prototype.onPopupDays = function ( filterName ) {
const item = this.daysGroupModel.getItemByName( filterName );
this.controller.toggleFilterSelect( filterName, true );
this.controller.updateDaysDefault( item.getParamName() );
- 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 101.
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
ChangesLimitAndDateButtonWidget.prototype.onPopupLimit = function ( filterName ) {
const item = this.limitGroupModel.getItemByName( filterName );
this.controller.toggleFilterSelect( filterName, true );
this.controller.updateLimitDefault( item.getParamName() );
- 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 101.
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 UploadFromChunks.php
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use MediaWiki\Deferred\AutoCommitUpdate;
use MediaWiki\Deferred\DeferredUpdates;
use MediaWiki\Logger\LoggerFactory;
Function diffBisect
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
DiffMatchPatch.prototype.diffBisect = function (text1, text2, deadline) {
var text1Length, text2Length, maxD, vOffset, vLength, v1, v2, x, delta, front, k1start, k1end, k2start, k2end, k2Offset, k1Offset, x1, x2, y1, y2, d, k1, k2;
// Cache the text lengths to prevent multiple calls.
text1Length = text1.length;
Method doDelete
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function doDelete(
Title $title,
LocalFile $file,
?string $oldimage,
$reason,
Method getLocksOnServer
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getLocksOnServer( $lockSrv, array $pathsByType ) {
$status = StatusValue::newGood();
$pathList = array_merge( ...array_values( $pathsByType ) );
Method reallyOpenConnection
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function reallyOpenConnection( $i, DatabaseDomain $domain, array $lbInfo ) {
if ( $this->disabled ) {
throw new DBAccessError();
}
Method getPageList
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPageList(): array {
if ( !is_array( $this->list ) ) {
$this->list = self::CORE_LIST;
if ( !$this->options->get( MainConfigNames::DisableInternalSearch ) ) {
Method execute
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->checkPermissions();
$this->setHeaders();
$this->outputHeader();
Method setupDatabase
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setupDatabase() {
$dir = $this->getVar( 'wgSQLiteDataDir' );
# Double check (Only available in web installation). We checked this before but maybe someone
# deleted the data dir between then and now
Method __wakeup
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __wakeup() {
$oldAliases = [
// This was the pre-namespace name of the class, which is still
// used in pre-1.42 serialized objects.
'ParserOutput',
Method getMessageParameters
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getMessageParameters() {
$params = parent::getMessageParameters();
$title = $this->entry->getTarget();
if ( substr( $title->getText(), 0, 1 ) === '#' ) {