File UIElements.php
has 439 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 infoblock
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function infoblock(array $optionlist, string $class, string $level) {
\core\common\Entity::intoThePotatoes();
$locationMarkers = [];
$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
Method displayName
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function displayName($input) {
\core\common\Entity::intoThePotatoes();
$ssidText = _("SSID");
$passpointOiText = _("HS20 Consortium OI");
Method infoblock
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function infoblock(array $optionlist, string $class, string $level) {
\core\common\Entity::intoThePotatoes();
$locationMarkers = [];
$retval = "";
$optioninfo = \core\Options::instance();
Method previewCAinHTML
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function previewCAinHTML($cAReference) {
\core\common\Entity::intoThePotatoes();
$validator = new \web\lib\common\InputValidation();
$ref = $validator->databaseReference($cAReference);
$caExpiryTrashhold = \config\ConfAssistant::CERT_WARNINGS['expiry_warning'];
UIElements
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class UIElements extends \core\common\Entity {
/**
* the custom displayable variant of the term 'federation'
*
Function previewCAinHTML
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function previewCAinHTML($cAReference) {
\core\common\Entity::intoThePotatoes();
$validator = new \web\lib\common\InputValidation();
$ref = $validator->databaseReference($cAReference);
$caExpiryTrashhold = \config\ConfAssistant::CERT_WARNINGS['expiry_warning'];
- 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 getBlobFromDB
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getBlobFromDB($table, $rowindex, $checkpublic) {
// the data is either public (just give it away) or not; in this case, only
// release if the data belongs to admin himself
if ($checkpublic) {
- 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 pngInjectConsortiumLogo
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function pngInjectConsortiumLogo(string $inputpngstring, int $symbolsize, int $marginsymbols = 4) {
$loggerInstance = new \core\common\Logging();
$inputgd = imagecreatefromstring($inputpngstring);
if ($inputgd === FALSE) { // source image is bogus; don't do anything
return "";
Method instLevelInfoBoxes
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function instLevelInfoBoxes(\core\IdP $myInst) {
\core\common\Entity::intoThePotatoes();
$idpoptions = $myInst->getAttributes();
$retval = "<div class='infobox'>
<h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant) . "</h2>
Method boxFlexible
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boxFlexible(int $level, string $text = NULL, string $caption = NULL, bool $omittabletags = FALSE) {
\core\common\Entity::intoThePotatoes();
$uiMessages = [
\core\common\Entity::L_OK => ['img' => 'Tabler/square-rounded-check-filled-green.svg', 'text' => _("OK")],
\core\common\Entity::L_REMARK => ['img' => 'Tabler/info-square-rounded-filled-blue.svg', 'text' => _("Remark")],
Method sanityTestResultHTML
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sanityTestResultHTML($test) {
$out = '';
switch ($test->test_result['global']) {
case \core\common\Entity::L_OK:
$message = "Your configuration appears to be fine.";
Function sanityTestResultHTML
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function sanityTestResultHTML($test) {
$out = '';
switch ($test->test_result['global']) {
case \core\common\Entity::L_OK:
$message = "Your configuration appears to be fine.";
- 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"