Showing 11,545 of 11,545 total issues
Method parse
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse( $variant = null ) {
if ( !$variant ) {
$variant = $this->mConverter->getPreferredVariant();
}
Method setCookie
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setCookie( $name, $value, $expire = 0, $options = [] ) {
$services = MediaWikiServices::getInstance();
$mainConfig = $services->getMainConfig();
$cookiePath = $mainConfig->get( MainConfigNames::CookiePath );
$cookiePrefix = $mainConfig->get( MainConfigNames::CookiePrefix );
Method form
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function form() {
$out = $this->getOutput();
// Consume values
$this->opts->consumeValue( 'offset' ); // don't carry offset, DWIW
Method execute
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$async = $this->hasOption( 'async' );
$dryrun = $this->hasOption( 'dry-run' );
if ( $this->hasOption( 'title' ) ) {
File FullSearchResultWidget.php
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MediaWiki\Search\SearchWidgets;
use File;
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function parseAsContent( $text, $linestart = true ) {
$title = $this->getTitle();
if ( $title === null ) {
throw new RuntimeException( 'No title in ' . __METHOD__ );
}
- 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 146.
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 'edits':
$from = $this->getValidatedParams()['from'] ?? null;
$to = $this->getValidatedParams()['to'] ?? null;
if ( $from || $to ) {
return $this->getEditsCount(
- 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 146.
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 'editors':
$from = $this->getValidatedParams()['from'] ?? null;
$to = $this->getValidatedParams()['to'] ?? null;
if ( $from || $to ) {
return $this->getEditorsCount(
- 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 146.
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 parseAsInterface( $text, $linestart = true ) {
$title = $this->getTitle();
if ( $title === null ) {
throw new RuntimeException( 'No title in ' . __METHOD__ );
}
- 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 146.
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
Method doQuery
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doQuery() {
if ( $this->mQueryDone ) {
return;
}
$this->mImg = $this->mImagePage->getPage()->getFile(); // ensure loading
Method setUsernameBitfields
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function setUsernameBitfields( $name, $userId, $op, IDatabase $dbw = null ) {
if ( !$userId || ( $op !== '|' && $op !== '&' ) ) {
return false;
}
if ( !$dbw instanceof IDatabase ) {
Method run
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
$user = $this->getWatchlistUser( $params );
Method __construct
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct( $context = null, $enableWrite = false, $internal = null ) {
if ( $context === null ) {
$context = RequestContext::getMain();
} elseif ( $context instanceof WebRequest ) {
// BC for pre-1.19
Method outputGeneralPageInfo
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function outputGeneralPageInfo() {
$pageSet = $this->getPageSet();
$result = $this->getResult();
// We can't really handle max-result-size failure here, but we need to
Method loadFromRow
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadFromRow( $row, $data = null ) {
if ( !is_object( $row ) ) {
throw new InvalidArgumentException( '$row must be an object' );
}
Method getText
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getText( $id, $model = null, $format = null, $expSize = null ) {
if ( !$this->isValidTextId( $id ) ) {
$msg = "Skipping bad text id " . $id . " of revision " . $this->thisRev;
$this->progress( $msg );
return '';
File MessagesTg_cyrl.php
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** Tajik (Cyrillic script) (тоҷикӣ)
*
* @file
* @ingroup Languages
Method execute
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$exampleKeys = [];
$max = 100;
$count = 500;
while ( $count-- ) {
Method checkNamespace
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkNamespace( $ns, $name, $options ) {
$targets = $this->getTargetList( $ns, $name, $options );
$count = $targets->numRows();
$this->totalPages += $count;
if ( $count == 0 ) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
OO.ui.SelectWidget.prototype.findHighlightedItem = function () {
for ( let i = 0; i < this.items.length; i++ ) {
if ( this.items[ i ].isHighlighted() ) {
return this.items[ i ];
}
- 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 99.
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