Function addExtensionOptions
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
private function addExtensionOptions(): void {
global $wgLang;
$extensions = $this->parent->findExtensions()->value;
'@phan-var array[] $extensions';
- 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
File WebInstallerOptions.php
has 438 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Function submit
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function submit() {
$this->parent->setVarsFromRequest( [ '_RightsProfile', '_LicenseCode',
'wgEnableEmail', 'wgPasswordSender', 'wgEnableUploads',
'_Logo1x', '_LogoWordmark', '_LogoTagline', '_LogoIcon',
'wgEnableUserEmail', 'wgEnotifUserTalk', 'wgEnotifWatchlist',
- 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
Method submit
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function submit() {
$this->parent->setVarsFromRequest( [ '_RightsProfile', '_LicenseCode',
'wgEnableEmail', 'wgPasswordSender', 'wgEnableUploads',
'_Logo1x', '_LogoWordmark', '_LogoTagline', '_LogoIcon',
'wgEnableUserEmail', 'wgEnotifUserTalk', 'wgEnotifWatchlist',
Method addExtensionOptions
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addExtensionOptions(): void {
global $wgLang;
$extensions = $this->parent->findExtensions()->value;
'@phan-var array[] $extensions';
Method addPersonalizationOptions
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addPersonalizationOptions() {
$parent = $this->parent;
$this->addHTML(
$this->getFieldsetStart( 'config-personalization-settings' ) .
Html::rawElement( 'div', [
Method addEmailOptions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addEmailOptions(): void {
$emailwrapperStyle = $this->getVar( 'wgEnableEmail' ) ? '' : 'display: none';
$this->addHTML(
$this->getFieldsetStart( 'config-email-settings' ) .
$this->parent->getCheckBox( [
Method addSkinOptions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addSkinOptions(): void {
$skins = $this->parent->findExtensions( 'skins' )->value;
'@phan-var array[] $skins';
$skinHtml = $this->getFieldsetStart( 'config-skins' );
Method addAdvancedOptions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addAdvancedOptions(): void {
$caches = [ 'none' ];
$cachevalDefault = 'none';
if ( count( $this->getVar( '_Caches' ) ) ) {
Method addFileOptions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addFileOptions(): void {
// Having / in paths in Windows looks funny :)
$this->setVar( 'wgDeletedDirectory',
str_replace(
'/', DIRECTORY_SEPARATOR,
Function addSkinOptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function addSkinOptions(): void {
$skins = $this->parent->findExtensions( 'skins' )->value;
'@phan-var array[] $skins';
$skinHtml = $this->getFieldsetStart( 'config-skins' );
- 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"