Function getOneOption
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
private static function getOneOption(
string $section,
string $pluginName,
OptionsPropertyItem $propertyGroup,
bool $isSubgroup = 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
File Plugins.php
has 416 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace PhpMyAdmin;
Method getHtmlForProperty
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getHtmlForProperty(
string $section,
string $pluginName,
OptionsPropertyItem $propertyItem,
): string {
Method getOneOption
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function getOneOption(
string $section,
string $pluginName,
OptionsPropertyItem $propertyGroup,
bool $isSubgroup = false,
Function getOptions
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function getOptions(string $section, array $list): string
{
$ret = '';
// Options for plugins that support them
foreach ($list as $plugin) {
- 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 getPlugins
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private static function getPlugins(string $type): array
{
try {
$files = new FilesystemIterator(ROOT_PATH . 'src/Plugins/' . $type);
} catch (Throwable) {
- 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 getHtmlForProperty
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function getHtmlForProperty(
string $section,
string $pluginName,
OptionsPropertyItem $propertyItem,
): string {
- 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 getPlugins
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function getPlugins(string $type): array
{
try {
$files = new FilesystemIterator(ROOT_PATH . 'src/Plugins/' . $type);
} catch (Throwable) {
Method getOptions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getOptions(string $section, array $list): string
{
$ret = '';
// Options for plugins that support them
foreach ($list as $plugin) {
Function getDefault
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function getDefault(string $section, string $opt): string
{
if (isset($_GET[$opt])) {
// If the form is being repopulated using $_GET data, that is priority
return htmlspecialchars($_GET[$opt]);
- 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
Avoid too many return
statements within this method. Open
return htmlspecialchars($val);