Showing 11,545 of 11,545 total issues
File MWHttpRequest.php
has 370 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
Method getJSVars
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getJSVars( ?int $flag = null ) {
$curRevisionId = 0;
$articleId = 0;
$canonicalSpecialPageName = false; # T23115
$services = MediaWikiServices::getInstance();
File SpecialTags.php
has 369 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 ForeignAPIRepo.php
has 369 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 RemexCompatMunger.php
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MediaWiki\Tidy;
use InvalidArgumentException;
Identical blocks of code found in 2 locations. Consider refactoring. Open
'policies' => [
'bureaucrat' => [
'MinimalPasswordLength' => 10,
'MinimumPasswordLengthToLogin' => 1,
],
- 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 180.
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
'policies' => [
'bureaucrat' => [
'MinimalPasswordLength' => 10,
'MinimumPasswordLengthToLogin' => 1,
],
- 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 180.
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 makeCollapsible
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.makeCollapsible = function ( options ) {
options = options || {};
this.each( function () {
// Ensure class "mw-collapsible" is present in case .makeCollapsible()
Function goAsync
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
goAsync: function goAsync(search, targets, options) {
var canceled = false;
var p = new Promise(function (resolve, reject) {
if (search == 'farzher') return resolve([{
target: "farzher was here (^-^*)/",
Function Callbacks
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
Method importFormDataPosted
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function importFormDataPosted( WebRequest $request ): void {
# These fields need to be checked for encoding.
# Also remove trailing whitespace, but don't remove _initial_
# whitespace from the text boxes. This may be significant formatting.
$this->textbox1 = rtrim( $request->getText( 'wpTextbox1' ) );
Method getHeadLinksArray
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHeadLinksArray() {
$tags = [];
$config = $this->getConfig();
if ( $this->cspOutputMode === self::CSP_META ) {
BagOStuff
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class BagOStuff implements
ExpirationAwareness,
StorageAwareness,
IStoreKeyEncoder,
LoggerAwareInterface
IndexPager
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class IndexPager extends ContextSource implements Pager {
/** Backwards-compatible constant for $mDefaultDirection field (do not change) */
public const DIR_ASCENDING = false;
/** Backwards-compatible constant for $mDefaultDirection field (do not change) */
ApiQuerySiteinfo
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class ApiQuerySiteinfo extends ApiQueryBase {
private UserOptionsLookup $userOptionsLookup;
private UserGroupManager $userGroupManager;
private LanguageConverterFactory $languageConverterFactory;
JobQueueRedis
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class JobQueueRedis extends JobQueue {
/** @var RedisConnectionPool */
protected $redisPool;
/** @var LoggerInterface */
protected $logger;
HtmlToContentTransform
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class HtmlToContentTransform {
private array $options = [];
private ?int $oldid = null;
private ?Bcp47Code $contentLanguage = null;
private ?Content $originalContent = null;
RecentChange
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class RecentChange implements Taggable {
use DeprecationHelper;
// Constants for the rc_source field. Extensions may also have
// their own source constants.
File ApiParamInfo.php
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Copyright © 2008 Roan Kattouw <roan.kattouw@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
File UploadForm.php
has 367 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