Showing 4,652 of 306,333 total issues
Function getAllErrors
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function getAllErrors(bool $cache = false)
{
$fileCache = ROOT_DIRECTORY . '/app_data/ConfReport_AllErrors.php';
if ($cache && file_exists($fileCache) && filemtime($fileCache) > strtotime('-15 minute')) {
return require $fileCache;
- 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 getFieldInstanceByName
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldInstanceByName($name)
{
$params = [];
$qualifiedModuleName = 'Settings:Picklist';
$tableName = $this->getTableName();
- 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 getPayerId
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function getPayerId(): string
{
$bbanLength = $this->countryIban->BBANLength();
$conditionsForPayerId = $this->fieldParams['conditions'];
$payerCharactersAmount = $bbanLength - \strlen($this->fieldParams['sortCode']) - \strlen($this->fieldParams['clientId']);
- 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 find
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function find($value): array
{
if (empty($value) || !\App\RequestUtil::isNetConnection()) {
return [];
}
- 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 getEditFields
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getEditFields(): array
{
$fields = [];
$editFields = ['name'];
$editFields[] = 'icon';
- 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 getQueryInitUsers
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getQueryInitUsers($private = false, $status = false, $roles = false)
{
$entityData = \App\Module::getEntityInfo('Users');
$selectFields = array_unique(array_merge($entityData['fieldnameArr'], ['id' => 'id', 'is_admin', 'cal_color', 'status']));
// Including deleted vtiger_users for now.
- 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 setRecordAddress
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function setRecordAddress(string $moduleName, \Vtiger_Record_Model $record): void
{
foreach ($this->card->ADR as $property) {
if ($typeOfAddress = $this->getTypeOfAddress($property)) {
$address = $this->convertAddress($property->getParts());
- 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 cleanAttachments
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function cleanAttachments()
{
foreach ($this->getModule()->getFieldsByType(['image', 'multiImage'], true) as $fieldName => $fieldModel) {
$currentData = [];
if ($this->get($fieldName) && ($this->isNew() || false !== $this->getPreviousValue($fieldName))) {
- 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 flattenKeys
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function flattenKeys(array $array, string $type = '_', float $depth = INF): array
{
$result = [];
foreach ($array as $key => $item) {
if (\is_array($item)) {
- 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 addRoleToPicklist
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function addRoleToPicklist($fields): void
{
\App\Log::trace('Entering ' . __METHOD__);
$db = \App\Db::getInstance();
$schema = $db->getSchema();
- 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 getFields
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getFields(): array
{
$fieldsModel = [];
foreach ($this->fields as $fieldName => $data) {
if (isset($data['picklistValuesFunction'])) {
- 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 isMemberEditable
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function isMemberEditable(string $member): bool
{
$userModel = \App\User::getCurrentUserModel();
[$type, $id] = explode(':', $member);
if (!$userModel->isAdmin() && null === $this->subordinates) {
- 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 transformAdvanceFilterToWorkFlowFilter
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function transformAdvanceFilterToWorkFlowFilter()
{
\App\Log::trace('Entering ' . __METHOD__ . '() method ...');
$conditions = $this->get('conditions');
$wfCondition = [];
- 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 delete
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function delete()
{
$db = \App\Db::getInstance();
try {
parent::delete();
- 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 saveSwitchUsers
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function saveSwitchUsers($data): void
{
$switchUsers = $switchUsersRaw = [];
if (!empty($data) && \count($data)) {
foreach ($data as $row) {
- 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 getTree
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getTree($category = false, $treeValue = false)
{
$tree = [];
$templateId = $this->getId();
if (empty($templateId)) {
- 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 importUserModuleStep2
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function importUserModuleStep2(App\Request $request)
{
$viewer = $this->getViewer($request);
$uploadDir = Settings_ModuleManager_Module_Model::getUploadDirectory();
$qualifiedModuleName = $request->getModule(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 getFieldInstanceByName
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldInstanceByName($name)
{
$moduleName = $this->getModule()->getName(true);
$fieldsLabel = $this->getEditFields();
$params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'label' => $fieldsLabel[$name], 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => 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 saveToDb
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function saveToDb()
{
$db = \App\Db::getInstance('admin');
$tablesData = $this->getValuesForSave();
$transaction = $db->beginTransaction();
- 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 initializeListViewContents
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
{
$qualifiedModuleName = $request->getModule(false);
$pageNumber = $request->getInteger('page');
$orderBy = $request->getForSql('orderby');
- 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"