Showing 4,652 of 306,333 total issues
Function formatToDb
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function formatToDb($value, $leadingZeros = false)
{
if ($leadingZeros) {
$delim = ['/', '.'];
foreach ($delim as $delimiter) {
- 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 getFieldItemByName
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldItemByName($name)
{
if (isset($this->items[$name])) {
return $this->items[$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
Function import
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function import(App\Request $request): void
{
if (empty($_FILES['file']['name'])) {
throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
}
- 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 process
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$summary = $request->get('summary');
$moduleName = $request->getByType('module_name', 2);
$conditions = $request->getArray('conditions', 'Text');
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldInstanceByName($name)
{
switch ($name) {
case 'subject':
$params = [
- 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 executeCron
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function executeCron($whoTrigger)
{
\App\Log::trace('Start executeCron');
if (!self::isPermissionToScan($whoTrigger)) {
\App\Log::warning(\App\Language::translate('ERROR_ACTIVE_CRON', 'OSSMailScanner'));
- 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 add
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function add()
{
$contactId = (int) $this->mail->findEmailAddress('from_email', 'Contacts', false);
$parentId = (int) $this->mail->findEmailAddress('from_email', 'Accounts', false);
$record = Vtiger_Record_Model::getCleanInstance('HelpDesk');
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
public function saveToDb()
{
$db = \App\Db::getInstance('admin');
$tablesData = $this->getId() ? array_intersect_key($this->getData(), $this->changes) : array_intersect_key($this->getData(), array_flip($this->getModule()->getEditableFields()));
if ($tablesData) {
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
public function saveToDb()
{
$db = \App\Db::getInstance('admin');
$tablesData = $this->getId() ? array_intersect_key($this->getData(), $this->changes) : array_intersect_key($this->getData(), array_flip($this->getModule()->getEditableFields()));
if ($tablesData) {
- 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 getDefaultUserId
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function getDefaultUserId($widgetModel, $moduleName = false, $owner = false)
{
\App\Log::trace('Entering ' . __METHOD__);
$currentUser = \App\User::getCurrentUserModel();
$user = '';
- 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 addWorkflowConditionsToQueryGenerator
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function addWorkflowConditionsToQueryGenerator(App\QueryGenerator $queryGenerator, $conditions)
{
$conditionMapping = [
'equal to' => 'e',
'less than' => 'l',
- 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 performTasks
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function performTasks(Vtiger_Record_Model $recordModel, ?array $tasks = null)
{
require_once 'modules/com_vtiger_workflow/VTTaskManager.php';
require_once 'modules/com_vtiger_workflow/VTTaskQueue.php';
- 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 doTask
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function doTask($recordModel)
{
$referenceFields = $recordModel->getModule()->getFieldsByReference();
$referenceIds = [];
foreach ($referenceFields as $fieldModel) {
- 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 setCardAddres
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function setCardAddres(Sabre\VObject\Component $vcard, $moduleName, $record)
{
$adr1 = $adr2 = [];
if ('Contacts' === $moduleName) {
if (!empty($record['addresslevel5a'])) {
- 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 getStructure
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getStructure(): array
{
$structure = [];
$moduleName = $this->recordModel->getModuleName();
$textParser = App\TextParser::getInstanceByModel($this->recordModel);
- 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 save
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function save(): bool
{
$relatedRecord = $this->getRelatedRecord();
$relatedId = $relatedModule = false;
if (false !== $relatedRecord) {
- 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 __getParentAccounts
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function __getParentAccounts($id, &$parentAccounts, &$encounteredAccounts, $depthBase = 0)
{
\App\Log::trace('Entering __getParentAccounts(' . $id . ') method ...');
if ($depthBase == App\Config::module('Accounts', 'MAX_HIERARCHY_DEPTH')) {
\App\Log::error('Exiting __getParentAccounts method ... - exceeded maximum depth of hierarchy');
- 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 entityAfterSave
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function entityAfterSave(App\EventHandler $eventHandler)
{
$recordModel = $eventHandler->getRecordModel();
if ($recordModel->isNew()) {
(new \App\BatchMethod(['method' => 'Project_Module_Model::updateProgress', 'params' => [$recordModel->get('projectmilestoneid')]]))->save();
- 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 searchAccountsToConvert
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function searchAccountsToConvert(Vtiger_Record_Model $recordModel)
{
\App\Log::trace('Start ' . __METHOD__);
if ($recordModel) {
$mappingFields = Vtiger_Processes_Model::getConfig('marketing', 'conversion', 'mapping');
- 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 validate
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function validate($value, $isUserFormat = false)
{
if (empty($value) || isset($this->validate[$value])) {
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"