Showing 11,545 of 11,545 total issues
Method execute
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$user = $this->getUser();
if ( !$user->isRegistered() ) {
$this->dieWithError( 'apierror-mustbeloggedin-uploadstash', 'stashnotloggedin' );
Method validate
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function validate( $key, &$value ) {
switch ( $this->getPrefsKinds()[$key] ) {
case 'registered':
// Regular option.
if ( $value === null ) {
Method getHelp
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getHelp( IContextSource $context, $modules, array $options ) {
if ( !is_array( $modules ) ) {
$modules = [ $modules ];
}
Method getQueryInfo
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getQueryInfo() {
$db = $this->getDatabase();
$commentQuery = $this->commentStore->getJoin( 'bl_reason' );
$info = [
'tables' => array_merge(
Method initFromJson
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function initFromJson( JsonDeserializer $deserializer, array $jsonData ): void {
parent::initFromJson( $deserializer, $jsonData );
// WARNING: When changing how this class is serialized, follow the instructions
// at <https://www.mediawiki.org/wiki/Manual:Parser_cache/Serialization_compatibility>!
Method reallyFetchFile
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function reallyFetchFile( $httpOptions = [] ) {
$copyUploadProxy = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::CopyUploadProxy );
$copyUploadTimeout = MediaWikiServices::getInstance()->getMainConfig()
->get( MainConfigNames::CopyUploadTimeout );
Method getDbResults
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getDbResults( ExistingPageRecord $page, array $params, $relativeRevId, $ts, $tagIds ) {
$dbr = $this->dbProvider->getReplicaDatabase();
$queryBuilder = $this->revisionStore->newSelectQueryBuilder( $dbr )
->joinComment()
->where( [ 'rev_page' => $page->getId() ] )
Method getTrackingCategories
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTrackingCategories() {
$categories = array_merge(
self::CORE_TRACKING_CATEGORIES,
$this->extensionRegistry->getAttribute( MainConfigNames::TrackingCategories ),
$this->options->get( MainConfigNames::TrackingCategories ) // deprecated
File MessagesGl.php
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** Galician (galego)
*
* @file
* @ingroup Languages
Method filter
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function filter( $source ) {
$tokens = token_get_all( $source );
$buffer = null;
$output = '';
foreach ( $tokens as $token ) {
Method pokeFile
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function pokeFile( $orig, $new ) {
$path = $this->filePath( $orig );
if ( !file_exists( $path ) ) {
$this->output( "missing file: $path\n" );
$this->killRow( $orig );
Identical blocks of code found in 2 locations. Consider refactoring. Open
public function testUserExists( $username, $flags = IDBAccessObject::READ_NORMAL ) {
$username = $this->userNameUtils->getCanonical( $username, UserRigorOptions::RIGOR_USABLE );
if ( $username === false ) {
return false;
}
- 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 126.
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
'default' => [
'https://3hub.co' => true,
'https://morepro.info' => true,
'https://p.ato.mx' => true,
'https://s.ato.mx' => true,
- 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 126.
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
'CSPFalsePositiveUrls' => [
'https://3hub.co' => true,
'https://morepro.info' => true,
'https://p.ato.mx' => true,
'https://s.ato.mx' => true,
- 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 126.
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
public function testUserExists( $username, $flags = IDBAccessObject::READ_NORMAL ) {
$username = $this->userNameUtils->getCanonical(
$username, UserRigorOptions::RIGOR_USABLE );
if ( $username === false ) {
return false;
- 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 126.
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 TraditionalImageGallery.php
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use MediaWiki\HookContainer\HookRunner;
use MediaWiki\Html\Html;
use MediaWiki\Linker\Linker;
File DjVuHandler.php
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Handler for DjVu images.
*
* This program is free software; you can redistribute it and/or modify
File ApiAuthManagerHelper.php
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Copyright © 2016 Wikimedia Foundation and contributors
*
* This program is free software; you can redistribute it and/or modify
File JobQueue.php
has 259 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 moveToExternal.php
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Move text from the text table to external storage
*
* This program is free software; you can redistribute it and/or modify