Showing 586 of 740 total issues
File Preferences.php
has 1892 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Admidio\UserInterface;
use ComponentUpdate;
use FileSystemUtils;
File User.php
has 1210 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use Admidio\Exception;
/**
* @brief Class handle role rights, cards and other things of users
File Form.php
has 930 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Admidio\UserInterface;
use Admidio\Exception;
use Database;
File HtmlForm.php
has 898 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use Admidio\Exception;
/**
* @brief Creates an Admidio specific form with special elements
Function makeSqlStatement
has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring. Open
public function makeSqlStatement(string $sourceCondition, string $columnName, string $columnType, string $fieldName): string
{
$conditionComplete = $this->startDestCond($columnType, $columnName, $sourceCondition);
if ($conditionComplete) {
return $this->destCond;
- 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 ComponentUpdateSteps.php
has 866 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use Ramsey\Uuid\Uuid;
use Admidio\Exception;
// this must be declared for backwards compatibility. Can be removed if update scripts don't use it anymore
File FileSystemUtils.php
has 745 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use Admidio\Exception;
/**
Function sendEmail
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
public function sendEmail()
{
global $gSettingsManager, $gLogger, $gDebug, $gValidLogin, $gCurrentUser, $gL10n, $gDisableEmailSending;
$errorMessage = '';
- 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 ListConfiguration.php
has 655 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use Admidio\Exception;
/**
* @brief Class manages the list configuration
File events.php
has 650 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
***********************************************************************************************
* Show a list of all events
*
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 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 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
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
Function createContentCards
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
public function createContentCards()
{
global $gSettingsManager, $gCurrentUser, $gL10n, $gDb;
$templateData = 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 setMembership
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
public function setMembership(int $userId, string $startDate, string $endDate, ?bool $leader = null, bool $forcePeriod = false)
{
global $gCurrentUser, $gCurrentUserId, $gCurrentSession;
$newMembershipSaved = 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
Function generate_listData
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
public function generate_listData()
{
global $gDb, $gProfileFields, $gL10n, $gCurrentOrgId;
$workArray = 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
User
has 68 functions (exceeds 20 allowed). Consider refactoring. Open
class User extends TableAccess
{
public const MAX_INVALID_LOGINS = 3;
/**
Function checkRolesRight
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
public function checkRolesRight(string $right = null): bool
{
$sqlFetchedRows = array();
if ((int)$this->getValue('usr_id') === 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
File profile.php
has 555 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
***********************************************************************************************
* Show user profile
*