Showing 11,545 of 11,545 total issues
Method getDescriptionSection
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getDescriptionSection() {
$config = $this->getConfig();
if ( $this->mSessionKey ) {
$stash = $this->localRepo->getUploadStash( $this->getUser() );
try {
Method showUploadWarning
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function showUploadWarning( $warnings ) {
# If there are no warnings, or warnings we can ignore, return early.
# mDestWarningAck is set when some javascript has shown the warning
# to the user. mForReUpload is set when the user clicks the "upload a
# new version" link.
Method addUserToGroup
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addUserToGroup(
UserIdentity $user,
string $group,
string $expiry = null,
bool $allowUpdate = false
Method execute
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$passwordFactory = $this->getServiceContainer()->getPasswordFactory();
$typeInfo = $passwordFactory->getTypes();
$layeredType = $this->getOption( 'type' );
Similar blocks of code found in 2 locations. Consider refactoring. Open
function minutesToHours( min ) {
const tzHour = Math.floor( Math.abs( min ) / 60 ),
tzMin = Math.abs( min ) % 60,
tzString = ( ( min >= 0 ) ? '' : '-' ) + ( ( tzHour < 10 ) ? '0' : '' ) + tzHour +
':' + ( ( tzMin < 10 ) ? '0' : '' ) + tzMin;
- 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 106.
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 minutesToHours( min ) {
const tzHour = Math.floor( Math.abs( min ) / 60 ),
tzMin = Math.abs( min ) % 60,
tzString = ( ( min >= 0 ) ? '' : '-' ) + ( ( tzHour < 10 ) ? '0' : '' ) + tzHour +
':' + ( ( tzMin < 10 ) ? '0' : '' ) + tzMin;
- 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 106.
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 ChronologyProtector.php
has 314 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
File BackupDumper.php
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Base classes for database-dumping maintenance scripts.
*
* Copyright © 2005 Brooke Vibber <bvibber@wikimedia.org>
Function init
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init() {
const conditionalViews = {},
$initialFieldset = $( 'fieldset.cloptions' ),
savedQueriesPreferenceName = mw.config.get( 'wgStructuredChangeFiltersSavedQueriesPreferenceName' ),
daysPreferenceName = mw.config.get( 'wgStructuredChangeFiltersDaysPreferenceName' ),
Method normalizeHandler
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function normalizeHandler( string $hook, $handler, array $options = [] ) {
if ( is_object( $handler ) && !$handler instanceof Closure ) {
$handler = [ $handler, $this->getHookMethodName( $hook ) ];
}
Method formatTimePeriod
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function formatTimePeriod( $seconds, $format = [] ) {
if ( !is_array( $format ) ) {
$format = [ 'avoid' => $format ]; // For backwards compatibility
}
if ( !isset( $format['avoid'] ) ) {
Method formatDiffRow2
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function formatDiffRow2(
$title, $oldid, $newid, $timestamp, $formattedComment, $actiontext = ''
) {
$feedDiffCutoff = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::FeedDiffCutoff );
Method extractRowInfo
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extractRowInfo( $row ) {
$logEntry = DatabaseLogEntry::newFromRow( $row );
$vals = [
ApiResult::META_TYPE => 'assoc',
];
Method execute
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$pages = $this->getPageSet()->getGoodPages();
if ( $pages === [] ) {
return;
}
Method execute
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$repo = $this->getServiceContainer()->getRepoGroup()->getLocalRepo();
$tempRepo = $repo->getTempRepo();
$dbr = $repo->getReplicaDB();
Method execute
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
// Extensions will do stuff like $wgResourceModules += array(...) which is a
// fatal unless an array is already set. So set an empty value.
// And use the weird $__settings name to avoid any conflicts
// with real poorly named settings.
File IcuCollation.php
has 313 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
File MessagesRu.php
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** Russian (русский)
*
* @file
* @ingroup Languages
File MessagesNl.php
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** Dutch (Nederlands)
*
* @file
* @ingroup Languages
util
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
const util = {
/**
* Encode the string like PHP's rawurlencode.
*