Showing 11,545 of 11,545 total issues
Identical blocks of code found in 2 locations. Consider refactoring. Open
public function __construct( StatsStore $store, $specs, $prefix ) {
$this->store = $store;
$this->metricSpecs = [];
foreach ( $specs as $name => $spec ) {
$this->metricSpecs[$name] = new MetricSpec( $spec );
- 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 122.
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 const APPLY_DEFAULT_CONFIG_OPTIONS = [
MainConfigNames::DBcompress,
MainConfigNames::DBDefaultGroup,
MainConfigNames::DBmwschema,
MainConfigNames::DBname,
- 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 122.
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
return [
self::NO_GALLERY,
self::ENABLE_OOUI,
self::INDEX_POLICY,
self::NO_INDEX_POLICY,
- 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 122.
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 highlight
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function highlight( context, $result, updateTextbox ) {
const $selected = context.data.$container.find( '.suggestions-result-current' );
if ( !$result.get || $selected.get( 0 ) !== $result.get( 0 ) ) {
if ( $result === 'prev' ) {
// eslint-disable-next-line no-jquery/no-class-state
Function textSelection
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.textSelection = function ( command, commandOptions ) {
const alternateFn = $( this ).data( 'jquery.textSelection' );
// Prevent values of `undefined` overwriting defaults (T368102)
for ( const key in commandOptions ) {
Function onModelInitialize
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
ChangesLimitAndDateButtonWidget.prototype.onModelInitialize = function () {
const displayGroupModel = this.model.getGroup( 'display' );
this.limitGroupModel = this.model.getGroup( 'limit' );
this.groupByPageItemModel = displayGroupModel.getItemByParamName( 'enhanced' );
Function runScript
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
var runScript = function () {
$CODE.profileScriptStart();
var script = registry[ module ].script;
var markModuleReady = function () {
$CODE.profileScriptEnd();
Function translate
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's': // a few seconds / in a few seconds / a few seconds ago
return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami';
Function translate
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's': // a few seconds / in a few seconds / a few seconds ago
return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';
Function buildFragment
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildFragment( elems, context, scripts, selection, ignored ) {
var elem, tmp, tag, wrap, attached, j,
fragment = context.createDocumentFragment(),
nodes = [],
i = 0,
Function _setOption
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setOption: function( key, value ) {
var isDraggable, isResizable,
uiDialog = this.uiDialog;
switch ( key ) {
Method addComponentFiles
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addComponentFiles( Context $context ) {
$codexFiles = $this->getCodexFiles( $context );
$requestedFiles = array_map( static function ( $component ) use ( $codexFiles ) {
if ( !isset( $codexFiles[ 'components' ][ $component ] ) ) {
Method addUserWarnings
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addUserWarnings(
IntroMessageList $messages,
MessageLocalizer $localizer,
Title $title,
Authority $performer
Method addHeader
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addHeader( $diff, $otitle, $ntitle, $multi = '', $notice = '' ) {
// shared.css sets diff in interface language/dir, but the actual content
// is often in a different language, mostly the page content language/dir
$header = Html::openElement( 'table', [
'class' => [
Method getKnownCurrentRevision
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getKnownCurrentRevision( PageIdentity $page, $revId = 0 ) {
$db = $this->getReplicaConnection();
$revIdPassed = $revId;
$pageId = $this->getArticleId( $page );
if ( !$pageId ) {
Method normalizeRequests
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function normalizeRequests( array &$reqs ) {
foreach ( $reqs as &$req ) {
$req['response'] = [
'code' => 0,
'reason' => '',
Method get_multi
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get_multi( $keys ) {
$this->_last_cmd_status = self::ERR_NONE;
if ( !$this->_active ) {
$this->_last_cmd_status = self::ERR_UNEXPECTED;
Method duplicateTableStructure
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function duplicateTableStructure(
$oldName, $newName, $temporary = false, $fname = __METHOD__
) {
$newNameE = $this->platform->addIdentifierQuotes( $newName );
$oldNameE = $this->platform->addIdentifierQuotes( $oldName );
Method __construct
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct( array $params ) {
$this->logger = $params['logger'] ?? new NullLogger();
$this->transactionManager = new TransactionManager(
$this->logger,
$params['trxProfiler']
Method transactionWritingOut
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function transactionWritingOut(
$server,
$db,
string $id,
float $writeTime,