Showing 166 of 183 total issues
Function onBeforeExit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
onBeforeExit: function ( exit, cancel ) {
const self = this;
if ( this.hasChanged() && !this.switching ) {
if ( !this.windowManager ) {
this.windowManager = OO.ui.getWindowManager();
- 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 shouldDisplayMobileViewInternal
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function shouldDisplayMobileViewInternal() {
// May be overridden programmatically
if ( $this->forceMobileView ) {
return 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 createPromoCampaign
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function createPromoCampaign(
onShow,
actions,
campaignName,
campaignActive,
- 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 getStructuredLanguages
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
languages,
variants,
frequentlyUsedLanguages,
showSuggestedLanguages,
deviceLanguage
Function exports
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function searchHeader( placeholderMsg, action, onInput, defaultSearchPage, autocapitalize ) {
Function reveal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Toggler.prototype.reveal = function ( id ) {
let $target;
// jQuery will throw for hashes containing certain characters which can break toggling
try {
$target = this.$container.find( '#' + escapeSelector( 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 _processMatch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_processMatch( match ) {
const self = this;
if ( match ) {
if ( match.overlay ) {
- 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 getContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getContent: function () {
let options;
const self = this;
- 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 getLastModifiedMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getLastModifiedMessage( ts, username, gender, historyUrl ) {
const linkAll = typeof historyUrl === 'undefined',
keys = {
seconds: 'mobile-frontend-last-modified-with-user-seconds',
minutes: 'mobile-frontend-last-modified-with-user-minutes',
- 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 onOutputPageBeforeHTML
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function onOutputPageBeforeHTML( $out, &$text ) {
// This hook can be executed more than once per page view if the page content is composed from
// multiple sources! Anything that doesn't depend on $text should use onBeforePageDisplay.
$context = $this->mobileContext;
- 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 onSaveComplete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
onSaveComplete: function ( newRevId, redirectUrl ) {
EditorOverlayBase.prototype.onSaveComplete.apply( this, arguments );
// The parent class changes the location hash in a setTimeout, so wait
// for that to happen before reloading.
- 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 _positionImage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_positionImage: function () {
const $window = util.getWindow();
this.adjustDetails();
// with a hidden details box we have a little bit more space, we just need to use it
- 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 identifyLeadParagraph
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function identifyLeadParagraph( $body ) {
// Keep in sync with MoveLeadParagraphTransform::isNotEmptyNode()
function isNotEmptyNode( node ) {
// Ignore VE whitespace characters
return !/^[\s↵➞]*$/.test( node.textContent );
- 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 filterLanguages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
filterLanguages: function ( searchQuery, searchOrigin ) {
const filteredList = [];
if ( searchQuery ) {
this.options.languages.forEach( function ( language ) {
- 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 onSkinAddFooterLinks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function onSkinAddFooterLinks( Skin $skin, string $key, array &$footerLinks ) {
$context = $this->mobileContext;
if ( $key === 'places' ) {
if ( $context->shouldDisplayMobileView() ) {
$terms = MobileFrontendSkinHooks::getTermsLink( $skin );
- 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 hasEditNoticesFeatureConflict
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function hasEditNoticesFeatureConflict( Config $config, User $user ): bool {
$gadgetName = $config->get( 'MFEditNoticesConflictingGadgetName' );
if ( !$gadgetName ) {
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
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this function. Open
return $heading.nextUntil( $nextHeading, selector );
Avoid too many return
statements within this function. Open
return 'SourceEditor';