Showing 11,545 of 11,545 total issues
Method mergeInternalMetaDataFrom
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mergeInternalMetaDataFrom( ParserOutput $source ): void {
$this->mWarnings = self::mergeMap( $this->mWarnings, $source->mWarnings ); // don't use getter
$this->mTimestamp = $this->useMaxValue( $this->mTimestamp, $source->getRevisionTimestamp() );
if ( $source->hasCacheTime() ) {
$sourceCacheTime = $source->getCacheTime();
Method __construct
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(
ServiceOptions $svcOptions,
MagicWordFactory $magicWordFactory,
Language $contLang,
ParserFactory $factory,
Method logLine
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function logLine( $row ) {
$entry = DatabaseLogEntry::newFromRow( $row );
$formatter = $this->logFormatterFactory->newFromEntry( $entry );
$formatter->setContext( $this->getContext() );
$formatter->setShowUserToolLinks( !( $this->flags & self::NO_EXTRA_USER_LINKS ) );
Method loadFromRow
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loadFromRow( $row, $prefix = 'img_' ) {
$this->dataLoaded = true;
$unprefixed = $this->unprefixRow( $row, $prefix );
Method getFileInfo
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getFileInfo( $file, Authority $performer, $transforms ) {
$urlUtils = MediaWikiServices::getInstance()->getUrlUtils();
// If there is a problem with the file, there is very little info we can reliably
// return (T228286, T239213), but we do what we can (T201205).
$responseFile = [
Method doPage
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doPage( $pageId ) {
$title = Title::newFromID( $pageId );
if ( $title ) {
$titleText = $title->getPrefixedText();
} else {
Method loadThing
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function loadThing( &$dependencies, $name, $extensions, $skins ) {
$extDir = $this->getConfig()->get( MainConfigNames::ExtensionDirectory );
$styleDir = $this->getConfig()->get( MainConfigNames::StyleDirectory );
$queue = [];
$missing = false;
Method execute
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
global $IP;
$platform = $this->getOption( 'type', 'mysql' );
$jsonPath = $this->getOption( 'json', dirname( __DIR__ ) );
Method generateMessageFileList
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateMessageFileList( array $setupFiles ) {
$IP = MW_INSTALL_PATH;
$outputFile = $this->getOption( 'output' );
$quiet = $this->hasOption( 'quiet' );
Method doAllOrphans
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doAllOrphans() {
$dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
$startId = 0;
$i = 0;
if ( $this->noCount ) {
Method mungeTitle
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function mungeTitle( IReadableDatabase $db, Title $oldTitle, Title &$newTitle ) {
$nt = $newTitle->getPrefixedText();
$munge = false;
if ( $this->isUserPage( $db, $newTitle->getNamespace(), $newTitle->getText() ) ) {
Method doDBUpdates
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function doDBUpdates() {
$this->output( "Fixing log entries with log_title starting with 'User:#'\n" );
$dbr = $this->getReplicaDB();
$dbw = $this->getPrimaryDB();
Method purgeFromLogType
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function purgeFromLogType( $type ) {
$repo = $this->getServiceContainer()->getRepoGroup()->getLocalRepo();
$dbr = $this->getReplicaDB();
foreach ( self::$typeMappings[$type] as $logType => $logActions ) {
Method cleanupArticle
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function cleanupArticle( $id, $domain, $protocol, Authority $performer ) {
$title = Title::newFromID( $id );
if ( !$title ) {
$this->error( "Internal error: no page for ID $id" );
Method movePage
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function movePage( $id, LinkTarget $newLinkTarget ) {
$dbw = $this->getPrimaryDB();
$dbw->newUpdateQueryBuilder()
->update( 'page' )
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( this.selected !== state ) {
this.selected = state;
this.$input.prop( 'checked', this.selected );
if ( !internal ) {
this.setIndeterminate( false, 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 77.
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
OO.ui.WindowInstance.prototype.isOpened = function () {
return this.deferreds.opened.state() === 'resolved' &&
this.deferreds.closing.state() === 'pending';
};
- 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 77.
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
yieldsRight: function () {
this.callArgAt = useRightMostCallback;
this.callbackArguments = slice.call(arguments, 0);
this.callbackContext = undefined;
this.callArgProp = undefined;
- 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 77.
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
yields: function () {
this.callArgAt = useLeftMostCallback;
this.callbackArguments = slice.call(arguments, 0);
this.callbackContext = undefined;
this.callArgProp = undefined;
- 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 77.
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
put: function ( path, body, headers ) {
headers = objectKeysToLowerCase( headers );
return this.ajax( path, {
type: 'PUT',
headers: Object.assign( headers, { 'content-type': 'application/json' } ),
- 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 77.
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