Showing 2,096 of 2,096 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php declare( strict_types=1 );
namespace Wikibase\Repo\RestApi\Domain\ReadModel;
use Wikibase\DataModel\Term\Term;
- 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 104.
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 getDeletionUpdates( Title $title, $role ) {
$updates = parent::getDeletionUpdates( $title, $role );
$id = $this->getIdForTitle( $title );
- 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 104.
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 getDeletionUpdates( Title $title, $role ) {
$updates = parent::getDeletionUpdates( $title, $role );
$id = $this->getIdForTitle( $title );
- 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 104.
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\RestApi\Domain\ReadModel;
use Wikibase\DataModel\Term\Term;
- 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 104.
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 attachCopyrightTooltip
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function attachCopyrightTooltip( $entityview, viewName ) {
var startEditingEvents = [
'entitytermsviewafterstartediting',
'sitelinkgroupviewafterstartediting',
'statementviewafterstartediting'
Function value
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function ( value ) {
if ( value !== undefined ) {
return this.option( 'value', value );
}
Function stopEditing
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
SELF.prototype.stopEditing = function ( dropValue ) {
if ( !dropValue && !this._viewHasSavableValue() ) {
return;
}
Function _createHelperTag
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createHelperTag: function () {
var $tag = this.createTag( '', '', true ),
input = $tag.find( 'input' );
// Add placeholder and auto-expand afterwards:
Method getSiteLinkAddRemoveParams
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getSiteLinkAddRemoveParams( DiffOp $diffOp, $action, $siteId, Title $title = null ) {
$params = [];
if ( in_array( $action, [ 'remove', 'restore' ] ) ) {
// Messages: wikibase-comment-remove, wikibase-comment-restore
Function commit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Store.prototype.commit = function commit (_type, _payload, _options) {
var this$1$1 = this;
// check object-style commit
var ref = unifyObjectStyle(_type, _payload, _options);
Method getRecentChangeId
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRecentChangeId( RecentChange $change ) {
$attribs = $change->getAttributes();
//XXX: need to check master?
$db = $this->connectionManager->getReadConnection();
Function ddb0
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var DOMIterables = __webpack_require__("fdbc");
var ArrayIteratorMethods = __webpack_require__("e260");
Function main
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function main() {
const client = new ApolloClient( {
uri: 'https://api.github.com/graphql',
request: ( operation ) => {
operation.setContext( {
Function buildSizeDeltaAnnotation
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildSizeDeltaAnnotation( revision ) {
if ( revision[ CUSTOM_FIELDS.PREVIOUS_SIZE ] === null || revision[ FIELDS.SIZE ] === null ) {
// inception & removal may be a notable but not with respect to size
return null;
}
Method newRendererFromParser
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function newRendererFromParser(
Parser $parser,
string $type = DataAccessSnakFormatterFactory::TYPE_ESCAPED_PLAINTEXT
): StatementGroupRenderer {
$usageAccumulator = $this->usageAccumulatorFactory->newFromParser( $parser );
Method getSecondaryLinks
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSecondaryLinks() {
$ret = [];
if ( $this->getBundleCount( true, [ $this, 'callbackForBundleCount' ] ) === 1 ) {
$ret[] = $this->getAgentLink();
Method fetchIds
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fetchIds( $limit ) {
Assert::parameter( is_int( $limit ) && $limit > 0, '$limit', '$limit must be a positive integer' );
$dbr = $this->db->connections()->getReadConnection();
$queryBuilder = $dbr->newSelectQueryBuilder();
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $subPage ) {
parent::execute( $subPage );
$this->checkPermissions();
$this->checkBlocked();
Method applyChangeOp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function applyChangeOp( ChangeOp $changeOp, EntityDocument $entity, Summary $summary = null ): ChangeOpResult {
try {
// NOTE: Always validate modification against the current revision, if it exists!
// Otherwise, we may miss e.g. a combination of language/label/description
// that was already taken.
Method getAllowedParams
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAllowedParams(): array {
return [
'generate' => [
ParamValidator::PARAM_TYPE => [
SnakFormatter::FORMAT_PLAIN,