Showing 11,545 of 11,545 total issues
Function execute
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$params = $this->extractRequestParams();
$authority = $this->getAuthority();
// make sure the user is allowed
- 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 __construct
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiQuery $query,
$moduleName,
RevisionStore $revisionStore,
IContentHandlerFactory $contentHandlerFactory,
ParserFactory $parserFactory,
Function modifyBlobs
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function modifyBlobs(
callable $tableWriteCallback,
float $mtime,
array $argsByKey,
&$resByKey = []
- 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 setParameter
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function setParameter( $par ) {
// Extract variables from the request. Try not to get into a situation where we
// need to extract *every* variable from the form just for processing here, but
// there are legitimate uses for some variables
$request = $this->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 makeLines
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function makeLines() {
$levels = [];
$lines = explode( "\n", $this->msg );
foreach ( $lines as $line ) {
- 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 getDescriptionSection
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function getDescriptionSection() {
$config = $this->getConfig();
if ( $this->mSessionKey ) {
$stash = $this->localRepo->getUploadStash( $this->getUser() );
try {
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->useTransactionalTimeLimit();
$this->setHeaders();
$this->outputHeader();
- 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 getExceptionList
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function getExceptionList() {
if ( $this->exceptionList === null ) {
$this->exceptionList = [];
$exList = $this->msg( 'uncategorized-categories-exceptionlist' )
->inContentLanguage()->plain();
- 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 __construct
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
MovePageFactory $movePageFactory,
PermissionManager $permManager,
UserOptionsLookup $userOptionsLookup,
IConnectionProvider $dbProvider,
IContentHandlerFactory $contentHandlerFactory,
Method __construct
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
IContextSource $context,
CommentStore $commentStore,
LinkBatchFactory $linkBatchFactory,
LinkRenderer $linkRenderer,
IConnectionProvider $dbProvider,
Function userToolLinkArray
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function userToolLinkArray(
$userId, $userText, $redContribsWhenNoEdits = false, $flags = 0, $edits = null
): array {
$services = MediaWikiServices::getInstance();
$disableAnonTalk = $services->getMainConfig()->get( MainConfigNames::DisableAnonTalk );
- 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 titleAttrib
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function titleAttrib( $name, $options = null, array $msgParams = [], $localizer = null ) {
if ( !$localizer ) {
$localizer = self::getContextFromMain();
}
$message = $localizer->msg( "tooltip-$name", $msgParams );
- 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 getImageLinkMTOParams
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function getImageLinkMTOParams( $frameParams, $query = '', $parser = null ) {
$mtoParams = [];
if ( isset( $frameParams['link-url'] ) && $frameParams['link-url'] !== '' ) {
$mtoParams['custom-url-link'] = $frameParams['link-url'];
if ( isset( $frameParams['link-target'] ) ) {
- 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 notifyUpdatesForRevision
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function notifyUpdatesForRevision(
LBFactory $lbFactory, WikiPage $page, RevisionRecord $newRev
) {
$title = $page->getTitle();
- 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 tagObj
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function tagObj( $parser, $frame, $args ) {
if ( !count( $args ) ) {
return '';
}
$tagName = strtolower( trim( $frame->expand( array_shift( $args ) ) ) );
- 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 getUserSig
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getUserSig( UserIdentity $user, $nickname = false, $fancySig = null ) {
$username = $user->getName();
# If not given, retrieve from the user object.
if ( $nickname === 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 getQueryInfo
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getQueryInfo() {
$queryBuilder = DatabaseLogEntry::newSelectQueryBuilder( $this->mDb )
->where( $this->mConds );
# Add log_search table if there are conditions on it.
- 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 getExistsWarning
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function getExistsWarning( $file ) {
if ( $file->exists() ) {
return [ 'warning' => 'exists', 'file' => $file ];
}
- 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 getParametersForApi
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function getParametersForApi() {
$entry = $this->entry;
$params = $entry->getParameters();
static $map = [
- 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 publish
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function publish( $newId, $to = 'rcandudp' ) {
$canAddTags = true;
// FIXME: this code should be removed once all callers properly call publish()
if ( $to === 'udp' && !$newId && !$this->getAssociatedRevId() ) {
\MediaWiki\Logger\LoggerFactory::getInstance( 'logging' )->warning(
- 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"