YetiForceCompany/YetiForceCRM

View on GitHub

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) {
Severity: Minor
Found in app/Fields/DateTime.php - About 2 hrs to fix

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];
        }
Severity: Minor
Found in modules/Settings/LayoutEditor/models/Field.php - About 2 hrs to fix

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);
        }
Severity: Minor
Found in modules/Settings/Picklist/actions/SaveAjax.php - About 2 hrs to fix

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');
Severity: Minor
Found in modules/Settings/Workflows/actions/Save.php - About 2 hrs to fix

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 = [
Severity: Minor
Found in modules/Settings/AutomaticAssignment/models/Module.php - About 2 hrs to fix

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'));
Severity: Minor
Found in modules/OSSMailScanner/models/Record.php - About 2 hrs to fix

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');
Severity: Minor
Found in modules/OSSMailScanner/scanneractions/CreatedHelpDesk.php - About 2 hrs to fix

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) {
Severity: Minor
Found in modules/Settings/AutomaticAssignment/models/Record.php - About 2 hrs to fix

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) {
Severity: Minor
Found in modules/Settings/Groups/models/Record.php - About 2 hrs to fix

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 = '';
Severity: Minor
Found in modules/Settings/WidgetsManagement/models/Module.php - About 2 hrs to fix

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',
Severity: Minor
Found in modules/com_vtiger_workflow/WorkFlowScheduler.php - About 2 hrs to fix

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';

Severity: Minor
Found in modules/com_vtiger_workflow/Workflow.php - About 2 hrs to fix

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) {
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTUpdateWorkTime.php - About 2 hrs to fix

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'])) {
Severity: Minor
Found in modules/API/models/CardDAV.php - About 2 hrs to fix

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);
Severity: Minor
Found in modules/Calendar/views/SendInvitationModal.php - About 2 hrs to fix

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) {
Severity: Minor
Found in modules/Notification/models/Record.php - About 2 hrs to fix

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');
Severity: Minor
Found in modules/Accounts/Accounts.php - About 2 hrs to fix

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();
Severity: Minor
Found in modules/ProjectTask/handlers/ProjectTaskHandler.php - About 2 hrs to fix

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');
Severity: Minor
Found in modules/Leads/models/Module.php - About 2 hrs to fix

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;
        }
Severity: Minor
Found in modules/Vtiger/uitypes/Recurrence.php - About 2 hrs to fix

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

Severity
Category
Status
Source
Language