Showing 11,545 of 11,545 total issues
Method selectSQLText
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function selectSQLText(
$tables, $vars, $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
) {
if ( !is_array( $tables ) ) {
if ( $tables === '' || $tables === null || $tables === false ) {
Method makeCSPDirectives
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function makeCSPDirectives( $policyConfig, $mode ) {
if ( $policyConfig === false ) {
// CSP is disabled
return '';
}
Method recXmlPrint
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function recXmlPrint( $name, $value, $indent, $attributes = [] ) {
$retval = '';
if ( $indent !== null ) {
if ( $name !== null ) {
$indent += 2;
Method output
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function output( $return = false ) {
if ( $this->mDoNothing ) {
return $return ? '' : null;
}
Method doVariants
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function doVariants( &$classes ) {
$linkBatchFactory = MediaWikiServices::getInstance()->getLinkBatchFactory();
$linkBatch = $linkBatchFactory->newLinkBatch();
$variantMap = []; // maps $pdbkey_Variant => $keys (of link holders)
$output = $this->parent->getOutput();
Method save
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save( $send = self::SEND_FEED ) {
$services = MediaWikiServices::getInstance();
$mainConfig = $services->getMainConfig();
$putIPinRC = $mainConfig->get( MainConfigNames::PutIPinRC );
$dbw = $services->getConnectionProvider()->getPrimaryDatabase();
Method execute
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$services = $this->getServiceContainer();
$userFactory = $services->getUserFactory();
$userGroupManager = $services->getUserGroupManager();
$this->output( "Remove unused accounts\n\n" );
File ApiQuerySearch.php
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Copyright © 2007 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
File SpecialBotPasswords.php
has 348 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
Similar blocks of code found in 2 locations. Consider refactoring. Open
function to(time, withoutSuffix) {
if (
this.isValid() &&
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
) {
- 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
OO.ui.mixin.FloatableElement.prototype.setVerticalPosition = function ( position ) {
if ( [ 'below', 'above', 'top', 'bottom', 'center' ].indexOf( position ) === -1 ) {
throw new Error( 'Invalid value for vertical position: ' + position );
}
if ( this.verticalPosition !== position ) {
- 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
function from(time, withoutSuffix) {
if (
this.isValid() &&
((isMoment(time) && time.isValid()) || createLocal(time).isValid())
) {
- 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
OO.ui.mixin.FloatableElement.prototype.setHorizontalPosition = function ( position ) {
if ( [ 'before', 'after', 'start', 'end', 'center' ].indexOf( position ) === -1 ) {
throw new Error( 'Invalid value for horizontal position: ' + position );
}
if ( this.horizontalPosition !== position ) {
- 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
NamespaceInfo
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class NamespaceInfo {
/**
* These namespaces should always be first-letter capitalized, now and
* forevermore. Historically, they could've probably been lowercased too,
JobQueueDB
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class JobQueueDB extends JobQueue {
/* seconds to cache info without re-validating */
private const CACHE_TTL_SHORT = 30;
/* seconds a job can live once claimed */
private const MAX_AGE_PRUNE = 7 * 24 * 3600;
ArchivedFile
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class ArchivedFile {
// Audience options for ::getDescription() and ::getUploader()
public const FOR_PUBLIC = 1;
public const FOR_THIS_USER = 2;
MaintenanceParameters
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class MaintenanceParameters {
/**
* Array of desired/allowed params
* @var array<string,array>
Method moveUnsafe
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function moveUnsafe( UserIdentity $user, $reason, $createRedirect, array $changeTags ) {
$status = Status::newGood();
// TODO: make hooks accept UserIdentity
$userObj = $this->userFactory->newFromUserIdentity( $user );
Method showPatrolFooter
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showPatrolFooter() {
$context = $this->getContext();
$mainConfig = $context->getConfig();
$useNPPatrol = $mainConfig->get( MainConfigNames::UseNPPatrol );
$useRCPatrol = $mainConfig->get( MainConfigNames::UseRCPatrol );
Method dumpPages
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function dumpPages( $cond, $orderRevs ) {
$revQuery = $this->revisionStore->getQueryInfo( [ 'page' ] );
$slotQuery = $this->revisionStore->getSlotsQueryInfo( [ 'content' ] );
// We want page primary rather than revision.