Showing 2,096 of 2,096 total issues
Method getUnexpectedUnconnectedBatch
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getUnexpectedUnconnectedBatch(): array {
$dbr = $this->localConnectionManager->getReadConnection();
$lastPosition = $this->position + $this->batchSize * $this->batchSizeSelectMultiplicator;
$result = $dbr->newSelectQueryBuilder()
Method newEntityDiffVisualizer
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function newEntityDiffVisualizer( ?string $type = null, ?IContextSource $context = null ): EntityDiffVisualizer {
if ( $context === null ) {
$context = RequestContext::getMain();
}
$langCode = $context->getLanguage()->getCode();
Method visualizeReferenceChanges
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function visualizeReferenceChanges(
$headerPrefix,
Diff $changes,
Snak $oldestMainSnak,
Snak $newestMainSnak
Method findImplicitUsages
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function findImplicitUsages( array $entityIds ): array {
$numericItemIds = [];
foreach ( $entityIds as $entityId ) {
if ( $entityId instanceof ItemId ) {
$numericItemIds[] = $entityId->getNumericId();
Method visualizeQualifierChanges
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function visualizeQualifierChanges(
$headerPrefix,
Diff $changes,
Snak $oldestMainSnak,
Snak $newestMainSnak
Method mergeItems
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mergeItems(
ItemId $fromId,
ItemId $toId,
IContextSource $context,
array $ignoreConflicts = [],
Method formatRow
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function formatRow( EntityId $propertyId ) {
$title = $this->titleLookup->getTitleForId( $propertyId );
$language = $this->getLanguage();
if ( !$title->exists() ) {
Method onApiCheckCanExecute
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function onApiCheckCanExecute( ApiBase $module, User $user, &$message ) {
if ( $module instanceof ApiEditPage ) {
$params = $module->extractRequestParams();
$pageObj = $module->getTitleOrPageId( $params );
$namespace = $pageObj->getTitle()->getNamespace();
Method getAllowedParams
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAllowedParams(): array {
return array_merge(
[
'statement' => [
ParamValidator::PARAM_TYPE => 'string',
Method deserialize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deserialize( string $siteId, array $serialization, string $basePath = '' ): SiteLink {
if ( !array_key_exists( 'title', $serialization ) ) {
throw new MissingFieldException( 'title', $basePath );
}
Method handleDescriptionsValidationError
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleDescriptionsValidationError( ValidationError $validationError ): void {
$context = $validationError->getContext();
switch ( $validationError->getCode() ) {
case DescriptionsSyntaxValidator::CODE_DESCRIPTIONS_NOT_ASSOCIATIVE:
Method updateQueryBuilder
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function updateQueryBuilder( SelectQueryBuilder $queryBuilder, array $entityIds, IReadableDatabase $db ) {
$where = [];
$joinSlotsTable = false;
foreach ( $entityIds as $entityId ) {
Method newDefinitionsFromConfigArray
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function newDefinitionsFromConfigArray( array $sourceConfig, SubEntityTypesMapper $subEntityTypesMapper ) {
$this->assertConfigArrayWellFormed( $sourceConfig );
$sources = [];
Identical blocks of code found in 2 locations. Consider refactoring. Open
option: function ( key, value ) {
if ( key === 'gravity' ) {
// Consider language direction:
value = this._evaluateGravity( value );
}
- 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 63.
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
option: function ( key, value ) {
if ( key === 'gravity' ) {
// Consider language direction:
value = this._evaluateGravity( value );
}
- 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 63.
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 ( terms.label.getText() === '' ) {
// FIXME: DataModel JavaScript should do this.
value.removeLabelFor( terms.language );
} else {
value.setLabel( terms.language, terms.label );
- 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 63.
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 ( terms.description.getText() === '' ) {
// FIXME: DataModel JavaScript should do this.
value.removeDescriptionFor( terms.language );
} else {
value.setDescription( terms.language, terms.description );
- 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 63.
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
getPageUrl: ( title, params? ) => {
let url = `http://repo/${title}`;
if ( params ) {
url += '?' + new URLSearchParams( params as Record<string, string> ).toString();
}
- 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 63.
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
getPageUrl( title: string, params?: Record<string, unknown> ) {
let url = `https://client.wiki.example/wiki/${title}`;
if ( params ) {
url += '?' + new URLSearchParams( params as Record<string, string> ).toString();
}
- 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 63.
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 __construct
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityContentFactory $contentFactory,
EntityTitleStoreLookup $entityTitleStoreLookup,
IdGenerator $idGenerator,
EntityIdComposer $entityIdComposer,
RevisionStore $revisionStore,