Showing 11,545 of 11,545 total issues
Method transformGd
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function transformGd( $image, $params ) {
# Use PHP's builtin GD library functions.
# First find out what kind of file this is, and select the correct
# input routine for this.
Method loadRequest
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function loadRequest( $par ) {
$request = $this->getRequest();
$user = $this->getUser();
$this->mAction = $request->getRawVal( 'action' );
Method checkLastModified
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkLastModified( $timestamp ) {
if ( !$timestamp || $timestamp == '19700101000000' ) {
wfDebug( __METHOD__ . ': CACHE DISABLED, NO TIMESTAMP' );
return false;
}
Method showOptions
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showOptions( $type = '', $year = 0, $month = 0, $day = 0 ) {
$formDescriptor = [];
// Basic selectors
$formDescriptor['type'] = $this->getTypeMenuDesc();
Method execute
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$repo = $this->file->repo;
$status = $repo->newGood();
$status->merge( $this->acquireSourceLock() );
Method execute
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$lang = $this->getServiceContainer()->getLanguageFactory()->getLanguage( 'en' );
$title = Title::newFromText( $this->getArg( 0 ) );
if ( $this->hasOption( 'start' ) ) {
Method execute
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$pages = $this->getOption( 'maxpages' );
$dbr = $this->getReplicaDB();
Method execute
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$userName = $this->getOption( 'user', false );
$summary = $this->getOption( 'summary', '' );
$remove = $this->hasOption( 'remove' );
$minor = $this->hasOption( 'minor' );
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( $this->isStructuredFilterUiEnabled() ) {
$rcfilterContainer = Html::element(
'div',
[ 'class' => 'mw-rcfilters-container' ]
);
- 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 135.
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->isStructuredFilterUiEnabled() ) {
$rcfilterContainer = Html::element(
'div',
[ 'class' => 'mw-rcfilters-container' ]
);
- 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 135.
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
File ApiQueryUsers.php
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Copyright © 2007 Roan Kattouw <roan.kattouw@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
Consider simplifying this complex logical expression. Open
if (a && getParsingFlags(m).overflow === -2) {
overflow =
a[MONTH] < 0 || a[MONTH] > 11
? MONTH
: a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
DeletePage
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class DeletePage {
/**
* @internal For use by PageCommandFactory
*/
public const CONSTRUCTOR_OPTIONS = [
XmlDumpWriter
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class XmlDumpWriter {
/** Output serialized revision content. */
public const WRITE_CONTENT = 0;
GlobalIdGenerator
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class GlobalIdGenerator {
/** @var callable Callback for running shell commands */
protected $shellCallback;
/** @var string Temporary directory */
ImageGalleryBase
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class ImageGalleryBase extends ContextSource {
public const LOADING_DEFAULT = 1;
public const LOADING_LAZY = 2;
/**
SiteList
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class SiteList extends ArrayObject {
/**
* @see SiteList::getNewOffset()
* @since 1.20
* @var int
FormatMetadata
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class FormatMetadata extends ContextSource {
use ProtectedHookAccessorTrait;
/**
* Only output a single language for multi-language fields
Consider simplifying this complex logical expression. Open
if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
|| ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
|| ( isset( $show['autopatrolled'] ) && isset( $show['!autopatrolled'] ) )
|| ( isset( $show['autopatrolled'] ) && isset( $show['!patrolled'] ) )
|| ( isset( $show['top'] ) && isset( $show['!top'] ) )
DerivativeContext
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class DerivativeContext extends ContextSource implements MutableContext {
/**
* @var WebRequest
*/
private $request;