Showing 1,238 of 1,238 total issues
Function onTitleGetEditNotices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function onTitleGetEditNotices( Title $title, int $oldid, array &$notices ) {
if ( TranslatablePage::isSourcePage( $title ) ) {
$msg = wfMessage( 'translate-edit-tag-warning' )->inContentLanguage();
if ( !$msg->isDisabled() ) {
$notices['translate-tag'] = $msg->parseAsBlock();
- 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 translatablePageHeader
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function translatablePageHeader( $article, &$outputDone, &$pcache ) {
if ( $article->getOldID() ) {
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 onBeforePageDisplay
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
global $wgTranslatePageTranslationULS;
$title = $out->getTitle();
$isSource = TranslatablePage::isSourcePage( $title );
- 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 markForTranslation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function markForTranslation(
TranslatablePageMarkOperation $operation,
TranslatablePageSettings $pageSettings,
User $user
): int {
- 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 showConfirmation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function showConfirmation(): void {
$out = $this->getOutput();
$count = 0;
$subpageCount = 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();
- 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 doPairs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function doPairs(): array {
if ( !isset( $this->config['key'] ) ) {
throw new TranslationWebServiceConfigurationException( 'key is not set' );
}
- 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 getServersToUpdate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getServersToUpdate( ?string $requestedServiceId ): array {
$ttmServerFactory = Services::getInstance()->getTtmServerFactory();
if ( $requestedServiceId ) {
if ( !$ttmServerFactory->has( $requestedServiceId ) ) {
$this->logger->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"
Further reading
Function execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute(): void {
if ( !$this->isSandboxEnabled ) {
$this->dieWithError( 'apierror-translate-sandboxdisabled', 'sandboxdisabled' );
}
- 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 getWriteOnly
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getWriteOnly(): array {
$ttmServerIds = $this->getNames();
$writableServers = [];
foreach ( $ttmServerIds as $serverId ) {
if ( $this->configs[ $serverId ][ 'writable' ] ?? 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 preventCategorization
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function preventCategorization( Parser $parser, string &$html ): void {
if ( $parser->getOptions()->getInterfaceMessage() ) {
return;
}
$pageReference = $parser->getPage();
- 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 createUpdateMessageJobs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function createUpdateMessageJobs(
FileBasedMessageGroup $group,
array $additions,
string $language
): array {
- 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 makeWorkflowStateCell
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function makeWorkflowStateCell( ?string $state, MessageGroup $group, string $language ): string {
if ( $state === null || $group->getSourceLanguage() === $language ) {
return "\n\t\t" . $this->element( '', '', '-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 onAbuseFilterComputeVariable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function onAbuseFilterComputeVariable(
string $method,
VariableHolder $vars,
array $parameters,
?string &$result
- 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 getMessageInfoHtml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getMessageInfoHtml( MessageUpdateParameter $message, Language $language ): string {
$output = Html::openElement( 'dl' );
$tags = [];
if ( $message->isFuzzy() ) {
- 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 makeGroupRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function makeGroupRow(
MessageGroup $group,
array $cache,
MessageGroup $parent = null,
int $depth = 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function run(): bool {
$lb = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
if ( !$lb->waitForReplication() ) {
$this->logWarning( 'Continuing despite replication lag' );
}
- 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 import
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function import(
string $importFilePath,
string $interwikiPrefix,
bool $assignKnownUsers,
UserIdentity $user,
- 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 getGroupsWithTransitions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getGroupsWithTransitions( MessageHandle $handle ): array {
$listeners = [];
foreach ( $handle->getGroupIds() as $id ) {
$group = MessageGroups::getGroup( $id );
- 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 labelExists
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function labelExists( string $name ): bool {
$groups = self::getAllGroups();
foreach ( $groups as $group ) {
if ( $group instanceof AggregateMessageGroup ) {
if ( $group->getLabel() === $name ) {
- 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"