Showing 191 of 191 total issues
File MobileFrontendHooks.php
has 711 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// phpcs:disable MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
use MediaWiki\Api\Hook\APIQuerySiteInfoGeneralInfoHook;
Function setupEditor
has 225 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupEditor( page, skin, currentPageHTMLParser, router ) {
var
overlayManager = OverlayManager.getSingleton(),
isNewPage = page.id === 0;
File MobileContext.php
has 530 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use MediaWiki\Config\Config;
use MediaWiki\MediaWikiServices;
use MobileFrontend\Devices\DeviceDetectorService;
File EditorOverlayBase.js
has 463 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global $ */
var Overlay = require( '../mobile.startup/Overlay' ),
util = require( '../mobile.startup/util' ),
parseBlockInfo = require( './parseBlockInfo' ),
headers = require( '../mobile.startup/headers' ),
MobileContext
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
class MobileContext extends ContextSource {
public const MODE_BETA = 'beta';
public const MODE_STABLE = 'stable';
public const OPTIN_COOKIE_NAME = 'optin';
public const STOP_MOBILE_REDIRECT_COOKIE_NAME = 'stopMobileRedirect';
MobileFrontendHooks
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
class MobileFrontendHooks implements
APIQuerySiteInfoGeneralInfoHook,
AuthChangeFormFieldsHook,
RequestContextCreateSkinHook,
BeforeDisplayNoArticleTextHook,
File SourceEditorOverlay.js
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
var EditorOverlayBase = require( './EditorOverlayBase' ),
util = require( '../mobile.startup/util' ),
icons = require( '../mobile.startup/icons' ),
Section = require( '../mobile.startup/Section' ),
saveFailureMessage = require( './saveFailureMessage' ),
Method addSettingsForm
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addSettingsForm() {
$out = $this->getOutput();
$user = $this->getUser();
$isTemp = $user->isTemp();
File editor.js
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global $ */
var M = require( '../mobile.startup/moduleLoaderSingleton' ),
util = require( '../mobile.startup/util' ),
editorLoadingOverlay = require( './editorLoadingOverlay' ),
OverlayManager = require( '../mobile.startup/OverlayManager' ),
File SpecialMobileOptions.php
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use MediaWiki\Deferred\DeferredUpdates;
use MediaWiki\Html\Html;
use MediaWiki\MediaWikiServices;
Method onBeforePageDisplay
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function onBeforePageDisplay( $out, $skin ): void {
$context = MobileContext::singleton();
$services = MediaWikiServices::getInstance();
$config = $services->getService( 'MobileFrontend.Config' );
$mfEnableXAnalyticsLogging = $config->get( 'MFEnableXAnalyticsLogging' );
Function initMobileOptions
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initMobileOptions() {
var $form = $( '#mobile-options' ),
$betaToggle = $( '#enable-beta-toggle' ),
$amcToggle = $( '#enable-amc-toggle' ),
toggles = [];
File MobileFrontend.alias.php
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Aliases for MobileFrontend extension
*
* @file
`` has 26 functions (exceeds 20 allowed). Consider refactoring. Open
mfExtend( EditorOverlayBase, Overlay, {
/**
* @memberof EditorOverlayBase
* @instance
* @mixes Overlay#defaults
Function postRender
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
postRender: function () {
var self = this;
// log edit attempt
this.log( { action: 'ready' } );
Function _enable
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Toggler.prototype._enable = function () {
var self = this;
// FIXME This should use .find() instead of .children(), some extensions like Wikibase
// want to toggle other headlines than direct descendants of $container. (T95889)
Function moveFirstParagraphBeforeInfobox
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function moveFirstParagraphBeforeInfobox( DOMElement $leadSection, ?DOMDocument $doc ) {
if ( $doc === null ) {
return;
}
$xPath = new DOMXPath( $doc );
- 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 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
function VisualEditorOverlay( options ) {
var surfaceReady = util.Deferred();
EditorOverlayBase.call( this,
util.extend( {
Function defaults
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
get defaults() {
return {
createDetailsAnchorHref: function () {
return function ( blockId, render ) {
return mw.util.getUrl( 'Special:BlockList', { wpTarget: '#' + render( blockId ) } );
- 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 performSearch
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
performSearch( query ) {
var
self = this,
api = this.api,
delay = this.gateway.isCached( query ) ? 0 : SEARCH_DELAY;
- 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"