Showing 11,461 of 11,461 total issues
Method loadRegs
has 311 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function loadRegs() {
// Regexes as keys need to be declared in a function.
$this->Cyrl2LatnRegexes = [
# относятся ко всему слову
# whole words
File DatabaseUpdater.php
has 685 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* DBMS-specific updater helper.
*
* This program is free software; you can redistribute it and/or modify
Function compressWithConcat
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
private function compressWithConcat( $startId, $maxChunkSize, $beginDate,
$endDate, $extdb = "", $maxPageId = false
) {
$dbr = $this->getReplicaDB();
$dbw = $this->getPrimaryDB();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method braceSubstitution
has 310 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function braceSubstitution( array $piece, PPFrame $frame ) {
// Flags
// $text has been filled
$found = false;
LoadBalancer
has 82 functions (exceeds 20 allowed). Consider refactoring. Open
class LoadBalancer implements ILoadBalancerForOwner {
/** @var ILoadMonitor */
private $loadMonitor;
/** @var BagOStuff */
private $srvCache;
File WebInstaller.php
has 680 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Core installer web interface.
*
* This program is free software; you can redistribute it and/or modify
Similar blocks of code found in 2 locations. Consider refactoring. Open
var mapActions = normalizeNamespace(function (namespace, actions) {
var res = {};
if (!isValidMap(actions)) {
console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
}
- 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 281.
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
var mapMutations = normalizeNamespace(function (namespace, mutations) {
var res = {};
if (!isValidMap(mutations)) {
console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
}
- 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 281.
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 Message.php
has 679 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
Function getContentObject
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
protected function getContentObject( $def_content = null ) {
$services = MediaWikiServices::getInstance();
$disableAnonTalk = $services->getMainConfig()->get( MainConfigNames::DisableAnonTalk );
$request = $this->context->getRequest();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function execute
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$user = $this->getUser();
$db = $this->getDB();
$params = $this->extractRequestParams();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function doSubmit
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
private function doSubmit() {
$user = $this->getUser();
if ( $user->pingLimiter( 'move' ) ) {
throw new ThrottledError;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File ExtensionProcessor.php
has 677 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use MediaWiki\MainConfigNames;
use MediaWiki\ResourceLoader\FilePath;
File jquery.ui.dialog.js
has 676 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* jQuery UI Dialog 1.9.2
* http://jqueryui.com
*
* Copyright 2012 jQuery Foundation and other contributors
File CrhExceptions.php
has 676 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MediaWiki\Languages\Data;
use CrhConverter as Crh;
Identical blocks of code found in 2 locations. Consider refactoring. Open
public static function listDropdownOptions( $list, $params = [] ) {
$options = [];
if ( isset( $params['other'] ) ) {
$options[ $params['other'] ] = 'other';
- 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 332.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
public static function listDropdownOptions( $list, $params = [] ) {
$options = [];
if ( isset( $params['other'] ) ) {
$options[ $params['other'] ] = 'other';
- 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 332.
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
FileBackend
has 81 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class FileBackend implements LoggerAwareInterface {
/** @var string Unique backend name */
protected $name;
/** @var string Unique domain name */
Function internalAttemptSave
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
public function internalAttemptSave( &$result, $markAsBot = false, $markAsMinor = false ) {
// If an attempt to acquire a temporary name failed, don't attempt to do anything else.
if ( $this->unableToAcquireTempName ) {
$status = Status::newFatal( 'temp-user-unable-to-acquire' );
$status->value = self::AS_UNABLE_TO_ACQUIRE_TEMP_ACCOUNT;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function doQuotes
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
public function doQuotes( $text ) {
$arr = preg_split( "/(''+)/", $text, -1, PREG_SPLIT_DELIM_CAPTURE );
$countarr = count( $arr );
if ( $countarr == 1 ) {
return $text;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"