Showing 2,096 of 2,096 total issues
Method onShowSearchHit
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
public function onShowSearchHit( $searchPage, $result,
$terms, &$link, &$redirect, &$section, &$extract, &$score, &$size, &$date, &$related,
&$html
Method __construct
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityTitleStoreLookup $titleLookup,
EntityRevisionLookup $entityLookup,
EntityStore $entityStore,
EntityPermissionChecker $permissionChecker,
EntityDiffer $entityDiffer,
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( key === 'value' && !!value ) {
if ( !( value instanceof datamodel.StatementGroup ) ) {
throw new Error( 'value needs to be a datamodel.StatementGroup instance' );
}
this.statementlistview.value( value.getItemContainer() );
- 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 65.
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 ( key === 'value' && !!value ) {
if ( !( value instanceof datamodel.StatementList ) ) {
throw new Error( 'value needs to be a datamodel.StatementList instance' );
}
this._listview.value( value.toArray() );
- 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 65.
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._referencesListview.value().every( function ( referenceview ) {
var value = referenceview.value();
references.push( value );
return 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 65.
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._listview.value().every( function ( snakview ) {
var snak = snakview.snak();
snaks.push( snak );
return 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 65.
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 _registerTogglerForLanguagelistviewDiv
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_registerTogglerForLanguagelistviewDiv: function ( optionKey ) {
var self = this,
api = new mw.Api();
this.$entitytermsforlanguagelistviewToggler = $( '<div>' )
.addClass( 'wikibase-entitytermsview-entitytermsforlanguagelistview-toggler' )
Function _appendItem
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_appendItem: function ( item ) {
var self = this;
var label = this.options.manipulateLabel
? this.options.manipulateLabel( item.getLabel() )
Function _create
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function () {
if ( !this.options.getListItemAdapter
|| ( this.options.value && !( this.options.value instanceof datamodel.StatementList ) )
) {
throw new Error( 'Required option not specified properly' );
Function 6eeb
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var createNonEnumerableProperty = __webpack_require__("9112");
var has = __webpack_require__("5135");
Method rebuildItemTerms
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function rebuildItemTerms( DatabaseUpdater $updater ) {
$localEntitySourceName = WikibaseRepo::getSettings()->getSetting( 'localEntitySourceName' );
$itemSource = WikibaseRepo::getEntitySourceDefinitions()
->getDatabaseSourceForEntityType( 'item' );
if ( $itemSource === null || $itemSource->getSourceName() !== $localEntitySourceName ) {
Method getParser
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getParser(): ValueParser {
$params = $this->extractRequestParams();
$options = $this->getOptionsObject( $params['options'] );
Method execute
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $subPage ): void {
$this->setHeaders();
$this->outputHeader();
$this->getOutput()->addWikiMsg( 'wikibase-mylanguagefallbackchain-text' );
Method modifyEntity
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function modifyEntity( EntityDocument $entity, ChangeOp $changeOp, array $preparedParameters ): Summary {
$data = $preparedParameters[self::PARAM_DATA];
$exists = $this->entityExists( $entity->getId() );
Method onShowSearchHit
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function onShowSearchHit( $searchPage, $result,
$terms, &$link, &$redirect, &$section, &$extract, &$score, &$size, &$date, &$related,
&$html
): void {
if ( $result instanceof ExtendedResult ) {
Method newPlaceHolderEmittingEntityTermsView
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function newPlaceHolderEmittingEntityTermsView(
EntityDocument $entity,
Language $language,
TermLanguageFallbackChain $termFallbackChain
) {
Method __construct
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
parent::__construct();
$this->addDescription( 'Generate a ' . $this->getDumpType() . ' dump from entities in the repository.' );
Method throwUseCaseError
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function throwUseCaseError( ValidationError $validationError ): void {
$context = $validationError->getContext();
switch ( $validationError->getCode() ) {
case LanguageCodeValidator::CODE_INVALID_LANGUAGE_CODE:
throw UseCaseError::newPatchResultInvalidKey( '', $context[LanguageCodeValidator::CONTEXT_LANGUAGE_CODE] );
Method findActuallyUnusedTermInLangIds
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function findActuallyUnusedTermInLangIds( array $termInLangIds, IDatabase $dbw ) {
$unusedTermInLangIds = [];
foreach ( $termInLangIds as $termInLangId ) {
// Note: Not batching here is intentional to avoid deadlocks (see method comment)
$usedInProperties = $dbw->newSelectQueryBuilder()
Function validateBridgeApplicability
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public validateBridgeApplicability(
path: MainSnakPath,
): Promise<unknown> {
if ( this.state.applicationStatus === ApplicationStatus.SAVED ) {
// saving edits can transition us from applicable to inapplicable states, but that should not be an error