Showing 1,238 of 1,238 total issues
Function import
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function import( array $changeData, string $name, int $importStrategy ): array {
$processed = [];
$skipped = [];
$jobs = [];
- 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 processSubmit
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function processSubmit(): void {
$req = $this->getRequest();
$out = $this->getOutput();
$errorGroups = [];
Function _computeGridLineItems
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
_computeGridLineItems: function(chartArea) {
var me = this;
var chart = me.chart;
var options = me.options;
var gridLines = options.gridLines;
File ext.translate.special.managegroups.js
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
( function () {
var RenameDropdown,
GroupSynchronization;
$( function () {
File ttmserver-export.php
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Script to bootstrap TtmServer translation memory
*
* @author Niklas Laxström
File UpdateMessageJob.php
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\Synchronization;
Method showChanges
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function showChanges( int $limit ): void {
$diff = new DifferenceEngine( $this->getContext() );
$diff->showDiffStyle();
$diff->setReducedLineNumbers();
$this->diff = $diff;
Method doQuery
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doQuery( string $sourceLanguage, string $targetLanguage, string $text ): array {
if ( !$this->useWikimediaExtraPlugin() ) {
// ElasticTTM is currently not compatible with elasticsearch 2.x/5.x
// It needs FuzzyLikeThis ported via the wmf extra plugin
throw new RuntimeException( 'The wikimedia extra plugin is mandatory.' );
Method getGraphData
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getGraphData( TranslationStatsGraphOptions $opts, Language $language ): array {
$dbr = $this->dbProvider->getReplicaDatabase();
$so = $this->getStatsProvider( $opts->getValue( 'count' ), $opts );
Function showTranslationMemory
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
showTranslationMemory: function ( translations ) {
if ( !translations.length ) {
return;
}
Function sendNotifications
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function sendNotifications( array $changesToProcess ): void {
if ( !$this->isEnabled() || $changesToProcess === [] ) {
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
File ActiveLanguagesSpecialPage.php
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\Statistics;
MessageGroupOld
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class MessageGroupOld implements MessageGroup {
/**
* Human-readable name of this group
* @var string
*/
Function displayEmptyListHelp
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
displayEmptyListHelp: function () {
var messageTable = this,
// @todo Ugly! This should be provided somehow
selectedTab = $( '.tux-message-selector .selected' ).data( 'title' ),
$wrap = $( '<div>' ).addClass( 'tux-empty-list' ),
Function displayPagesToMove
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function displayPagesToMove( PageMoveCollection $pageCollection, bool $leaveRedirect ): void {
$infoMessage = "\nThe following pages will be moved:\n";
$count = 0;
$subpagesCount = 0;
$talkpagesCount = 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 23 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$codes = MediaWikiServices::getInstance()
->getLanguageNameUtils()
->getLanguageNames( LanguageNameUtils::AUTONYMS, LanguageNameUtils::ALL );
- 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 createMessageGroup
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function createMessageGroup( string $id, array $info ): MessageGroup {
$conf = [];
$conf['BASIC']['class'] = MediaWikiExtensionMessageGroup::class;
$conf['BASIC']['id'] = $id;
$conf['BASIC']['namespace'] = $this->getNamespace();
- 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 identifySafeLanguages
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function identifySafeLanguages(
FileBasedMessageGroup $group,
MessageSourceChange $changesForGroup,
int $importStrategy
): 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 parseGettextSection
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function parseGettextSection( string $section, ?int $pluralCount ): ?array {
if ( trim( $section ) === '' ) {
return 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"
Further reading
Function showLanguages
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showLanguages() {
var ulslanguages = [],
selectedClasss = '',
quickLanguageList = [],
unique = [];