File OptionDisplay.php
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* *****************************************************************************
* Contributions to this work were made on behalf of the GÉANT project, a
Function enumerateOptionsToDisplay
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function enumerateOptionsToDisplay($class, $fed, $device='')
{
$optioninfo = \core\Options::instance();
$loggerInstance = new \core\common\Logging();
$list = $optioninfo->availableOptions($class);
- 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 selectElement
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function selectElement($rowid, $list)
{
$jsmagic = "onchange='
if (/#ML#/.test(document.getElementById(\"option-S" . $rowid . "-select\").value)) {
document.getElementById(\"S$rowid-input-langselect\").style.display = \"block\";
Method prefillText
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function prefillText(int $rowid, string $optionName, string $optionValue, $optionLang)
{
\core\common\Entity::intoThePotatoes();
$retval = "";
$optioninfo = \core\Options::instance();
Method enumerateOptionsToDisplay
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function enumerateOptionsToDisplay($class, $fed, $device='')
{
$optioninfo = \core\Options::instance();
$loggerInstance = new \core\common\Logging();
$list = $optioninfo->availableOptions($class);
Function prefillText
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function prefillText(int $rowid, string $optionName, string $optionValue, $optionLang)
{
\core\common\Entity::intoThePotatoes();
$retval = "";
$optioninfo = \core\Options::instance();
- 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 selectElement
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function selectElement($rowid, $list)
{
$jsmagic = "onchange='
if (/#ML#/.test(document.getElementById(\"option-S" . $rowid . "-select\").value)) {
document.getElementById(\"S$rowid-input-langselect\").style.display = \"block\";
- 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 prefilledOptionTable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function prefilledOptionTable(string $attributePrefix, $fed)
{
$retval = "<table id='expandable_$attributePrefix" . "_options'>";
$prepopulate = [];
- 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 optiontext
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function optiontext(array $list, string $prefillValue = NULL, string $prefillLang = NULL)
{
$rowid = mt_rand();
$retval = "<tr id='option-S$rowid' style='vertical-align:top'>";
- 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"