YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getMainParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    getMainParams: function (param, json) {
        if (param in CONFIG) {
            return CONFIG[param];
        }
        if (app.cacheParams[param] === undefined) {
Severity: Minor
Found in public_html/layouts/resources/app.js - About 25 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 toggleRightPanel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    toggleRightPanel({ commit, getters }, newValue) {
        if (getters.mobileMode) {
            commit('setRightPanelMobile', newValue !== undefined ? newValue : !getters['rightPanelMobile'])
        } else {
            commit('setRightPanel', newValue !== undefined ? newValue : !getters['rightPanel'])
Severity: Minor
Found in public_html/src/layouts/basic/modules/Chat/store/actions.js - About 25 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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        validate: function (dependentFieldList) {
            var field = this.getElement();
            var fieldLabel = field.data('fieldinfo').label;
            var status = field.val();
            var contextFormElem = field.closest('form');
Severity: Minor
Found in public_html/layouts/resources/validator/FieldValidator.js - About 25 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 getCurrentUserEntityFieldNameDisplay has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getCurrentUserEntityFieldNameDisplay($module, $fieldsName, $fieldValues)
    {
        if (false === strpos($fieldsName, ',')) {
            return $fieldValues[$fieldsName];
        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php - About 25 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 updateFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateFields($blocknode, $blockInstance, $moduleInstance)
    {
        if (empty($blocknode->fields) || empty($blocknode->fields->field)) {
            return;
        }
Severity: Minor
Found in vtlib/Vtiger/PackageUpdate.php - About 25 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 initForModule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function initForModule(ModuleBasic $moduleInstance)
    {
        $db = \App\Db::getInstance();
        $actionids = (new \App\Db\Query())->select(['actionid'])->from('vtiger_actionmapping')
            ->where(['actionname' => ['Save', 'EditView', 'Delete', 'index', 'DetailView', 'CreateView']])
Severity: Minor
Found in vtlib/Vtiger/Profile.php - About 25 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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function initialize($valuemap)
    {
        foreach ($valuemap as $key => $value) {
            if (!empty($value) && ('linkurl' == $key || 'linkicon' == $key)) {
                $this->{$key} = \App\Purifier::decodeHtml($value);
Severity: Minor
Found in vtlib/Vtiger/Link.php - About 25 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 importModule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function importModule()
    {
        $moduleName = (string) $this->_modulexml->name;
        $tabLabel = $this->_modulexml->label;
        $tabVersion = $this->_modulexml->version;
Severity: Minor
Found in vtlib/Vtiger/PackageImport.php - About 25 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 updateCustomViews has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateCustomViews($modulenode, $moduleInstance)
    {
        if (empty($modulenode->customviews) || empty($modulenode->customviews->customview)) {
            return;
        }
Severity: Minor
Found in vtlib/Vtiger/PackageUpdate.php - About 25 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 testLoadFiles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function testLoadFiles()
    {
        static::assertTrue(\App\Installer\Languages::download('pl-PL'), 'Error while downloading the language "pl-PL"');
        $parser = new \Seld\JsonLint\JsonParser();
        foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'languages', \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
Severity: Minor
Found in tests/Init/LanguageFilesTest.php - About 25 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 getInstance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getInstance($value, $module = false)
    {
        $tabId = is_numeric($module) ? $module : \App\Module::getModuleId($module);
        $cacheName = $value . '|' . $tabId;
        if (\App\Cache::has('BlockInstance', $cacheName)) {
Severity: Minor
Found in vtlib/Vtiger/Block.php - About 25 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 testBanks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function testBanks()
    {
        $dataReader = (new \App\Db\Query())->select(['id', 'currency_code'])
            ->from('vtiger_currency_info')
            ->where(['currency_status' => 'Active', 'deleted' => 0])
Severity: Minor
Found in tests/Settings/CurrencyUpdate.php - About 25 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 deleteIcons has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function deleteIcons()
    {
        \App\Log::trace('Start', __METHOD__);
        $iconSize = ['', 48, 64, 128];
        $layouts = array_keys(\App\Layout::getAllLayouts());
Severity: Minor
Found in vtlib/Vtiger/ModuleBasic.php - About 25 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 testAddPicklistColorColumn has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function testAddPicklistColorColumn()
    {
        $db = \App\Db::getInstance();
        $tableSchema = $db->getSchema()->getTableSchema('vtiger_contract_priority', true);
        $this->assertNotEmpty($tableSchema, 'Table vtiger_contract_priority not exists');
Severity: Minor
Found in tests/Settings/Colors.php - About 25 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 testGetRelatedVariable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function testGetRelatedVariable()
    {
        $arr = self::$parserCleanModule->getRelatedVariable();
        $this->assertIsArray($arr, 'Expected array type');
        $this->assertNotEmpty($arr, 'Expected any related variables data');
Severity: Minor
Found in tests/App/TextParser.php - About 25 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 getListViewFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListViewFields(): array
    {
        $headerFields = [];
        foreach ($this->getFields() as $fieldName) {
            if ($model = $this->getModuleField($fieldName)) {
Severity: Minor
Found in app/QueryGenerator.php - About 25 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 getLast has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getLast(int $record, ?int $userId = null): ?array
    {
        if (null === $userId) {
            $userId = \App\User::getCurrentUserRealId();
        }
Severity: Minor
Found in app/Components/InterestsConflict.php - About 25 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 export has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function export()
    {
        $text = implode("\n", array_map([$this, 'formatMessage'], $this->messages));
        if (false === ($fp = fopen($this->logFile, 'a'))) {
            throw new InvalidConfigException("Unable to append to log file: {$this->logFile}");
Severity: Minor
Found in app/Log/FileTarget.php - About 25 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 addToQueueWhenParentHasBeenModified has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function addToQueueWhenParentHasBeenModified(\Vtiger_Record_Model $recordModel)
    {
        if (!empty($this->targetColumnParentId) && false !== ($previousValue = $recordModel->getPreviousValue($this->targetColumnParentId))) {
            if (!empty($previousValue)) {
                $this->addToQueueSubordinateModule($previousValue);
Severity: Minor
Found in app/Automatic/RecordFlowUpdater.php - About 25 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 getStates has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getStates(string $moduleName, int $state = null)
    {
        $fieldName = static::getFieldName($moduleName);
        $primaryKey = Fields\Picklist::getPickListId($fieldName);
        $values = [];
Severity: Minor
Found in app/RecordStatus.php - About 25 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