Showing 191 of 191 total issues
Function execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$services = MediaWikiServices::getInstance();
$config = $this->getConfig();
$resultObj = $this->getResult();
- 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 domParseMobile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function domParseMobile( OutputPage $out, $html = '' ) {
$services = MediaWikiServices::getInstance();
/** @var FeaturesManager $featureManager */
$featureManager = $services->getService( 'MobileFrontend.FeaturesManager' );
/** @var MobileContext $context */
- 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 makeHeader
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function makeHeader( headingOrView, headerActions, headerCancel, additionalClassNames ) {
const heading = typeof headingOrView === 'string' ? headingOrView : undefined,
templateData = {
hasActions: headerActions && headerActions.length,
isHidden: 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 getRevisionCommentHTML
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getRevisionCommentHTML( RevisionRecord $rev, $user, $unhide ) {
if ( RevisionRecord::userCanBitfield(
$rev->getVisibility(),
RevisionRecord::DELETED_COMMENT,
$user
- 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 preRender
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
preRender() {
// Mapping existing props to Codex props used in IconButton
var action = 'default';
if ( this.options.progressive ) {
action = 'progressive';
- 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 handleCaptcha
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
handleCaptcha: function ( details ) {
var self = this,
$input = this.$el.find( '.captcha-word' );
if ( this.captchaShown ) {
- 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 VisualEditorOverlay
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function VisualEditorOverlay( options ) {
var surfaceReady = util.Deferred();
EditorOverlayBase.call( this,
util.extend( {
- 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 isIos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
isIos: memoize( function ( version ) {
var ua = this.userAgent,
ios = /ipad|iphone|ipod/i.test( ua );
if ( ios && version ) {
- 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 isNonLeadParagraph
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function isNonLeadParagraph( $xPath, $node ) {
if (
$node->nodeType === XML_ELEMENT_NODE &&
/** @phan-suppress-next-line PhanUndeclaredProperty DOMNode vs. DOMElement */
$node->tagName === 'p' &&
- 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 getPageImageHtml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getPageImageHtml( $size, $useBackgroundImage = false ) {
if ( !$this->file ) {
return '';
}
// FIXME: Use more generic classes - no longer restricted to lists
- 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 getUsernameText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getUsernameText( $rev, $user, $unhide ) {
$revUser = $rev->getUser( RevisionRecord::FOR_THIS_USER, $user );
if ( $revUser && $revUser->isRegistered() ) {
$username = $revUser->getName();
} else {
- 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"