Showing 2,096 of 2,096 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
private function deserializeQualifiers( array $serialization, string $basePath ): SnakList {
$qualifiers = [];
foreach ( $serialization['qualifiers'] as $index => $qualifier ) {
if ( !is_array( $qualifier ) ) {
throw new InvalidFieldException( "$index", $qualifier, "$basePath/qualifiers/$index" );
- 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 105.
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 formatSnaks( array $snaks ) {
$formattedValues = [];
foreach ( $snaks as $snak ) {
$formattedValue = $this->snakFormatter->formatSnak( $snak );
- 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 105.
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 formatSnakList( array $snaks ) {
$formattedValues = [];
foreach ( $snaks as $snak ) {
$formattedValue = $this->snakFormatter->formatSnak( $snak );
- 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 105.
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 deserializeReferences( array $serialization, string $basePath ): ReferenceList {
$references = [];
foreach ( $serialization['references'] as $index => $reference ) {
if ( !is_array( $reference ) ) {
throw new InvalidFieldException( "$index", $reference, "$basePath/references/$index" );
- 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 105.
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
protected function createSummary( EntityDocument $property ) {
$uiLanguageCode = $this->getLanguage()->getCode();
$summary = new Summary( 'wbeditentity', 'create' );
$summary->setLanguage( $uiLanguageCode );
- 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 105.
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
protected function createSummary( EntityDocument $item ): Summary {
$uiLanguageCode = $this->getLanguage()->getCode();
$summary = new Summary( 'wbeditentity', 'create' );
$summary->setLanguage( $uiLanguageCode );
- 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 105.
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 getStatementView
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
SELF.prototype.getStatementView = function ( startEditingCallback, entityId, propertyId, removeCallback, value, $dom ) {
var currentPropertyId = value ? value.getClaim().getMainSnak().getPropertyId() : propertyId;
var view = this._getView(
'statementview',
$dom,
Function getStatementView
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
SELF.prototype.getStatementView = function ( startEditingCallback, entityId, propertyId, removeCallback, value, $dom ) {
var controller;
var startEditingController = function () {
return controller.startEditing();
};
Function _onConfirmationDataLoad
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onConfirmationDataLoad: function ( entity ) {
var i, itemLink;
if ( entity && entity.sitelinks ) {
var siteLinkCount = 0;
Function search
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
search: function () {
var self = this,
deferred = $.Deferred();
this._clearTimeout();
Function ae93
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fails = __webpack_require__("d039");
Method doQuery
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doQuery( array $params, ApiPageSet $resultPageSet = null ): ?IResultWrapper {
if ( !$params['entities'] ) {
return null;
}
Method getPageHeader
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPageHeader() {
$excludeNamespaces = array_diff(
$this->namespaceInfo->getValidNamespaces(),
$this->namespaceChecker->getWikibaseNamespaces()
);
Method formatEntityUsage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function formatEntityUsage( array $usages, IContextSource $context ): array {
$usageAspectsByEntity = [];
$entityIds = [];
foreach ( $usages as $entityUsage ) {
Method getPagesUsing
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPagesUsing( array $entityIds, array $aspects = [] ): Traversable {
if ( !$this->aspectsMatchImplicitUsage( $aspects ) ) {
// Caller is not interested in implicit usage,
// no need to add anything
return yield from $this->usageLookup->getPagesUsing( $entityIds, $aspects );
Method attemptSave
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function attemptSave(
Title $title,
EntityContent $content,
string $summary,
int $undidRevId,
Method getAllowedParams
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAllowedParams(): array {
return array_merge(
[
'claim' => [
ParamValidator::PARAM_TYPE => 'string',
Method execute
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(): void {
$params = $this->extractRequestParams();
$result = $this->getResult();
$context = $params['context'];
Method getAllowedParams
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAllowedParams(): array {
return array_merge( [
'fromid' => [
ParamValidator::PARAM_TYPE => 'string',
ParamValidator::PARAM_REQUIRED => true,
Method rdfSerialize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function rdfSerialize(
EntityRevision $entityRevision,
?RedirectRevision $followedRedirect,
array $incomingRedirects,
RdfBuilder $rdfBuilder,