File WebInstaller.php
has 678 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Core installer web interface.
*
* This program is free software; you can redistribute it and/or modify
WebInstaller
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
class WebInstaller extends Installer {
/**
* @var WebInstallerOutput
*/
Function execute
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function execute( array $session ) {
$this->session = $session;
if ( isset( $session['settings'] ) ) {
$this->settings = $session['settings'] + $this->settings;
- 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 execute
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( array $session ) {
$this->session = $session;
if ( isset( $session['settings'] ) ) {
$this->settings = $session['settings'] + $this->settings;
Method getCheckBox
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCheckBox( $params ) {
if ( !isset( $params['controlName'] ) ) {
$params['controlName'] = 'config_' . $params['var'];
}
Method getPageListItem
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPageListItem( $pageName, $enabled, $currentPageName ) {
$s = "<li class=\"config-page-list-item\">";
// Messages:
// config-page-language, config-page-welcome, config-page-dbconnect, config-page-upgrade,
Function getPageListItem
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function getPageListItem( $pageName, $enabled, $currentPageName ) {
$s = "<li class=\"config-page-list-item\">";
// Messages:
// config-page-language, config-page-welcome, config-page-dbconnect, config-page-upgrade,
- 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 getRadioElements
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRadioElements( $params ) {
if ( !isset( $params['controlName'] ) ) {
$params['controlName'] = 'config_' . $params['var'];
}
Method getTextBox
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTextBox( $params ) {
if ( !isset( $params['controlName'] ) ) {
$params['controlName'] = 'config_' . $params['var'];
}
Method getTextArea
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTextArea( $params ) {
if ( !isset( $params['controlName'] ) ) {
$params['controlName'] = 'config_' . $params['var'];
}
Function setVarsFromRequest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function setVarsFromRequest( $varNames, $prefix = 'config_' ) {
$newValues = [];
foreach ( $varNames as $name ) {
$value = $this->request->getVal( $prefix . $name );
- 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 getRadioElements
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getRadioElements( $params ) {
if ( !isset( $params['controlName'] ) ) {
$params['controlName'] = 'config_' . $params['var'];
}
- 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"