Showing 436 of 912 total issues
Method transformHTML
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
PageIdentity $page,
Bcp47Code $targetLanguage,
string $html,
?int $oldid,
?string $etag
Function updateTitle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWTemplateDialog.prototype.updateTitle = function () {
let title = ve.msg( 'visualeditor-dialog-transclusion-loading' );
if ( this.transclusionModel.isSingleTemplate() ) {
const part = this.transclusionModel.getParts()[ 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 setUserConfig
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.init.mw.Platform.prototype.setUserConfig = function ( keyOrValueMap, value ) {
// T214963: Don't try to set user preferences for logged-out users, it doesn't work
if ( !mw.user.isNamed() ) {
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 onSaveDialogPreview
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.init.mw.ArticleTarget.prototype.onSaveDialogPreview = function () {
const api = this.getContentApi();
if ( !this.saveDialog.$previewViewer.children().length ) {
this.emit( 'savePreview' );
- 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 toggleWrapSelection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWWikitextAction.prototype.toggleWrapSelection = function ( before, after, placeholder, expandOffsetsCallback, unwrapOffsetsCallback ) {
const originalFragment = this.surface.getModel().getFragment( null, false, true /* excludeInsertions */ );
let fragment = originalFragment;
let textBefore, textAfter;
- 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 VeInitMwArticleTarget
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.init.mw.ArticleTarget = function VeInitMwArticleTarget( config ) {
config = config || {};
config.toolbarConfig = ve.extendObject( {
shadow: true,
actions: 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 prepareCacheKey
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.init.mw.ArticleTarget.prototype.prepareCacheKey = function ( doc ) {
const start = ve.now();
if ( this.getSurface().getMode() === 'source' ) {
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 updateReviewMode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWSaveDialog.prototype.updateReviewMode = function () {
if ( !this.hasDiff ) {
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 onToggle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWCategoryPopupWidget.prototype.onToggle = function ( show ) {
if ( show ) {
return;
}
const newSortkey = this.sortKeyInput.$input.val();
- 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 serialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.dm.MWTemplateModel.prototype.serialize = function () {
const origData = this.originalData || {},
origParams = origData.params || {},
template = { target: this.target, params: {} },
spec = this.spec,
- 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 onParameterAddedToTemplateModel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWTransclusionOutlineTemplateWidget.prototype.onParameterAddedToTemplateModel = function ( param ) {
const paramName = param.getName();
// The placeholder (currently) doesn't get a corresponding item in the sidebar
if ( !paramName ) {
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 isDefaultAligned
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.dm.MWImageModel.prototype.isDefaultAligned = function ( imageType, align ) {
const alignment = align || this.getAlignment(),
defaultAlignment = ( this.parentDoc.getDir() === 'rtl' ) ? 'left' : 'right';
imageType = imageType || this.getType();
- 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 initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWGalleryDialog.prototype.initialize = function () {
// Parent method
ve.ui.MWGalleryDialog.super.prototype.initialize.call( this );
// States
- 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 toggleSearchPanel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWGalleryDialog.prototype.toggleSearchPanel = function ( visible ) {
visible = visible !== undefined ? visible : !this.searchPanelVisible;
// If currently visible panel is an edit panel, save the input values for the highlighted item
if ( !this.searchPanelVisible ) {
- 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 isHighlightedItemModified
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWGalleryDialog.prototype.isHighlightedItemModified = function () {
if ( this.highlightedItem ) {
if ( this.highlightedAltTextInput.getValue() !== this.highlightedItem.altText ) {
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 getValidationErrors
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWAddParameterPage.prototype.getValidationErrors = function ( name ) {
if ( !name ) {
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 getUpdatedAttributes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.dm.MWImageModel.prototype.getUpdatedAttributes = function () {
const origAttrs = this.getOriginalImageAttributes();
let currentDimensions;
// Adjust default dimensions if size is set to default
- 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 setup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWAdvancedSettingsPage.prototype.setup = function ( fragment, config ) {
this.fragment = fragment;
// Indexing items
const indexingField = this.indexing.getField();
- 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 getTablesorterHeaderCells
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ve.ce.MWTableNode.prototype.getTablesorterHeaderCells = function () {
const matrix = this.model.getMatrix();
let longestRow = [];
let longestRowLength = 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 canBeShown
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
mw.editcheck.BaseEditCheck.prototype.canBeShown = function () {
// all checks are only in the main namespace for now
if ( mw.config.get( 'wgNamespaceNumber' ) !== mw.config.get( 'wgNamespaceIds' )[ '' ] ) {
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"