Showing 994 of 1,238 total issues
Method identifyDifferences
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function identifyDifferences(
array $translatableBundles,
array $translatableBundleStatuses
): array {
$result = [
Function top
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
top: function ( position, data ) {
var within = data.within,
withinOffset = within.offset.top + within.scrollTop,
outerHeight = within.height,
offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
- 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 getPageList
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function getPageList( array $pages, string $type ): string {
$items = [];
$tagsTextCache = [];
$tagDiscouraged = $this->msg( 'tpt-tag-discouraged' )->escaped();
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$mwLanguages = $this->loadMediaWiki();
$gtLanguages = $this->loadGettext();
$clLanguages = $this->loadCLDR();
- 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 makeGroupFacetRows
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function makeGroupFacetRows(
array $groups,
array $counts,
int $level = 0,
string $pathString = ''
- 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 getMessageGroups
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function getMessageGroups(
string $groupPattern,
string $excludePattern,
bool $forOffline
): 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"
Further reading
Function validateMessage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function validateMessage(
IContextSource $context,
Content $content,
Status $status,
string $summary,
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $parameters ) {
$this->setHeaders();
// Security and validity checks
if ( !$this->userCanExecute( $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 flatten
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function flatten( array $unflat ): array {
$flat = [];
foreach ( $unflat as $key => $value ) {
if ( !is_array( $value ) ) {
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function execute(): void {
$days = (int)$this->getOption( 'days' ) ?: 7;
$top = (int)$this->getOption( 'top' ) ?: 10;
$bots = $this->hasOption( 'bots' );
- 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 checkNonSourceAdditionsForRename
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function checkNonSourceAdditionsForRename(
MessageSourceChange $changes,
string $sourceLanguage,
string $targetLanguage,
MessageCollection $wiki,
- 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 getWorkflowStates
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function getWorkflowStates( MessageGroup $group ) {
if ( MessageGroups::isDynamic( $group ) ) {
return false;
}
- 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 makeRow
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function makeRow(
StatsTable $table,
string $languageCode,
array $stats,
MessageGroup $group,
- 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 isValid
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function isValid( &$reason ): bool {
$group = $this->group;
$pattern = $group->getSourceFilePath( '*' );
$filename = $group->getSourceFilePath( $this->languageCode );
- 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 writeReal
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function writeReal( MessageCollection $collection ): string {
global $wgTranslateDocumentationLanguageCode;
$collection->filter( 'hastranslation', false );
if ( count( $collection ) === 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 getLookupRequest
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
EntitySelectorWidget.prototype.getLookupRequest = function () {
var value = this.getValue();
var widget = this;
if ( !this.allowSuggestionsWhenEmpty && value === '' ) {
Function displayOnMultipleSelection
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayOnMultipleSelection() {
var selectedUserIDs = $( '.request-selector:checked' ).map( function ( i, checkedBox ) {
return $( checkedBox ).parents( 'div.request' ).data( 'data' ).userid;
} ).toArray();
Function rgb
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
convert.hsl.rgb = function (hsl) {
var h = hsl[0] / 360;
var s = hsl[1] / 100;
var l = hsl[2] / 100;
var t1;
Function Color
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Color = function (obj) {
if (obj instanceof Color) {
return obj;
}
if (!(this instanceof Color)) {
Method doCreate
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doCreate(): void {
$params = $this->extractRequestParams();
// Do validations
foreach ( explode( '|', 'username|password|email' ) as $field ) {