Showing 994 of 1,238 total issues
Method formatRename
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function formatRename(
MessageGroup $group,
array $addedMsg,
array $deletedMsg,
string $language,
Method messageSelector
has 56 lines of code (exceeds 25 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' ] );
Function switchMode
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
switchMode: function ( mode ) {
var messageTable = this,
filter = this.settings.filter,
userId = mw.config.get( 'wgUserId' );
Method execute
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$handle = fopen( $this->getArg( 0 ), 'r' );
// remove heading
// @phan-suppress-next-line PhanPluginUseReturnValueInternalKnown
fgets( $handle );
Method renderTagPage
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function renderTagPage( $wikitextParser, &$text, $state ): void {
if ( $text === null ) {
// SMW is unhelpfully sending null text if the source contains section tags. Do not explode.
return;
}
Method getData
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getData(): array {
$db = Utilities::getSafeReadDB();
$revTagStore = Services::getInstance()->getRevTagStore();
Method makeUserList
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function makeUserList( array $userStats ): void {
$day = 60 * 60 * 24;
// Scale of the activity colors, anything
// longer than this is just inactive
Method getMetadata
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMetadata(): MessageBundleMetadata {
if ( $this->metadata !== null ) {
return $this->metadata;
}
Function createMessageTools
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
createMessageTools: function () {
var $editItem = this.createMessageToolsItem(
'message-tools-edit',
{
title: this.message.title,
Method doFuzzy
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function doFuzzy(
Title $title,
string $message,
string $comment,
?User $user
Method doGettextHeader
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doGettextHeader( MessageCollection $collection, array $template ): string {
global $wgSitename;
$code = $collection->code;
$name = Utilities::getLanguageName( $code );
Function onSaveComplete
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function onSaveComplete(
WikiPage $wikiPage,
UserIdentity $userIdentity,
string $summary,
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 run
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function run(): bool {
$this->logJobStart();
$mwServices = MediaWikiServices::getInstance();
// We may be doing double wait here if this job was spawned by TranslationUpdateJob
$lb = $mwServices->getDBLoadBalancerFactory();
- 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 showRenames
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function showRenames(
MessageGroup $group,
MessageSourceChange $sourceChanges,
OutputPage $out,
string $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 getData
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getData(): array {
// We need to get the primary group to get the correct file
// So $group can be different from $this->group
$group = $this->handle->getGroup();
if ( !$group instanceof FileBasedMessageGroup ) {
- 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 unflattenCLDRPlurals
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function unflattenCLDRPlurals( string $key, string $message ) {
// Quick escape.
if ( !str_contains( $message, '{{PLURAL' ) ) {
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 getMetadata
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getMetadata(): MessageBundleMetadata {
if ( $this->metadata !== null ) {
return $this->metadata;
}
- 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 findMessage
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function findMessage( $language, $key, $possibleStates = [], &$modificationType = null ) {
$allChanges = [];
$allChanges[self::ADDITION] = $this->getAdditions( $language );
$allChanges[self::DELETION] = $this->getDeletions( $language );
$allChanges[self::CHANGE] = $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 handleRename
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function handleRename(
MessageGroup $group,
MessageSourceChange $sourceChanges,
string $msgKey,
string $keyToRename,
- 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 importData
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function importData(
array $messagesWithTranslations,
Authority $authority,
string $comment,
?callable $progressReporter = null
- 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"