Showing 11,545 of 11,545 total issues
Function groupCheckboxes
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
private function groupCheckboxes( $usergroups, UserIdentity $user ) {
$allgroups = $this->userGroupManager->listAllGroups();
$ret = '';
// Get the list of preset expiry times from the system message
- 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 dump
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
var dump = (function () {
function quote(str) {
return '"' + str.toString().replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"';
}
function literal(o) {
File FilterTagMultiselectWidget.js
has 521 lines of code (exceeds 250 allowed). Consider refactoring. Open
const ViewSwitchWidget = require( './ViewSwitchWidget.js' ),
SaveFiltersPopupButtonWidget = require( './SaveFiltersPopupButtonWidget.js' ),
MenuSelectWidget = require( './MenuSelectWidget.js' ),
FilterTagItemWidget = require( './FilterTagItemWidget.js' );
HTMLFormField
has 59 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class HTMLFormField {
/** @var array|array[] */
public $mParams;
/** @var callable(mixed,array,HTMLForm):(StatusValue|string|bool|Message) */
ContentHandler
has 59 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class ContentHandler {
use ProtectedHookAccessorTrait;
/**
* Convenience function for getting flat text from a Content object. This
Function initialize
has 212 lines of code (exceeds 25 allowed). Consider refactoring. Open
Controller.prototype.initialize = function ( filterStructure, namespaceStructure, tagList, conditionalViews ) {
const displayConfig = mw.config.get( 'StructuredChangeFiltersDisplayConfig' ),
defaultSavedQueryExists = mw.config.get( 'wgStructuredChangeFiltersDefaultSavedQueryExists' ),
controller = this,
views = $.extend( true, {}, conditionalViews ),
Function run
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
private function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
$namespaces = $this->getPageSet()->getGoodAndMissingTitlesByNamespace();
if ( empty( $namespaces[NS_FILE] ) ) {
return;
- 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 populateGeneratorData
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
public function populateGeneratorData( &$result, array $path = [] ) {
if ( $result instanceof ApiResult ) {
$data = $result->getResultData( $path );
if ( $data === null ) {
return true;
- 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 compressWithConcat
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function compressWithConcat( $startId, $maxChunkSize, $beginDate,
$endDate, $extdb = "", $maxPageId = false
) {
$dbr = $this->getReplicaDB();
$dbw = $this->getPrimaryDB();
File fetch.umd.js
has 515 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.WHATWGFetch = {})));
}(this, (function (exports) { 'use strict';
File AuthManagerSpecialPage.php
has 515 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MediaWiki\SpecialPage;
use ErrorPageError;
File MessagesEn.php
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This is the default English localisation file containing language specific
* information excluding interface strings, which are stored in JSON files.
*
Method execute
has 208 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->setHeaders();
$this->outputHeader();
$this->checkPermissions();
$out = $this->getOutput();
File uppercaseTitlesForUnicodeTransition.php
has 513 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Obligatory redundant license notice. Exception to the GPL's "keep intact all
* the notices" clause with respect to this notice is hereby granted.
*
Similar blocks of code found in 2 locations. Consider refactoring. Open
'messages' => [
'rcfilters-tag-remove',
'rcfilters-activefilters',
'rcfilters-activefilters-hide',
'rcfilters-activefilters-show',
- 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 251.
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
protected function getFunctionReport() {
$data = $this->getFunctionStats();
usort( $data, static function ( $a, $b ) {
return $b['real'] <=> $a['real']; // descending
} );
- 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 251.
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
private array $mVariableIDs = [
'!',
'=',
'currentmonth',
'currentmonth1',
- 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 251.
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
protected function getFunctionReport() {
$data = $this->getFunctionStats();
usort( $data, static function ( $a, $b ) {
return $b['real'] <=> $a['real']; // descending
} );
- 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 251.
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
Method finalizeHeadings
has 207 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function finalizeHeadings( $text, $origText, $isMain = true ) {
# Inhibit editsection links if requested in the page
if ( isset( $this->mDoubleUnderscores['noeditsection'] ) ) {
$maybeShowEditLink = false;
} else {
File LogEventsList.php
has 511 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Contain classes to list log entries
*
* Copyright © 2004 Brooke Vibber <bvibber@wikimedia.org>