YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getFieldInstanceByName has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName(string $name, string $label = ''): Vtiger_Field_Model
    {
        $moduleName = $this->getModule()->getName(true);
        $labels = $this->getModule()->getFormFields();
        $label = $label ?: ($labels[$name]['label'] ?? '');
Severity: Minor
Found in modules/Settings/Companies/models/Record.php - About 55 mins 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 getPicklistValuesForRole has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPicklistValuesForRole($roleIdList, $groupMode = 'INTERSECTION')
    {
        if (!$this->isRoleBased()) {
            $fieldModel = new Vtiger_Field_Model();
            return $fieldModel->getPicklistValues();
Severity: Minor
Found in modules/Settings/Picklist/models/Field.php - About 55 mins 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 getFormatLoginHistory has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFormatLoginHistory(array $row): array
    {
        foreach ($row as $key => $value) {
            switch ($key) {
                case 'time':
Severity: Minor
Found in modules/Settings/WebserviceUsers/models/Record.php - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $sSingleOrderTabId = \App\Module::getModuleId('SSingleOrders');
        $fInvoiceTabId = \App\Module::getModuleId('FInvoice');
        $productCategoryId = \App\Module::getModuleId('ProductCategory');
Severity: Minor
Found in modules/Settings/Magento/actions/Active.php - About 55 mins 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 getConfig has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getConfig($type = false)
    {
        \App\Log::trace('Start ' . __METHOD__ . " | Type: $type");
        $cache = Vtiger_Cache::get('SalesProcesses', false === $type ? 'all' : $type);
        if ($cache) {
Severity: Minor
Found in modules/Settings/SalesProcesses/models/Module.php - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name)
    {
        $moduleName = $this->getModule()->getName(true);
        $fields = $this->getModule()->getFormFields();
        $params = ['label' => 'LBL_' . \strtoupper($name), 'fieldvalue' => $this->get($name) ?? $fields[$name]['default'] ?? '', 'typeofdata' => 'V'];
Severity: Minor
Found in modules/Settings/Magento/models/Record.php - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request): void
    {
        try {
            $recordModel = Settings_Companies_Record_Model::getInstance();
            $fields = $recordModel->getModule()->getFormFields();
Severity: Minor
Found in modules/Settings/Companies/actions/SaveAjax.php - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $recordId = $request->getInteger('id');
        $pdfModel = Vtiger_PDF_Model::getInstanceById($recordId);

Severity: Minor
Found in modules/Settings/PDF/actions/ExportTemplate.php - About 55 mins 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 getSameLevelRoles has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSameLevelRoles()
    {
        if (!isset($this->children)) {
            $parentRoles = \App\PrivilegeUtil::getParentRole($this->getId());
            $currentRoleDepth = $this->getDepth();
Severity: Minor
Found in modules/Settings/Roles/models/Record.php - About 55 mins 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 getEditFieldsModel has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getEditFieldsModel()
    {
        $moduleName = $this->getModule()->getName(true);
        $mainParams = ['uitype' => 1, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
        $fieldModels = [];
Severity: Minor
Found in modules/Settings/PBX/models/Record.php - About 55 mins 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 importWorkflow has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function importWorkflow(array $data)
    {
        $db = App\Db::getInstance();
        $dbCommand = App\Db::getInstance()->createCommand();
        $dbCommand->insert($this->getBaseTable(), $data['fields'])->execute();
Severity: Minor
Found in modules/Settings/Workflows/models/Module.php - About 55 mins 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 setTileLayer has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function setTileLayer(App\Request $request): void
    {
        $value = $request->getByType('vale', 'Text');
        $oldValue = \App\Config::module('OpenStreetMap', 'tileLayerServer');
        $all = \App\Config::module('OpenStreetMap', 'tileLayerServers');
Severity: Minor
Found in modules/Settings/Map/actions/Config.php - About 55 mins 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 removeMenu has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function removeMenu($ids)
    {
        $db = \App\Db::getInstance();
        if (!\is_array($ids)) {
            $ids = [$ids];
Severity: Minor
Found in modules/Settings/Menu/models/Record.php - About 55 mins 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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function update(App\Request $request): void
    {
        $db = \App\Db::getInstance('admin');
        $requestMode = \in_array($request->getByType('type'), ['forVerification', 'toSend', 'request']);
        $response = new Vtiger_Response();
Severity: Minor
Found in modules/Settings/MailRbl/actions/SaveAjax.php - About 55 mins 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 deleteDir has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function deleteDir($dir)
    {
        $fd = opendir($dir);
        if (!$fd) {
            return false;
Severity: Minor
Found in modules/Settings/LangManagement/models/Module.php - About 55 mins 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 getQuery has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function getQuery(App\Request $request): App\Db\Query
    {
        $columns = [];
        foreach ($request->getArray('columns') as $key => $value) {
            $columns[$key] = $value['data'];
Severity: Minor
Found in modules/Settings/MailRbl/actions/GetData.php - About 55 mins 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 getValuesToSave has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function getValuesToSave(array $data): array
    {
        if (!$this->getId()) {
            $forSave[$this->getModule()->baseTable] = [];
        }
Severity: Minor
Found in modules/Settings/AutomaticAssignment/models/Record.php - About 55 mins 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 getDisplayValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue(string $key): string
    {
        $value = $this->get($key);
        if ('working_days' === $key) {
            $days = explode(',', trim($value, ','));
Severity: Minor
Found in modules/Settings/BusinessHours/models/Record.php - About 55 mins 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 findAndBind has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function findAndBind()
    {
        $mailId = $this->mail->getMailCrmId();
        $recordId = 0;
        if ($mailId) {
Severity: Minor
Found in modules/OSSMailScanner/models/PrefixScannerAction.php - About 55 mins 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 setFolderList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function setFolderList($user, $foldersByType)
    {
        $dbCommand = \App\Db::getInstance()->createCommand();
        $oldFoldersByType = (new \App\Db\Query())->select(['type', 'folder'])->from('vtiger_ossmailscanner_folders_uid')->where(['user_id' => $user])->createCommand()->queryAllByGroup(2);
        foreach (self::$mainFolders as $type) {
Severity: Minor
Found in modules/OSSMailScanner/models/Record.php - About 55 mins 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