Showing 994 of 1,238 total issues
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return GettextPlural::unflatten( $a, $expectedPluralCount )
=== GettextPlural::unflatten( $b, $expectedPluralCount );
Avoid too many return
statements within this method. Open
return 'ok';
Function positionElement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function positionElement( $targetElem, options ) {
// Make a copy, we don't want to modify arguments
options = $.extend( {}, options );
var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
- 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 addMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function addMessage( message ) {
var $messageTable = $( '.tux-messagelist' ),
sourceLanguage = $messageTable.data( 'sourcelangcode' ),
sourceLanguageDir = $.uls.data.getDir( sourceLanguage ),
targetLanguage = $messageTable.data( 'targetlangcode' ),
- 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 FormHandler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var FormHandler = function () {
var $form = $( '#translationStatsConfig' ),
onFilter = null;
function getHeight() {
- 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 getNewTitle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getNewTitle( Title $title ): Title {
$instructions = $this->map[$title->getNamespace()] ?? null;
if ( $instructions === null ) {
throw new InvalidPageTitleRename(
'Trying to move a page which is not part of the translatable page', self::UNKNOWN_PAGE
- 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 classifyPages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function classifyPages( array $pages ): array {
$out = [
// The ideal state for pages: marked and up to date
'active' => [],
'proposed' => [],
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
global $wgTranslateGroupFiles, $wgTranslateYamlLibrary;
$documents = [];
$times = [];
$mems = [];
- 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 getIssues
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getIssues(): array {
$issues = $usedNames = [];
foreach ( $this->getVariables() as $variable ) {
$name = $variable->getName();
$pattern = '/^' . TranslatablePageInsertablesSuggester::NAME_PATTERN . '$/u';
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$template =
<<<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<graphml
- 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 getLeaveRedirectPairFromList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getLeaveRedirectPairFromList( array $pagePairs ): array {
$pairs = [];
foreach ( $pagePairs as $pair ) {
if ( $pair->shouldLeaveRedirect() ) {
$pairs[ $pair->getOldTitle()->getPrefixedText() ] = true;
- 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 displayStateInfoMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function displayStateInfoMessage( Title $title, TranslatableBundleState $bundleState ): void {
$stateId = $bundleState->getStateId();
if ( $stateId === TranslatableBundleState::UNSTABLE ) {
$infoMessage = $this->msg( 'tpt-translation-settings-unstable-notice' );
} elseif ( $stateId === TranslatableBundleState::PROPOSE ) {
- 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 getTranslatablePageStatus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function getTranslatablePageStatus( ?PageReference $pageReference ): ?array {
if ( $pageReference === null ) {
return null;
}
$title = Title::newFromPageReference( $pageReference );
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$this->checkUserRightsAny( self::$right );
$params = $this->extractRequestParams();
- 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 onDeleteTranslationUnit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function onDeleteTranslationUnit(
WikiPage $unit,
User $user,
$reason,
$id,
- 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 onTitleGetEditNotices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function onTitleGetEditNotices( Title $title, int $oldid, array &$notices ) {
if ( TranslatablePage::isSourcePage( $title ) ) {
$msg = wfMessage( 'translate-edit-tag-warning' )->inContentLanguage();
if ( !$msg->isDisabled() ) {
$notices['translate-tag'] = $msg->parseAsBlock();
- 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 translatablePageHeader
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function translatablePageHeader( $article, &$outputDone, &$pcache ) {
if ( $article->getOldID() ) {
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 onBeforePageDisplay
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
global $wgTranslatePageTranslationULS;
$title = $out->getTitle();
$isSource = TranslatablePage::isSourcePage( $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 markForTranslation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function markForTranslation(
TranslatablePageMarkOperation $operation,
TranslatablePageSettings $pageSettings,
User $user
): int {
- 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"