Showing 994 of 1,238 total issues
Function generateTicks$1
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateTicks$1(generationOptions, dataRange) {
var ticks = [];
var tickVal = valueOrDefault$b(generationOptions.min, Math.pow(10, Math.floor(log10(dataRange.min))));
Function buildOrUpdateControllers
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildOrUpdateControllers: function() {
var me = this;
var newControllers = [];
var datasets = me.data.datasets;
var i, ilen;
Method getServers
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getServers(
bool $isDryRun,
bool $shouldReindex,
?string $ttmServerId = null
): array {
Function afterDatasetsUpdate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
afterDatasetsUpdate: function(chart, options) {
var count = (chart.data.datasets || []).length;
var propagate = options.propagate;
var sources = [];
var meta, i, el, source;
Method applyFilter
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function applyFilter( string $filter, bool $condition, ?int $value ): void {
$keys = $this->keys;
if ( $filter === 'fuzzy' ) {
$keys = $this->filterFuzzy( $keys, $condition );
} elseif ( $filter === 'hastranslation' ) {
Method tabify
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function tabify( Skin $skin, array &$tabs ): void {
$title = $skin->getTitle();
if ( !$title->isSpecialPage() ) {
return;
}
Method loadTranslationData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function loadTranslationData( IDatabase $db, MessageHandle $handle ): array {
$revisionStore = MediaWikiServices::getInstance()->getRevisionStore();
$conditions = [];
// The list of pages we want to select, and their latest versions
Method getMessageParameters
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMessageParameters(): array {
$params = parent::getMessageParameters();
$type = $this->entry->getFullType();
Method getServersToUpdate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getServersToUpdate( ?string $requestedServiceId ): array {
$ttmServerFactory = Services::getInstance()->getTtmServerFactory();
if ( $requestedServiceId ) {
if ( !$ttmServerFactory->has( $requestedServiceId ) ) {
$this->logger->warning(
Method subGroups
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function subGroups(
AggregateMessageGroup $parent,
array &$childIds = [],
string $fname = 'caller'
): array {
Method __construct
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
parent::__construct();
$this->addDescription(
'Export a translatable bundle into a file that can then be imported ' .
'into another wiki using the importTranslatableBundle.php script'
Method inAllLanguages
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function inAllLanguages(): array {
$dbr = $this->loadBalancer->getConnection( DB_REPLICA, 'vslow' );
$res = $dbr->newSelectQueryBuilder()
->select( [
Method getContents
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getContents( $titles, int $namespace ): array {
$mwServices = MediaWikiServices::getInstance();
$dbr = $mwServices->getConnectionProvider()->getReplicaDatabase();
$revStore = $mwServices->getRevisionStore();
$titleContents = [];
Method execute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $parameters ): void {
$this->setHeaders();
$this->addHelpLink( 'Help:Extension:Translate/Page translation administration' );
$out = $this->getOutput();
Function addLanguageLinks
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function addLanguageLinks( Title $title, array &$languageLinks ) {
global $wgPageTranslationLanguageList;
if ( $wgPageTranslationLanguageList === 'tag-only' ) {
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
Function parse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function parse( string $text ): ParserOutput {
$nowiki = [];
$text = $this->armourNowiki( $nowiki, $text );
$sections = [];
- 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 getAuthors
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getAuthors(): array {
$this->loadTranslations();
$authors = array_flip( $this->authors );
- 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 getPagesToMove
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getPagesToMove(
Title $source,
Title $target,
bool $moveSubPages,
bool $fetchTranslatableSubpages,
- 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 doCreate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function doCreate(): void {
$params = $this->extractRequestParams();
// Do validations
foreach ( explode( '|', 'username|password|email' ) as $field ) {
- 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 parseDocuments
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function parseDocuments( array $documents ): array {
$groups = [];
$template = [];
foreach ( $documents as $document ) {
- 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"