Showing 11,545 of 11,545 total issues
Method processUser
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processUser( string $value ): array {
// A user ID?
if ( preg_match( '/^#(\d+)$/D', $value, $m ) ) {
// This used to use the IP address of the current request if the
// id was 0, to match the behavior of User objects, but was switched
Method parseAndCache
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseAndCache( $pageUpdater, Content $content, UserIdentity $user, string $summary ) {
$logger = $this->logger;
if ( $pageUpdater instanceof WikiPage ) {
wfDeprecated( __METHOD__ . ' with WikiPage instance', '1.42' );
Method open
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function open( $server, $user, $password, $db, $schema, $tablePrefix ) {
$this->close( __METHOD__ );
// Note that for SQLite, $server, $user, and $pass are ignored
Method getDefaultModules
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDefaultModules() {
$out = $this->getOutput();
$user = $this->getUser();
// Modules declared in the $modules literal are loaded
Method getLocalURL
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getLocalURL( $query = '' ) {
global $wgArticlePath, $wgScript, $wgMainPageIsDomainRoot;
$query = is_array( $query ) ? wfArrayToCgi( $query ) : $query;
Method transformImageMagickExt
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function transformImageMagickExt( $image, $params ) {
$mainConfig = MediaWikiServices::getInstance()->getMainConfig();
$sharpenReductionThreshold = $mainConfig->get( MainConfigNames::SharpenReductionThreshold );
$sharpenParameter = $mainConfig->get( MainConfigNames::SharpenParameter );
$maxAnimatedGifArea = $mainConfig->get( MainConfigNames::MaxAnimatedGifArea );
Method makeLegend
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function makeLegend() {
$context = $this->getContext();
$user = $context->getUser();
# The legend showing what the letters and stuff mean
$legend = Html::openElement( 'dl' ) . "\n";
Method getAllowedParams
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllowedParams( $flags = 0 ) {
$userGroups = $this->userGroupManager->listAllGroups();
if ( $flags & ApiBase::GET_VALUES_FOR_HELP ) {
sort( $userGroups );
Method outputChangesList
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function outputChangesList( $rows, $opts ) {
$limit = $opts['limit'];
$showWatcherCount = $this->getConfig()->get( MainConfigNames::RCShowWatchingUsers )
&& $this->userOptionsLookup->getBoolOption( $this->getUser(), 'shownumberswatching' );
Method getQueryInfo
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getQueryInfo() {
$dbr = $this->getDatabase();
$conds = [
$dbr->expr( 'pr_expiry', '>', $dbr->timestamp() )
->or( 'pr_expiry', '=', null ),
Method magicLinkCallback
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function magicLinkCallback( array $m ) {
if ( isset( $m[1] ) && $m[1] !== '' ) {
# Skip anchor
return $m[0];
} elseif ( isset( $m[2] ) && $m[2] !== '' ) {
Method detectScript
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function detectScript( $file, $mime, $extension ) {
# ugly hack: for text files, always look at the entire file.
# For binary field, just check the first K.
if ( str_starts_with( $mime ?? '', 'text/' ) ) {
Method render
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render( SearchResult $result, $position ) {
// If the page doesn't *exist*... our search index is out of date.
// The least confusing at this point is to drop the result.
// You may get less results, but... on well. :P
if ( $result->isBrokenTitle() || $result->isMissingRevision() ) {
Method getLine
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getLine( array $feed, RecentChange $rc, $actionComment ) {
$services = MediaWikiServices::getInstance();
$mainConfig = $services->getMainConfig();
$localInterwikis = $mainConfig->get( MainConfigNames::LocalInterwikis );
$useRCPatrol = $mainConfig->get( MainConfigNames::UseRCPatrol );
Method copyFileBatch
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function copyFileBatch(
array $srcPathsRel, $backendRel, FileBackend $src, FileBackend $dst
) {
$ops = [];
$fsFiles = [];
Similar blocks of code found in 2 locations. Consider refactoring. Open
case "locative": # jatıs
if ( in_array( $wordEnding, $Consonants ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word .= "те";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- 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 134.
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
if ( $params['startsortkeyprefix'] !== null ) {
$startsortkey = $this->collation->getSortKey( $params['startsortkeyprefix'] );
} elseif ( $params['starthexsortkey'] !== null ) {
if ( !$this->validateHexSortkey( $params['starthexsortkey'] ) ) {
$encParamName = $this->encodeParamName( 'starthexsortkey' );
- 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 134.
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
case "possessive locative": # täweldık + jatıs
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $secondPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word .= "де";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- 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 134.
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
case "dative": # barıs
if ( in_array( $wordEnding, $Consonants ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word .= "ке";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- 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 134.
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
case "possessive ablative": # täweldık + şığıs
if ( in_array( $wordEnding, $firstPerson ) || in_array( $wordEnding, $thirdPerson ) ) {
if ( in_array( $wordLastVowel, $frontVowels ) ) {
$word .= "нен";
} elseif ( in_array( $wordLastVowel, $backVowels ) ) {
- 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 134.
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