Showing 9,462 of 11,498 total issues
Function getNamespaceKeyAndText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getNamespaceKeyAndText( $ns, $text ) {
if ( $text == '' ) {
# shortcut for common case
return [ $ns, '', '' ];
}
- 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 getMoveStatusHtml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getMoveStatusHtml( Status $status, Title $oldTitle, Title $newTitle ) {
$linkRenderer = $this->getLinkRenderer();
if ( $status->hasMessage( 'articleexists' ) || $status->hasMessage( 'redirectexists' ) ) {
$link = $linkRenderer->makeKnownLink( $newTitle );
return Html::rawElement(
- 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 getWatchCheck
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getWatchCheck() {
$user = $this->getUser();
if ( $this->userOptionsLookup->getBoolOption( $user, 'watchdefault' ) ) {
// Watch all edits!
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
Function showList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function showList( BlockListPager $pager ) {
$out = $this->getOutput();
# Check for other blocks, i.e. global/tor blocks
$otherAutoblockLink = [];
- 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 saveNamespaces
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function saveNamespaces() {
$user = $this->getUser();
$request = $this->getRequest();
if ( $user->isRegistered() &&
- 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 filterDataForSubmit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function filterDataForSubmit( $data ) {
foreach ( $this->mFlatFields as $fieldname => $field ) {
if ( $field instanceof HTMLNestedFilterable ) {
$info = $field->mParams;
$prefix = $info['prefix'] ?? $fieldname;
- 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 getCellAttrs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getCellAttrs( $field, $value ) {
$attr = [];
if ( $field === 'am_title' ) {
if ( $this->mCurrentRow->am_customised ) {
$attr += [ 'rowspan' => '2' ];
- 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 getFormFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getFormFields() {
$config = $this->getConfig();
$fields = [];
if ( !$config->get( MainConfigNames::EnableUserEmail ) ) {
- 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 getPageHeader
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPageHeader() {
$self = explode( '/', $this->getTitle()->getPrefixedDBkey(), 2 )[0];
$groupOptions = [ $this->msg( 'group-all' )->text() => '' ];
foreach ( $this->getAllGroups() as $group => $groupText ) {
- 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 __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(
IContextSource $context,
Language $contentLanguage,
LanguageFactory $languageFactory,
LinkRenderer $linkRenderer,
- 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 parseParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function parseParams( string $par ) {
# Get parameters
$parms = explode( '/', $par, 2 );
$symsForAll = [ '*', 'all' ];
if ( $parms[0] !== '' &&
- 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 formatRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function formatRow( $row ) {
$userName = $row->user_name;
$ulinks = Linker::userLink( $row->user_id, $userName );
$ulinks .= Linker::userToolLinks(
- 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 doBatchLookups
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function doBatchLookups( $list ) {
$batch = $this->linkBatchFactory->newLinkBatch();
foreach ( $list as $file ) {
$batch->addObj( $file->getTitle() );
if ( $file->isLocal() ) {
- 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 showActivateDeactivateForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function showActivateDeactivateForm( $tag, $activate ) {
$actionStr = $activate ? 'activate' : 'deactivate';
$authority = $this->getAuthority();
if ( !$authority->isAllowed( 'managechangetags' ) ) {
- 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 getQueryInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getQueryInfo() {
$dbr = $this->getDatabaseProvider()->getReplicaDatabase();
$field = 'el_to_domain_index';
$extraFields = [
- 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 showList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function showList( $isbn ) {
$out = $this->getOutput();
$isbn = self::cleanIsbn( $isbn );
# Hook to allow extensions to insert additional HTML,
- 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 getIntroText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getIntroText() {
$days = $this->getConfig()->get( MainConfigNames::ActiveUserDays );
$intro = $this->msg( 'activeusers-intro' )->numParams( $days )->parse();
- 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 getPagingQueries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPagingQueries() {
$queries = parent::getPagingQueries();
if ( $this->mUserName !== null ) {
# Append the username to the query string
foreach ( $queries as &$query ) {
- 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 accesskey
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function accesskey( $name, $localizer = null ) {
if ( !isset( self::$accesskeycache[$name] ) ) {
if ( !$localizer ) {
$localizer = self::getContextFromMain();
}
- 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 logException
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function logException(
Throwable $e,
$catcher = self::CAUGHT_BY_OTHER,
$extraData = []
) {
- 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"