YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function addRelatedRecord has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

        addRelatedRecord: function (element, callback) {
            let aDeferred = jQuery.Deferred();
            let referenceModuleName = this.moduleName;
            let parentId = this.getParentId();
            let parentModule = this.parentModuleName;
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js - About 4 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 reloadAfterSave has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    reloadAfterSave: function (responseData, params, form, element) {
        if (responseData.skipReload) {
            return;
        }
        const moduleName = params['module'];
Severity: Minor
Found in public_html/layouts/resources/app.js - About 4 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 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function import($zipfile, $overwrite = false)
    {
        $module = $this->getModuleNameFromZip($zipfile);
        if (null !== $module) {
            $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
Severity: Minor
Found in vtlib/Vtiger/PackageImport.php - About 4 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 update has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function update($moduleInstance, $zipfile, $overwrite = true)
    {
        $module = $this->getModuleNameFromZip($zipfile);
        if (null !== $module) {
            $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
Severity: Minor
Found in vtlib/Vtiger/PackageUpdate.php - About 4 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 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): void
    {
        \App\Utils\ConfReport::saveEnv();
        $this->status = 1;
        $errorsText = '<br>';
Severity: Minor
Found in app/SystemWarnings/SystemRequirements/Configuration.php - About 4 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 validSearchParams has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public static function validSearchParams(string $moduleName, array $searchParams, $convert = true): array
    {
        $searchParamsCount = \count($searchParams);
        if ($searchParamsCount > 2) {
            throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$searchParamsCount}|| > 2||" . Utils::varExport($searchParams, true), 406);
Severity: Minor
Found in app/Condition.php - About 4 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 getBrowserInfo has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getBrowserInfo(): object
    {
        if (empty(self::$browserCache)) {
            $browserAgent = strtolower(\App\Request::_getServer('HTTP_USER_AGENT', ''));

Severity: Minor
Found in app/RequestUtil.php - About 4 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 getWarnings has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getWarnings($folders, $active = true)
    {
        if (empty($folders)) {
            return [];
        }
Severity: Minor
Found in app/SystemWarnings.php - About 4 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 getRelatedRecords has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getRelatedRecords($record, $hierarchy)
    {
        $moduleName = Record::getType($record);
        $records = $recordsLevel1 = $recordsLevel2 = [];
        if (\in_array(0, $hierarchy)) {
Severity: Minor
Found in app/ModuleHierarchy.php - About 4 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 getEmployeeHierarchy has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function getEmployeeHierarchy($id)
    {
        \App\Log::trace('Entering getEmployeeHierarchy(' . $id . ') method ...');

        $listViewHeader = [];
Severity: Minor
Found in modules/OSSEmployees/OSSEmployees.php - About 4 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 getHierarchyData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHierarchyData($id, $baseInfo, $recordId, &$listviewEntries, $getRawData = false, $getLinks = true)
    {
        $moduleName = 'Partners';
        $currentUser = \App\User::getCurrentUserModel();
        $hasRecordViewAccess = $currentUser->isAdmin() || \App\Privilege::isPermitted($moduleName, 'DetailView', $recordId);
Severity: Minor
Found in modules/Partners/Partners.php - About 4 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 getHierarchyData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHierarchyData($id, $baseInfo, $recordId, &$listviewEntries, $getRawData = false, $getLinks = true)
    {
        \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
        $currentUser = Users_Privileges_Model::getCurrentUserModel();
        $hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('MultiCompany', 'DetailView', $recordId);
Severity: Minor
Found in modules/MultiCompany/MultiCompany.php - About 4 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 getHierarchyData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHierarchyData($id, $baseInfo, $recordId, &$listviewEntries, $getRawData = false, $getLinks = true)
    {
        \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
        $currentUser = Users_Privileges_Model::getCurrentUserModel();
        $hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('Competition', 'DetailView', $recordId);
Severity: Minor
Found in modules/Competition/Competition.php - About 4 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 getHierarchyData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHierarchyData($id, $salesProcessesInfoBase, $salesProcessesId, &$listviewEntries, $getRawData = false, $getLinks = true)
    {
        \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $salesProcessesId . ') method ...');

        $currentUser = Users_Privileges_Model::getCurrentUserModel();
Severity: Minor
Found in modules/SSalesProcesses/SSalesProcesses.php - About 4 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 29 (exceeds 5 allowed). Consider refactoring.
Open

    private function performTasks(App\EventHandler $eventHandler, $condition = [])
    {
        $recordModel = $eventHandler->getRecordModel();
        $moduleName = $eventHandler->getModuleName();
        if (!isset($this->workflows[$moduleName])) {
Severity: Minor
Found in modules/Vtiger/handlers/Workflow.php - About 4 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 initializeListViewContents has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
    {
        $moduleName = $request->getModule();
        $pageNumber = $request->getInteger('page');
        $orderBy = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);
Severity: Minor
Found in modules/Vtiger/views/List.php - About 4 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 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStructure(Vtiger_Record_Model $recordModel, App\Request $request): array
    {
        Vtiger_Field_Model::$tabIndexDefaultSeq = 1000;
        $values = [];
        $moduleModel = $recordModel->getModule();
Severity: Minor
Found in modules/Vtiger/views/QuickEditModal.php - About 4 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 getHierarchyData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHierarchyData($id, $iStorageInfoBase, $iStorageId, &$listviewEntries, $getRawData = false, $getLinks = true)
    {
        \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $iStorageId . ') method ...');

        $hasRecordViewAccess = \App\Privilege::isPermitted('IStorages', 'DetailView', $iStorageId);
Severity: Minor
Found in modules/IStorages/IStorages.php - About 4 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 getRecordDataFromXMLTemplate has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecordDataFromXMLTemplate(XMLReader $xmlToImport)
    {
        $recordData = [];
        $recordNum = 0;
        $firstElement = '';
Severity: Minor
Found in modules/Import/readers/XmlReader.php - About 4 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 getHierarchyData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
    {
        \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
        $currentUser = Users_Privileges_Model::getCurrentUserModel();
        $hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('HelpDesk', 'DetailView', $recordId);
Severity: Minor
Found in modules/HelpDesk/models/Module.php - About 4 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