YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function timeCounter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        timeCounter: function () {
            if (this.counter === false) {
                this.sec = parseInt(this.sec);
                this.min = parseInt(this.min);
                this.hr = parseInt(this.hr);

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 autoCompleteEvent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        autoCompleteEvent() {
            let autoCompleteElement = $('input.treeAutoComplete', this.container);
            if (autoCompleteElement.hasClass('ui-autocomplete-input')) {
                autoCompleteElement.autocomplete('destroy');
            }
Severity: Minor
Found in public_html/layouts/resources/Fields.js - About 1 hr 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 loadEditor has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

            loadEditor(element, customConfig) {
                this.setElement(element);
                const instance = this.getEditorInstanceFromName();
                let config = {
                    language: CONFIG.langKey,
Severity: Minor
Found in public_html/layouts/resources/Fields.js - About 1 hr 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 registerCopyClipboard has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        registerCopyClipboard: function (container, key = '.clipboard') {
            if (typeof container !== 'object' || $(container).length === 0) {
                return;
            }
            container = $(container).get(0);
Severity: Minor
Found in public_html/layouts/resources/Fields.js - About 1 hr 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 invokeValidation has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

         */invokeValidation:function invokeValidation(field,rules,k,options){//If validation engine already maked the field as error
// we dont want to proceed
if("undefined"==typeof options||!0!==options.isError){var listOfValidators=Vtiger_Base_Validator_Js.getValidator(field);for(var i in listOfValidators){var validatorList=listOfValidators[i],validatorName=validatorList.name,validatorInstance=new validatorName,result=void 0;if(validatorInstance.setElement(field),result=validatorList.hasOwnProperty("params")?validatorInstance.validate(validatorList.params):validatorInstance.validate(),!result)return validatorInstance.getError()}}},/**
Severity: Minor
Found in public_html/layouts/resources/validator/BaseValidator.min.js - About 1 hr 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 setPicklistValues has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function setPicklistValues($values)
    {
        // Non-Role based picklist values
        if (16 === $this->uitype) {
            $this->setNoRolePicklistValues($values);
Severity: Minor
Found in vtlib/Vtiger/Field.php - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
Open

        validate: function () {
            var response = this._super();
            if (response !== true) {
                return response;
            }
Severity: Minor
Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr 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 __create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function __create()
    {
        \App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
        $db = \App\Db::getInstance();

Severity: Minor
Found in vtlib/Vtiger/ModuleBasic.php - About 1 hr 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 getCRMRecordMetadata has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getCRMRecordMetadata($mixedid)
    {
        $multimode = \is_array($mixedid);

        $ids = $multimode ? $mixedid : [$mixedid];
Severity: Minor
Found in vtlib/Vtiger/Functions.php - About 1 hr 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 testGetSourceVariable has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function testGetSourceVariable()
    {
        $this->assertFalse(\App\TextParser::getInstance('Leads')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable(), 'TextParser::getSourceVariable() should return false for Leads module');
        $arr = \App\TextParser::getInstance('Campaigns')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable();
        $this->assertIsArray($arr, 'Expected array type');
Severity: Minor
Found in tests/App/TextParser.php - About 1 hr 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 findError has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function findError(): void
    {
        $source = $this->driver->getPageSource();
        if (false !== stripos($source, 'YetiError!!!')) {
            // @codeCoverageIgnoreStart
Severity: Minor
Found in tests/GuiBase.php - About 1 hr 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 setRelatedList has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function setRelatedList($moduleInstance, $label = '', $actions = false, $functionName = 'getRelatedList', $fieldName = null, $fields = [])
    {
        $db = \App\Db::getInstance();
        if (empty($moduleInstance)) {
            return;
Severity: Minor
Found in vtlib/Vtiger/Module.php - About 1 hr 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 getColumnsByCvidFromDb has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function getColumnsByCvidFromDb($cvId)
    {
        \App\Log::trace(__METHOD__ . ' - ' . $cvId);
        $columnList = [];
        if (is_numeric($cvId)) {
Severity: Minor
Found in app/CustomView.php - About 1 hr 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 getRealPathFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getRealPathFile(string $filePath, string $fileExtension, array $layoutPaths): string
    {
        $realPath = '';
        $checkMin = \vtlib\Functions::getMinimizationOptions($fileExtension);
        foreach ($layoutPaths as $layoutPath) {
Severity: Minor
Found in include/Loader.php - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): void
    {
        $this->status = 1;
        if (($ip = \App\RequestUtil::getRemoteIP(true)) && ($blackList = \App\Mail\Rbl::findIp($ip, true))) {
            foreach ($blackList as $row) {
Severity: Minor
Found in app/SystemWarnings/Security/CheckServerIpInBlackList.php - About 1 hr 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 setLevels has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function setLevels($levels)
    {
        if (\is_array($levels)) {
            foreach ($levels as $level) {
                if (isset(self::$levelMap[$level])) {
Severity: Minor
Found in app/Log.php - About 1 hr 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 getOrignOrDefaultImgPath has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getOrignOrDefaultImgPath($imageFileName, $defaultFileName)
    {
        $basePath = '';
        if (!IS_PUBLIC_DIR) {
            $basePath = 'public_html/';
Severity: Minor
Found in include/runtime/Theme.php - About 1 hr 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 initFieldValuesAuto has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function initFieldValuesAuto()
    {
        foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
            foreach ($this->sourceModuleModel->getFields() as $fieldModel) {
                if ('picklist' === $fieldModel->getFieldDataType()) {
Severity: Minor
Found in app/RecordConverter.php - About 1 hr 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 getConditionsFromRequest has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getConditionsFromRequest(array $conditions): array
    {
        if (isset($conditions['rules'])) {
            foreach ($conditions['rules'] as &$condition) {
                if (isset($condition['condition'])) {
Severity: Minor
Found in app/Condition.php - About 1 hr 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 findByRecordNumber has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function findByRecordNumber(array $numbers, string $moduleName, array $fields): array
    {
        $return = [];
        foreach ($numbers as $i => $number) {
            if (isset(self::$recordNumberCache[$moduleName][$number])) {
Severity: Minor
Found in app/Mail/RecordFinder.php - About 1 hr 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