Showing 994 of 1,238 total issues
MessageWebImporter
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class MessageWebImporter {
private Title $title;
private User $user;
private MessageGroup $group;
private string $code;
Function draw
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw: function() {
var me = this;
var vm = me._view;
var ctx = me._chart.ctx;
var spanGaps = vm.spanGaps;
Function showEditSummaries
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
showEditSummaries: function ( editsummaries ) {
if ( !editsummaries.length ) {
return;
}
Method parse
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse() {
$data = file_get_contents( $this->file );
$data = TextContent::normalizeLineEndings( $data );
$matches = [];
Method tabify
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function tabify( Skin $skin, array &$tabs ): bool {
$title = $skin->getTitle();
if ( !$title->isSpecialPage() ) {
return true;
}
Method handleRename
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleRename(
MessageGroup $group,
MessageSourceChange $sourceChanges,
string $msgKey,
string $keyToRename,
File Utilities.php
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\Utilities;
Function updateGroupPriorityWarnings
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateGroupPriorityWarnings( group, language ) {
var $groupWarning = $( '.tux-editor-header .tux-group-warning' );
if ( group.priority === 'discouraged' ) {
$groupWarning.append(
Function determineAlignment
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function determineAlignment(tooltip, size) {
var model = tooltip._model;
var chart = tooltip._chart;
var chartArea = tooltip._chart.chartArea;
var xAlign = 'center';
Function _drawGrid
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawGrid: function(chartArea) {
var me = this;
var gridLines = me.options.gridLines;
if (!gridLines.display) {
Method execute
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
global $wgTranslateMessageNamespaces;
$namespace = $this->getOption( 'namespace', $wgTranslateMessageNamespaces );
$nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
Function determineDataLimits
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
determineDataLimits: function() {
var me = this;
var chart = me.chart;
var adapter = me._adapter;
var options = me.options;
File ManageMessageGroupSubscriptionsSpecialPage.php
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\PageTranslation;
File QueryMessageCollectionActionApi.php
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\MessageLoading;
Function getLookupMenuOptionsFromData
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
EntitySelectorWidget.prototype.getLookupMenuOptionsFromData = function ( response ) {
var groups = response.groups || [];
var messages = response.messages || [];
var finalResult = [];
var i = 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 populateQueries
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function populateQueries(): void {
$definition = $this->dataProvider->getDefinition();
$translations = $this->dataProvider->getGoodTranslations();
$sourceLanguage = $this->group->getSourceLanguage();
$targetLanguage = $this->handle->getCode();
- 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 validate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function validate( Title $pageTitle, MessageBundleContent $content ): void {
$content->validate();
// Verify that the language code is valid
$metadata = $content->getMetadata();
$sourceLanguageCode = $metadata->getSourceLanguageCode();
- 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 execute
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$codes = MediaWikiServices::getInstance()
->getLanguageNameUtils()
->getLanguageNames( LanguageNameUtils::AUTONYMS, LanguageNameUtils::ALL );
Function _computeLabelItems
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
_computeLabelItems: function() {
var me = this;
var options = me.options;
var optionTicks = options.ticks;
var position = options.position;
Function update
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function(maxWidth, maxHeight, margins) {
var me = this;
var tickOpts = me.options.ticks;
var sampleSize = tickOpts.sampleSize;
var i, ilen, labels, ticks, samplingEnabled;