File ListConfiguration.php
has 655 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use Admidio\Exception;
/**
* @brief Class manages the list configuration
Function getSQL
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
public function getSQL(array $options = array()): string
{
global $gL10n, $gProfileFields;
// create array with all options
- 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 convertColumnContentForOutput
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
public function convertColumnContentForOutput(int $columnNumber, string $format, string $content, string $userUuid, bool $setSortValue = true)
{
global $gDb, $gProfileFields, $gL10n, $gSettingsManager;
$column = $this->getColumnObject($columnNumber);
- 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 getSQL
has 215 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSQL(array $options = array()): string
{
global $gL10n, $gProfileFields;
// create array with all options
Method convertColumnContentForOutput
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function convertColumnContentForOutput(int $columnNumber, string $format, string $content, string $userUuid, bool $setSortValue = true)
{
global $gDb, $gProfileFields, $gL10n, $gSettingsManager;
$column = $this->getColumnObject($columnNumber);
Function readColumns
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function readColumns()
{
global $gCurrentUser, $gProfileFields;
$this->columns = array();
- 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 getSearchConditions
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getSearchConditions(): array
{
global $gProfileFields;
$arrSearchConditions = array();
- 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 getSearchConditions
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSearchConditions(): array
{
global $gProfileFields;
$arrSearchConditions = array();
Method getColumnAlignments
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getColumnAlignments(): array
{
global $gProfileFields;
$arrColumnAlignments = array();
Method getColumnNames
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getColumnNames(): array
{
global $gL10n, $gProfileFields;
$arrColumnNames = array();
Function getColumnAlignments
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getColumnAlignments(): array
{
global $gProfileFields;
$arrColumnAlignments = array();
- 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 readColumns
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readColumns()
{
global $gCurrentUser, $gProfileFields;
$this->columns = array();
Consider simplifying this complex logical expression. Open
if ($usfId > 0 && $usfId === (int)$gProfileFields->getProperty('COUNTRY', 'usf_id')) {
$content = $gL10n->getCountryName($content);
} elseif ($column->getValue('lsc_special_field') === 'usr_photo') {
// show user photo
if (in_array($format, array('html', 'print'), true)) {
Function removeColumn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function removeColumn(string $columnNameOrUsfId)
{
$currentNumber = 1;
// check for every column if the number is expected otherwise set new number
- 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 addColumn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function addColumn($field, int $number = 0, string $sort = '', string $filter = ''): bool
{
global $gCurrentUser;
if ($number === 0) {
- 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 convertColumnContentForOutput
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function convertColumnContentForOutput(int $columnNumber, string $format, string $content, string $userUuid, bool $setSortValue = true)
Function getColumnNamesSql
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getColumnNamesSql(): array
{
global $gProfileFields;
if (count($this->columnsSqlNames) === 0) {
- 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 deleteColumn
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function deleteColumn(int $number, bool $all = false): bool
{
if ($number > $this->countColumns()) {
return 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"