Showing 994 of 1,238 total issues
Function onMovePageTranslationUnits
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function onMovePageTranslationUnits(
LinkTarget $oldLinkTarget,
LinkTarget $newLinkTarget,
UserIdentity $userIdentity,
int $oldid,
- 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 fetchTranslatableTemplateAndTitle
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function fetchTranslatableTemplateAndTitle(
?LinkTarget $contextLink,
?LinkTarget $templateLink,
bool &$skip,
?RevisionRecord &$revRecord
- 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 filterChanged
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function filterChanged( array $keys, bool $condition ): array {
$this->loadData( $keys );
$origKeys = [];
if ( !$condition ) {
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
public function execute(): void {
$params = $this->extractRequestParams();
// The user we are operating on, not necessarily the user making the request
$user = $this->getUser();
- 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 getDefinitions
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getDefinitions() {
global $wgTranslateSandboxLimit;
// This will contain the list of messages shown to the user
$list = [];
- 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 getGroups
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getGroups(): array {
if ( $this->groups === null ) {
$groups = [];
$ids = (array)$this->conf['GROUPS'];
$ids = MessageGroups::expandWildcards( $ids );
- 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 updateBezierControlPoints
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateBezierControlPoints: function() {
var me = this;
var chart = me.chart;
var meta = me.getMeta();
var lineModel = meta.dataset._model;
Function handleTickRangeOptions
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleTickRangeOptions: function() {
var me = this;
var opts = me.options;
var tickOpts = opts.ticks;
Method parse
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse( string $text ): ParserOutput {
$nowiki = [];
$text = $this->armourNowiki( $nowiki, $text );
$sections = [];
Method execute
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->setHeaders();
$out = $this->getOutput();
$out->addModuleStyles( 'ext.translate.specialpages.styles' );
Method searchStaticMessageGroups
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function searchStaticMessageGroups( string $query, int $maxResults, array $types = [] ): array {
$cache = $this->cache;
// None of the static groups currently use language-dependent labels. This
// may need revisiting later and splitting the cache by language.
$key = $cache->makeKey( 'Translate', 'EntitySearch', 'static-groups', '-v2' );
Method checkNonSourceAdditionsForRename
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkNonSourceAdditionsForRename(
MessageSourceChange $changes,
string $sourceLanguage,
string $targetLanguage,
MessageCollection $wiki,
Method queueUpdates
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function queueUpdates( int $flags ): void {
$mwInstance = MediaWikiServices::getInstance();
if ( self::$updates === [] || $mwInstance->getReadOnlyMode()->isReadOnly() ) {
return;
}
Method get
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get(
array $stats,
MessageGroup $group,
bool $noComplete,
bool $noEmpty
Method __construct
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
IConnectionProvider $dbProvider,
JobQueueGroup $jobQueueGroup,
LinkRenderer $linkRenderer,
MessageGroups $messageGroups,
MessageIndex $messageIndex,
Function calculateBarValuePixels
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
calculateBarValuePixels: function(datasetIndex, index, options) {
var me = this;
var chart = me.chart;
var scale = me._getValueScale();
var isHorizontal = scale.isHorizontal();
Function addProofread
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
addProofread: function ( message ) {
var $message = $( '<div>' )
.addClass( 'row tux-message tux-message-proofread' );
this.$container.append( $message );
Function display
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
display: function () {
var instance = this;
instance.$container.empty();
if ( !instance.states ) {
Function update
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function(chart, width, height) {
if (!chart) {
return;
}
Method priorityLanguagesForm
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function priorityLanguagesForm( TranslatablePage $page ): void {
$groupId = $page->getMessageGroupId();
$interfaceLanguage = $this->getLanguage()->getCode();
$storedLanguages = (string)$this->messageGroupMetadata->get( $groupId, 'prioritylangs' );
$default = $storedLanguages !== '' ? explode( ',', $storedLanguages ) : [];