YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function showConfirmModal has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    showConfirmModal: function (params) {
        let confirmButtonLabel = 'JS_OK';
        let rejectedButtonLabel = 'JS_CANCEL';
        if (typeof params.confirmButtonLabel !== 'undefined') {
            confirmButtonLabel = params.confirmButtonLabel;
Severity: Minor
Found in public_html/layouts/resources/app.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 validate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        validate: function (dependentFieldList) {
            let thisInstance = this;
            let field = this.getElement();
            let fieldDateTime = '';
            let fieldDateTimeInstance = [];
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 getModuleData has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getModuleData($mixed)
    {
        if (empty($mixed)) {
            \App\Log::error(__METHOD__ . ' - Required parameter missing');

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

    public static function updateTool(ModuleBasic $moduleInstance, $toolAction, $flag, $profileid = false)
    {
        $actionId = \App\Module::getActionId($toolAction);
        if ($actionId) {
            $permission = (true === $flag) ? '0' : '1';
Severity: Minor
Found in vtlib/Vtiger/Access.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 recurseDelete has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function recurseDelete($src, $outsideRoot = false): int
    {
        $rootDir = ($outsideRoot || 0 === strpos($src, ROOT_DIRECTORY)) ? '' : ROOT_DIRECTORY . \DIRECTORY_SEPARATOR;
        if (!file_exists($rootDir . $src)) {
            return 0;
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 setEntityIdentifier has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function setEntityIdentifier(FieldBasic $fieldInstance)
    {
        $db = \App\Db::getInstance();

        if ($this->basetableid) {
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 getContextMessage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getContextMessage()
    {
        if (ROOT_DIRECTORY !== getcwd()) {
            chdir(ROOT_DIRECTORY);
        }
Severity: Minor
Found in app/Log/FileTarget.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 activate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function activate(string $moduleName, string $fieldName): bool
    {
        $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
        if (!($fieldModel = $moduleModel->getFieldByName($fieldName))) {
            return false;
Severity: Minor
Found in app/RecordStatus.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 __construct has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($media = '')
    {
        parent::__construct();
        $this->debugging = App\Config::debug('DISPLAY_DEBUG_VIEWER');

Severity: Minor
Found in include/runtime/Viewer.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 endTest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function endTest(Test $test, float $time): void
    {
        if ($this->debug) {
            $time = round($time, 2);
            echo " - $time second(s) | Assertions: " . $test->getNumAssertions();
Severity: Minor
Found in tests/setup/printer.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 translationModify has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function translationModify(string $language, string $fileName, string $type, string $label, string $translation, bool $remove = false)
    {
        $fileLocation = explode('__', $fileName, 2);
        array_unshift($fileLocation, 'custom', 'languages', $language);
        $fileDirectory = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . implode(\DIRECTORY_SEPARATOR, $fileLocation) . '.' . static::FORMAT;
Severity: Minor
Found in app/Language.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 checkQuickChangerConditions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function checkQuickChangerConditions(array $field, \Vtiger_Record_Model $recordModel)
    {
        $return = false;
        foreach ($field['conditions'] as $fieldName => $value) {
            if ($recordModel->get($fieldName) !== $value) {
Severity: Minor
Found in app/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 updateByType has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private function updateByType(string $type): void
    {
        $types = ['patches', 'version'];
        if (!\in_array($this->climate->arguments->get('type'), $types)) {
            $this->climate->white('Type not found. Allowed types:')->columns($types);
Severity: Minor
Found in app/Cli/System.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 isAvailable has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isAvailable(\Vtiger_Record_Model $recordModel, string $view = '', ?int $userId = null): bool
    {
        $result = false;
        if (null === $userId) {
            $userId = \App\User::getCurrentUserId();
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 getMultiDimensionArray has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMultiDimensionArray(string $key, array $template): array
    {
        $return = [];
        if (isset($this->purifiedValuesByMultiDimension[$key])) {
            $return = $this->purifiedValuesByMultiDimension[$key];
Severity: Minor
Found in app/Request.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 employee has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function employee($fieldName)
    {
        $userId = User::getCurrentUserId();
        if (Cache::has('TextParserEmployeeDetail', $userId . $fieldName)) {
            return Cache::get('TextParserEmployeeDetail', $userId . $fieldName);
Severity: Minor
Found in 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 getAll has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAll()
    {
        if (!\App\RequestUtil::isNetConnection()) {
            \App\Log::warning('ERR_NO_INTERNET_CONNECTION', __METHOD__);
            return [];
Severity: Minor
Found in app/Installer/Languages.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 checkAndConvertJsScripts has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkAndConvertJsScripts($jsFileNames)
    {
        $fileExtension = 'js';
        $instances = [];
        $min = \App\Config::developer('MINIMIZE_JS');
Severity: Minor
Found in app/Controller/View/Base.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 checkAndConvertCssStyles has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkAndConvertCssStyles($fileNames, $fileExtension = 'css')
    {
        $instances = [];
        $min = \App\Config::developer('MINIMIZE_CSS');
        $layoutPaths = \App\Layout::getLayoutPaths();
Severity: Minor
Found in app/Controller/View/Base.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 parseConditions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private function parseConditions(\App\QueryGenerator $queryGenerator, array $searchParams, ?int $userId)
    {
        foreach ($searchParams as &$conditions) {
            if (empty($conditions)) {
                continue;
Severity: Minor
Found in app/TextParser/UserRecordsList.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