Showing 436 of 912 total issues
Function onEditSectionLinkClick
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
onEditSectionLinkClick: function ( mode, e, section ) {
const link = $( e.target ).closest( 'a' )[ 0 ];
if ( !link || !link.href ) {
// Not a real link, probably added by a gadget or another extension (T328094)
return;
Function filterRendering
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
ve.ce.MWTransclusionNode.static.filterRendering = function ( contentNodes ) {
if ( !contentNodes.length ) {
return [];
}
Function VeCeMWBlockImageNode
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
ve.ce.MWBlockImageNode = function VeCeMWBlockImageNode() {
// Parent constructor
ve.ce.MWBlockImageNode.super.apply( this, arguments );
const type = this.model.getAttribute( 'type' );
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiMain $main,
string $name,
HookContainer $hookContainer,
IBufferingStatsdDataFactory $statsdDataFactory,
PageEditStash $pageEditStash,
Function trackSaveError
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ve.init.mw.ArticleTargetEvents.prototype.trackSaveError = function ( code ) {
// Maps error codes to editAttemptStep types
const typeMap = {
badtoken: 'userBadToken',
assertanonfailed: 'userNewUser',
Function filterParameters
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ve.ui.MWTransclusionOutlineTemplateWidget.prototype.filterParameters = function ( query ) {
const template = this.templateModel,
spec = this.templateModel.getSpec(),
visibility = {};
let nothingFound = true;
Function newFromImageAttributes
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ve.dm.MWImageModel.static.newFromImageAttributes = function ( attrs, parentDoc ) {
const imgModel = new ve.dm.MWImageModel(
parentDoc,
{
resourceName: attrs.resource,
Method onTextSlotDiffRendererTablePrefix
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function onTextSlotDiffRendererTablePrefix(
TextSlotDiffRenderer $textSlotDiffRenderer,
IContextSource $context,
array &$parts
) {
Method getMessageInfo
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getMessageInfo( ResourceLoaderContext $context ) {
$editSubmitButtonLabelPublish = $this->getConfig()
->get( 'EditSubmitButtonLabelPublish' );
$saveButtonLabelKey = $editSubmitButtonLabelPublish ? 'publishchanges' : 'savechanges';
$saveButtonLabel = $context->msg( $saveButtonLabelKey )->text();
Function teardown
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ve.init.mw.ArticleTarget.prototype.teardown = function () {
if ( !this.teardownPromise ) {
const surface = this.getSurface();
// Restore access keys
- 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 setPage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.setPage = function ( name ) {
const page = this.pages[ name ];
if ( page && name === this.currentPageName ) {
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 setupNewSection
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ve.init.mw.DesktopArticleTarget.prototype.setupNewSection = function ( surface ) {
if ( surface.getMode() === 'source' && this.section === 'new' ) {
if ( !this.sectionTitle ) {
this.sectionTitle = new OO.ui.TextInputWidget( {
$element: $( '<h2>' ),
- 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 updateHistoryState
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ve.init.mw.DesktopArticleTarget.prototype.updateHistoryState = function () {
const veaction = this.getDefaultMode() === 'visual' ? 'edit' : 'editsource',
section = this.section;
// Push veaction=edit(source) url in history (if not already present).
- 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 toDomElements
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ve.dm.MWNowikiAnnotation.static.toDomElements = function ( dataElement, doc, converter, childDomElements ) {
const originalDomElements = converter.getStore().value( dataElement.originalDomElementsHash ),
originalChildren = originalDomElements && originalDomElements[ 0 ] && originalDomElements[ 0 ].childNodes,
domElement = document.createElement( 'span' );
- 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 setSelectionByPageName
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWTransclusionOutlineWidget.prototype.setSelectionByPageName = function ( pageName ) {
const selectedPartId = pageName ? pageName.split( '/', 1 )[ 0 ] : null,
isParameter = pageName ? pageName.length > selectedPartId.length : false;
for ( const partId in this.partWidgets ) {
- 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 initFromMetaList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWTocWidget.prototype.initFromMetaList = function () {
const items = this.metaList.getItemsInGroup( 'mwTOC' );
if ( items.length === 0 ) {
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 VeUiMWParameterPage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ve.ui.MWParameterPage = function VeUiMWParameterPage( parameter, config ) {
const paramName = parameter.getName();
// Configuration initialization
config = ve.extendObject( {
- 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 getTargetDataFromHref
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
mw.libs.ve.getTargetDataFromHref = function ( href, doc ) {
function regexEscape( str ) {
return str.replace( /([.?*+^$[\]\\(){}|-])/g, '\\$1' );
}
- 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 generateContents
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ve.ce.MWExtensionNode.prototype.generateContents = function ( config ) {
const deferred = ve.createDeferred(),
mwData = ve.copy( this.getModel().getAttribute( 'mw' ) ),
extsrc = config && config.extsrc !== undefined ? config.extsrc : ( ve.getProp( mwData, 'body', 'extsrc' ) || '' ),
attrs = config && config.attrs || mwData.attrs,
- 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 updateHistoryState
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
ve.init.mw.DesktopArticleTarget.prototype.updateHistoryState = function () {
const veaction = this.getDefaultMode() === 'visual' ? 'edit' : 'editsource',
section = this.section;
// Push veaction=edit(source) url in history (if not already present).