Showing 2,096 of 2,096 total issues
Identical blocks of code found in 2 locations. Consider refactoring. Open
private function newSuccessHttpResponse( AddPropertyAliasesInLanguageResponse $useCaseResponse ): Response {
$httpResponse = $this->getResponseFactory()->create();
$httpResponse->setStatus( $useCaseResponse->wasAddedToExistingAliasGroup() ? 200 : 201 );
$httpResponse->setHeader( 'Content-Type', 'application/json' );
$httpResponse->setHeader(
- 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 132.
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 5 locations. Consider refactoring. Open
public function __construct(
GuidGenerator $guidGenerator,
StatementGuidValidator $guidValidator,
StatementGuidParser $guidParser,
SnakValidator $snakValidator,
- 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 132.
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 5 locations. Consider refactoring. Open
public function __construct(
EntityRevisionLookup $entityRevisionLookup,
EntityStore $entityStore,
EntityPermissionChecker $permissionChecker,
SummaryFormatter $summaryFormatter,
- 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 132.
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
File ParseValue.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace Wikibase\Repo\Api;
File FormatSnakValue.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace Wikibase\Repo\Api;
Function draw
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw: function () {
var done = $.Deferred().resolve().promise();
var self = this,
languageCode = this.options.value.getLanguageCode(),
descriptionText = this.options.value.getText();
Method assertValidStatements
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function assertValidStatements( array $serialization, Item $originalItem, array $originalStatementsSerialization ): void {
$validationError = $this->statementsValidator->validateModifiedStatements(
$originalStatementsSerialization,
$originalItem->getStatements(),
$serialization['statements'] ?? [],
File jquery.wikibase.badgeselector.js
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license GPL-2.0-or-later
* @author H. Snater < mediawiki@snater.com >
*/
( function () {
RdfBuilder
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class RdfBuilder implements EntityRdfBuilder, EntityStubRdfBuilder, EntityMentionListener {
/**
* A list of entities mentioned/touched to or by this builder.
* The prefixed entity IDs are used as keys in the array, the value 'true'
EntityContent
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class EntityContent extends AbstractContent {
/**
* Flag for use with EntityHandler::validateSave(), indicating that no pre-save validation should be applied.
* Can be passed in via EditEntity::attemptSave, EntityStore::saveEntity,
WikibaseValueFormatterBuilders
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class WikibaseValueFormatterBuilders {
/**
* @var FormatterLabelDescriptionLookupFactory
*/
StatementList
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class StatementList implements IteratorAggregate, Countable {
/**
* @var Statement[]
*/
Fingerprint
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Fingerprint implements LabelsProvider, DescriptionsProvider, AliasesProvider {
/**
* @deprecated since 2.5, use new Fingerprint() instead.
*
Method mergeChanges
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function mergeChanges( EntityId $entityId, array $changes ) {
if ( count( $changes ) === 1 ) {
return reset( $changes );
}
Method getEntityRevision
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getEntityRevision( EntityId $id, $revision, $allowRedirects = false ) {
$prefixedId = $id->getSerialization();
$redirectRevision = null;
try {
Function draw
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw: function () {
var self = this,
deferred = $.Deferred(),
languageCode = this.options.value.getLanguageCode(),
labelText = this.options.value.getText();
Method internalDoHtmlPageLinkRendererEnd
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function internalDoHtmlPageLinkRendererEnd(
LinkRenderer $linkRenderer,
Title $target,
&$text,
array &$customAttribs,
Function createServices
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function createServices(
mwWindow: MwWindow,
editTags: readonly string[],
eventTracker: Tracker,
): ServiceContainer {
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace Wikibase\Repo\ParserOutput;
- 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 130.
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
<?php
declare( strict_types = 1 );
namespace Wikibase\Repo\ParserOutput;
- 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 130.
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