Function getHtmlValue
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
public function getHtmlValue(string $fieldNameIntern, $value, string $value2 = '')
{
global $gSettingsManager, $gL10n;
if (!array_key_exists($fieldNameIntern, $this->mProfileFields)) {
- 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 setValue
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
public function setValue(string $fieldNameIntern, $fieldValue, bool $checkValue = true): bool
{
global $gSettingsManager, $gL10n;
if (!array_key_exists($fieldNameIntern, $this->mProfileFields)) {
- 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 ProfileFields.php
has 445 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use Admidio\Exception;
/**
* @brief Reads the user fields structure out of database and give access to it
Function getValue
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function getValue(string $fieldNameIntern, string $format = '')
{
$value = '';
// exists a profile field with that 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
Method getHtmlValue
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHtmlValue(string $fieldNameIntern, $value, string $value2 = '')
{
global $gSettingsManager, $gL10n;
if (!array_key_exists($fieldNameIntern, $this->mProfileFields)) {
Method setValue
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setValue(string $fieldNameIntern, $fieldValue, bool $checkValue = true): bool
{
global $gSettingsManager, $gL10n;
if (!array_key_exists($fieldNameIntern, $this->mProfileFields)) {
ProfileFields
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class ProfileFields
{
/**
* @var Database An object of the class Database for communication with the database
*/
Method getValue
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getValue(string $fieldNameIntern, string $format = '')
{
$value = '';
// exists a profile field with that name ?
Function readUserData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function readUserData(int $userId, int $organizationId)
{
if (count($this->mProfileFields) === 0) {
$this->readProfileFields($organizationId);
}
- 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 saveUserData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function saveUserData(int $userId)
{
$this->db->startTransaction();
foreach ($this->mUserData as $value) {
- 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 isVisible
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function isVisible(string $fieldNameIntern, bool $allowedToEditProfile = false): bool
{
if (!array_key_exists($fieldNameIntern, $this->mProfileFields)) {
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"