Showing 1,238 of 1,238 total issues
Function extractMessageData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function extractMessageData(
ApiResult $result,
array $props,
Message $message
): 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 translateTab
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function translateTab( Skin $skin, array &$tabs ) {
$title = $skin->getTitle();
$handle = new MessageHandle( $title );
$code = $handle->getCode();
$page = TranslatablePage::isTranslationPage( $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 execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->setHeaders();
$out = $this->getOutput();
$out->addModuleStyles( 'ext.translate.specialpages.styles' );
- 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 getOutput
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getOutput( MessageGroup $group ): array {
$out = [];
$groupId = $group->getId();
$sourceLanguage = $group->getSourceLanguage();
- 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 getQueryableServicesUncached
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getQueryableServicesUncached( array $services ): array {
// Remove writable services
$writableServices = $this->ttmServerFactory->getWriteOnly();
foreach ( array_keys( $writableServices ) as $serviceId ) {
unset( $services[ $serviceId ] );
- 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 parseResponse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function parseResponse( TranslationQueryResponse $reply ): string {
$body = $reply->getBody();
$response = FormatJson::decode( $body );
if ( !is_array( $response ) ) {
throw new TranslationWebServiceException( 'Invalid json: ' . serialize( $body ) );
- 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 messageSelector
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function messageSelector(): string {
$nonDefaults = $this->opts->getChangedValues();
$output = Html::openElement( 'div', [ 'class' => 'row tux-messagetable-header' ] );
$output .= Html::openElement( 'div', [ 'class' => 'twelve columns' ] );
$output .= Html::openElement( 'ul', [ 'class' => 'row tux-message-selector' ] );
- 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 showTranslations
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function showTranslations( Title $title ): void {
$handle = new MessageHandle( $title );
$namespace = $title->getNamespace();
$message = $handle->getKey();
- 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 processQueryResults
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function processQueryResults( IResultWrapper $res, string $text, string $targetLanguage ): array {
$timeLimit = microtime( true ) + 5;
$lenA = mb_strlen( $text );
$results = [];
- 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 getData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getData(): array {
$db = Utilities::getSafeReadDB();
$revTagStore = Services::getInstance()->getRevTagStore();
- 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 doFuzzy
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function doFuzzy(
Title $title,
string $message,
string $comment,
?User $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 isExcluded
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function isExcluded( MessageGroup $group, string $code ): bool {
$excluded = null;
$groupId = $group->getId();
$checks = [
- 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 isExcluded
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function isExcluded( string $groupId, string $code ): bool {
if ( $this->priorityCache === null ) {
// TODO: Ideally, this should use the injected ILoadBalancer to make it mockable.
$db = Utilities::getSafeReadDB();
$res = $db->newSelectQueryBuilder()
- 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 handleRename
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function handleRename( string $target, string $replacement ): ?Title {
$newSourceTitle = null;
$sourceMessageHandle = new MessageHandle( $this->title );
$movableTitles = TranslateReplaceTitle::getTitlesForMove( $sourceMessageHandle, $replacement );
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$this->language = $this->getServiceContainer()->getContentLanguage();
$groupInput = $this->getOption( 'group', '*' );
$groupIdPattern = self::commaList2Array( $groupInput );
- 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 hasOnly
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function hasOnly( $language, $type ) {
$deletions = $this->getDeletions( $language );
$additions = $this->getAdditions( $language );
$renames = $this->getRenames( $language );
$changes = $this->getChanges( $language );
- 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 levenshtein
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function levenshtein( string $str1, string $str2, int $length1, int $length2 ): int {
if ( $length1 === 0 ) {
return $length2;
}
- 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 handleNew
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function handleNew(
MessageSourceChange $sourceChanges,
string $msgKey,
string $sourceLang
): void {
- 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 calculateAggregateGroup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static function calculateAggregateGroup(
array &$stats,
AggregateMessageGroup $group,
string $code,
int $flags
- 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 get
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function get(
array $stats,
MessageGroup $group,
bool $noComplete,
bool $noEmpty
- 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"