Showing 2,096 of 2,096 total issues
Similar blocks of code found in 4 locations. Consider refactoring. Open
public get dataValue() {
return ( pathToSnak: PathToSnak ): DataValue | null => {
const snak = pathToSnak.resolveSnakInStatement( this.state );
return snak?.datavalue ?? null;
};
- 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 62.
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 4 locations. Consider refactoring. Open
public get snakType() {
return ( pathToSnak: PathToSnak ): SnakType | null => {
const snak = pathToSnak.resolveSnakInStatement( this.state );
return snak?.snaktype ?? null;
};
- 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 62.
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
public constructor( mWHooks: HookRegistry, taintedChecker: TaintedChecker, statementTracker: StatementTracker ) {
this.mwHooks = mWHooks;
this.taintedChecker = taintedChecker;
this.statementTracker = statementTracker;
}
- 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 62.
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 4 locations. Consider refactoring. Open
public get rank() {
return ( pathToStatement: PathToStatement ): Rank | null => {
const statement = pathToStatement.resolveStatement( this.state );
return statement?.rank ?? null;
};
- 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 62.
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
Consider simplifying this complex logical expression. Open
if ( ( !structureEditorFactory || !structureEditorFactory.getAdder )
|| ( !messageProvider || !messageProvider.getMessage )
|| !Array.isArray( userLanguages )
|| ( vocabularyLookupApiUrl && typeof vocabularyLookupApiUrl !== 'string'
|| !commonsApiUrl )
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function getDescriptions( EntityId $entityId ): ?Descriptions {
try {
$descriptions = $this->termLookup->getDescriptions( $entityId, $this->termLanguages->getLanguages() );
} catch ( TermLookupException $e ) {
// this probably means that the entity does not exist, which should be checked prior to calling this method
- 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 107.
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
public function getLabels( EntityId $entityId ): ?Labels {
try {
$labels = $this->termLookup->getLabels( $entityId, $this->termLanguages->getLanguages() );
} catch ( TermLookupException $e ) {
// this probably means that the entity does not exist, which should be checked prior to calling this method
- 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 107.
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 _onSiteSelectorChangeHandler
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onSiteSelectorChangeHandler: function () {
var apiUrl,
$page = $( '#wbclient-linkItem-page' );
$page.val( '' );
Function WbListviewListItemAdapter
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var SELF = $.wikibase.listview.ListItemAdapter = function WbListviewListItemAdapter( options ) {
if ( typeof options.listItemWidget !== 'function'
|| !options.listItemWidget.prototype.widgetName
|| !options.listItemWidget.prototype.widgetEventPrefix
) {
Function value
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function ( value ) {
if ( value !== undefined ) {
this.option( 'value', value );
return;
}
Function fdbc
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
/***/ (function(module, exports) {
// iterable DOM collections
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
module.exports = {
Method doQuery
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doQuery( array $params ): ?IResultWrapper {
$pages = $this->getPageSet()->getGoodPages();
if ( !$pages ) {
return null;
}
Function actions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function actions(metricTracker) {
return {
[STORE_INIT](context, guids) {
context.commit(SET_ALL_UNTAINTED, guids);
context.commit(SET_ALL_POPPERS_HIDDEN, guids);
Method doWikibaseHandleChange
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doWikibaseHandleChange( Change $change ) {
if ( $this->sendEchoNotification !== true ) {
return false;
}
Method createSchema
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createSchema(
Title $title,
$revisionTimestamp,
$entityConceptUri,
File $imageFile = null,
Method rebuildPropertyTerms
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function rebuildPropertyTerms( DatabaseUpdater $updater ) {
$localEntitySourceName = WikibaseRepo::getSettings()->getSetting( 'localEntitySourceName' );
$propertySource = WikibaseRepo::getEntitySourceDefinitions()
->getDatabaseSourceForEntityType( 'property' );
if ( $propertySource === null || $propertySource->getSourceName() !== $localEntitySourceName ) {
Method getEntityIds
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getEntityIds( array $sites, array $titles, $normalize ) {
$ids = [];
$numSites = count( $sites );
$numTitles = count( $titles );
Method showQuery
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function showQuery( array $query = [], $subPage = false ) {
$paging = false;
$out = $this->getOutput();
if ( $this->limit == 0 && $this->offset == 0 ) {
Method execute
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute(): void {
$params = $this->extractRequestParams();
$user = $this->getUser();
$this->validateParameters( $params );
Method __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
parent::__construct();
$this->addDescription( 'Rebuilds item terms from primary persistence' );