Showing 994 of 1,238 total issues
Function _drawLabels
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawLabels: function() {
var me = this;
var ctx = me.ctx;
var opts = me.options;
var tickOpts = opts.ticks;
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function(config) {
var me = this;
if (!config || typeof config !== 'object') {
// backwards compatibility
Method move
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function move(
TranslatableBundle $sourceBundle,
User $performer,
array $pagesToMove,
array $pagesToRedirect,
Method handlePriorityLanguages
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handlePriorityLanguages(
TranslatablePage $page,
TranslatablePageSettings $pageSettings,
UserIdentity $user
): void {
Method deleteUser
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteUser( User $user, string $force = '' ): void {
$uid = $user->getId();
$actorId = $user->getActorId();
if ( $force !== 'force' && !self::isSandboxed( $user ) ) {
Method getWritable
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getWritable(): array {
$writableServers = $readOnlyServers = [];
$ttmServerIds = $this->getNames();
foreach ( $ttmServerIds as $serverId ) {
Method createSearch
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createSearch( string $queryString, array $opts, array $highlight ): Search {
$query = new Query();
[ $searchQuery, $highlights ] = $this->parseQueryString( $queryString, $opts );
$query->setQuery( $searchQuery );
Method addUser
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addUser( string $name, string $email, string $password ): User {
$user = $this->userFactory->newFromName( $name, UserFactory::RIGOR_CREATABLE );
if ( !$user ) {
throw new InvalidArgumentException( 'Invalid user name' );
Method getHtmlForGroupErrors
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getHtmlForGroupErrors(
GroupSynchronizationResponse $groupErrorResponse,
Language $language,
string $wrapperClass
): string {
Method save
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save(
Title $pageTitle,
RevisionRecord $revisionRecord,
MessageBundleContent $content
): void {
Method getMessages
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMessages(): array {
if ( $this->messages !== null ) {
return $this->messages;
}
Method getTable
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getTable( array $stats ): string {
$table = $this->table;
$out = '';
// This avoids a database query per translatable page, which would be caused by
Method getGroupLoaders
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getGroupLoaders(): array {
if ( $this->groupLoaders !== null ) {
return $this->groupLoaders;
}
Method import
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function import(
string $importFilePath,
string $interwikiPrefix,
bool $assignKnownUsers,
UserIdentity $user,
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$user = $this->getUser();
$requestParams = $this->extractRequestParams();
$group = MessageGroups::getGroup( $requestParams['group'] );
Function languages
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function languages( $data, $params, $parser ) {
global $wgPageTranslationLanguageList;
if ( $wgPageTranslationLanguageList === 'sidebar-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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function execute(): void {
$params = $this->extractRequestParams();
$title = Title::newFromText( $params['title'] );
if ( !$title ) {
- 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 getLanguageExportActions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getLanguageExportActions(
string $groupId,
array $requestedLanguages,
array $alwaysExportLanguages,
int $exportThreshold = 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 processGroups
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function processGroups( array $groups ): array {
$fixedGroups = [];
foreach ( $groups as $g ) {
$name = $g['name'];
$sanitizedName = preg_replace( '/\s+/', '', strtolower( $name ) );
- 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 getTranslationsWithFallback
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getTranslationsWithFallback(
MessageBundle $messageBundle,
string $languageCode,
bool $skipFallbacks
): 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"