Showing 11,545 of 11,545 total issues
Method addParserOutputMetadata
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addParserOutputMetadata( ParserOutput $parserOutput ) {
// T301020 This should eventually use the standard "merge ParserOutput"
// function between $parserOutput and $this->metadata.
$this->addLanguageLinks( $parserOutput->getLanguageLinks() );
$this->addCategoryLinks( $parserOutput->getCategoryMap() );
File MessagesBn.php
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** Bengali (বাংলা)
*
* @file
* @ingroup Languages
File MessagesEs.php
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** Spanish (español)
*
* @file
* @ingroup Languages
Method execute
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$doDelete = $this->hasOption( 'delete' );
$doDeleteTalk = $this->hasOption( 'delete-talk' );
$langCode = $this->getOption( 'lang-code' );
Method doDBUpdates
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function doDBUpdates() {
$mode = $this->getOption( 'mode', 'both' );
$begin = $this->getOption( 'begin', '' );
$throttle = $this->getOption( 'throttle', 0 );
Function checkCascadingSourcesRestrictions
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function checkCascadingSourcesRestrictions(
$action,
UserIdentity $user,
PermissionStatus $status,
$rigor,
- 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 getSessionInfoForRequest
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function getSessionInfoForRequest( WebRequest $request ) {
// Call all providers to fetch "the" session
$infos = [];
foreach ( $this->getProviders() as $provider ) {
$info = $provider->provideSessionInfo( $request );
- 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 view
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function view() {
$context = $this->getContext();
$showEXIF = $context->getConfig()->get( MainConfigNames::ShowEXIF );
// For action=render, include body text only; none of the image extras
- 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 run
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function run( $action, $module ) {
$actions = [ 'update', 'verify', 'make-sri', 'make-cdx' ];
if ( !in_array( $action, $actions ) ) {
$this->error( "Invalid action.\n\nMust be one of " . implode( ', ', $actions ) . '.' );
return false;
- 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 providerAllowsAuthenticationDataChange
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function providerAllowsAuthenticationDataChange(
AuthenticationRequest $req, $checkData = true
) {
if ( get_class( $req ) !== TemporaryPasswordAuthenticationRequest::class ) {
// We don't really ignore it, but this is what the caller expects.
- 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 getDirListPageInternal
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function getDirListPageInternal( $fullCont, $dir, &$after, $limit, array $params ) {
$dirs = [];
if ( $after === INF ) {
return $dirs; // nothing more
}
- 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 freeLocksOnServer
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function freeLocksOnServer( $lockSrv, array $pathsByType ) {
$status = StatusValue::newGood();
$memc = $this->getCache( $lockSrv );
// List of affected paths
- 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 validateCookieDomain
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public static function validateCookieDomain( $domain, $originDomain = null ) {
$dc = explode( ".", $domain );
// Don't allow a trailing dot or addresses without a or just a leading dot
if ( substr( $domain, -1 ) == '.' ||
- 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 _load_items
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function _load_items( $sock, &$ret, &$casToken = null ) {
$results = array();
while ( 1 ) {
$decl = $this->_fgets( $sock );
- 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 parseMimeInfo
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function parseMimeInfo( string $rawMimeInfo ): void {
$rawMimeInfo = str_replace( [ "\r\n", "\n\r", "\n\n", "\r\r", "\r" ], "\n", $rawMimeInfo );
$rawMimeInfo = str_replace( "\t", " ", $rawMimeInfo );
$lines = explode( "\n", $rawMimeInfo );
- 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 loadDataFromRequest
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function loadDataFromRequest( $request ) {
// It's possible that this might be posted with no fields. Detect that
// by looking for an edit token.
if ( !$request->getCheck( 'wpEditToken' ) && $request->getArray( $this->mName ) === null ) {
return $this->getDefault();
- 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 getContributors
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function getContributors( $cnt, $showIfMax ) {
$contributors = $this->getWikiPage()->getContributors();
$others_link = false;
- 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 getMessageForLang
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function getMessageForLang( $lang, $lckey, $useDB, &$alreadyTried ) {
$langcode = $lang->getCode();
// Try checking the database for the requested language
if ( $useDB ) {
- 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 applyDefaultConfig
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function applyDefaultConfig( array $lbConf ): array {
$this->options->assertRequiredOptions( self::APPLY_DEFAULT_CONFIG_OPTIONS );
$typesWithSchema = self::getDbTypesWithSchemas();
if ( Profiler::instance() instanceof ProfilerStub ) {
- 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 parseFlags
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function parseFlags() {
$text = $this->mText;
$flags = [];
$variantFlags = [];
- 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"