Showing 2,096 of 2,096 total issues
Method assertConstructFieldsAreCorrect
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function assertConstructFieldsAreCorrect( array $fields ) {
Assert::parameter(
count( $fields ) === count( self::FIELD_NAMES ) &&
!array_diff( self::FIELD_NAMES, array_keys( $fields ) ),
'$fields',
Function mwApiRejectionToError
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private mwApiRejectionToError( code: string, arg2: unknown, _arg3: unknown, _arg4: unknown ): never {
switch ( code ) {
case 'http': { // jQuery AJAX failure
const detail = arg2 as {
xhr: jqXHR;
Function dispatch
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public dispatch( selectedElement: SelectedElement ): void {
const dialog = prepareContainer( this.mwWindow.OO, this.mwWindow.$, Dispatcher.APP_DOM_CONTAINER_ID );
const emitter = this.app.launch(
( this.vue as MwVueConstructor ).createMwApp,
Identical blocks of code found in 2 locations. Consider refactoring. Open
protected function initRepoJobServicesFromGlobalState(): void {
$services = MediaWikiServices::getInstance();
$this->initServices(
WikibaseRepo::getStore( $services )->getEntityLookup(
- 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 102.
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
protected function initRepoJobServicesFromGlobalState(): void {
$services = MediaWikiServices::getInstance();
$this->initServices(
WikibaseRepo::getStore( $services )->getEntityLookup(
- 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 102.
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
private function generateAddedCells() {
$html = Html::element( 'td', [ 'class' => 'diff-marker', 'data-marker' => '+' ] );
$html .= Html::rawElement( 'td', [ 'class' => 'diff-addedline' ],
Html::rawElement( 'div', [],
Html::rawElement( 'ins', [ 'class' => 'diffchange diffchange-inline' ],
- 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 102.
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 ( $this->label !== '' ) {
if ( !$fingerprint->hasLabel( $this->languageCode )
|| $fingerprint->getLabel( $this->languageCode )->getText() !== $this->label
) {
$changeOps['wbsetlabel'] = $changeOpFactory->newSetLabelOp(
- 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 102.
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
private function generateDeletedCells() {
$html = Html::element( 'td', [ 'class' => 'diff-marker', 'data-marker' => '−' ] );
$html .= Html::rawElement( 'td', [ 'class' => 'diff-deletedline' ],
Html::rawElement( 'div', [],
Html::rawElement( 'del', [ 'class' => 'diffchange diffchange-inline' ],
- 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 102.
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 ( $this->description !== '' ) {
if ( !$fingerprint->hasDescription( $this->languageCode )
|| $fingerprint->getDescription( $this->languageCode )->getText() !== $this->description
) {
$changeOps['wbsetdescription'] = $changeOpFactory->newSetDescriptionOp(
- 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 102.
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
Item = util.inherit(
$.ui.ooMenu.Item,
Item,
{
/**
- 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 56.
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
Item = util.inherit(
$.ui.ooMenu.Item,
Item,
{
/**
- 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 56.
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 _onSuccess
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onSuccess: function () {
var mwApi = new mw.Api(),
itemUri = this._linkRepoTitle(
'Special:ItemByTitle/' + this.options.globalSiteId + '/' + this.options.pageTitle
);
Function _createReferencesListview
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createReferencesListview: function ( references ) {
var self = this;
var $listview = this.$references.children( '.wikibase-listview' );
if ( !$listview.length ) {
Function _initMenu
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initMenu: function ( ooMenu ) {
var self = this;
$.ui.suggester.prototype._initMenu.apply( this, arguments );
Function _initMenu
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initMenu: function ( ooMenu ) {
var self = this;
$.ui.suggester.prototype._initMenu.apply( this, arguments );
Function _createStatementlistview
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createStatementlistview: function () {
var self = this,
prefix;
var $statementlistview = this.element.find( '.wikibase-statementlistview' );
Method getBadges
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getBadges( string $prefixedItemId, ?string $globalSiteId ): array {
$globalSiteId = $globalSiteId ?: $this->siteId;
try {
$itemId = new ItemId( $prefixedItemId );
Method getCentralDescriptions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getCentralDescriptions( array $titlesByPageId ) {
if ( !$titlesByPageId ) {
return [];
}
Method newEntityRevisionLookup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function newEntityRevisionLookup() {
// Maintain a list of watchers to be notified of changes to any entities,
// in order to update caches.
/** @var WikiPageEntityStore $dispatcher */
$dispatcher = $this->getEntityStoreWatcher();
Method getUsagesForPage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getUsagesForPage( int $pageId ): array {
$usages = $this->usageLookup->getUsagesForPage( $pageId );
$title = $this->titleFactory->newFromID( $pageId );
if ( !$title ) {
return $usages;