YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function registerPopoverRecord has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    registerPopoverRecord: function (
        selectElement = $('.js-popover-tooltip--record'),
        customParams = {},
        container = $(document)
    ) {
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 updateBlocks has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateBlocks($modulenode, $moduleInstance)
    {
        if (empty($modulenode->blocks) || empty($modulenode->blocks->block)) {
            return;
        }
Severity: Minor
Found in vtlib/Vtiger/PackageUpdate.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 importField has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function importField($blocknode, $blockInstance, $moduleInstance, $fieldnode)
    {
        $fieldInstance = new Field();
        $fieldInstance->name = (string) $fieldnode->fieldname;
        $fieldInstance->label = (string) $fieldnode->fieldlabel;
Severity: Minor
Found in vtlib/Vtiger/PackageImport.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 getComponentClassName has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
    {
        $cacheKey = "$componentType|$componentName|$moduleName";
        if (isset(self::$componentClassCache[$cacheKey])) {
            return self::$componentClassCache[$cacheKey];
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 getDefaultCvId has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDefaultCvId()
    {
        $cacheName = $this->moduleName . $this->user->getId();
        if (Cache::has('GetDefaultCvId', $cacheName)) {
            return Cache::get('GetDefaultCvId', $cacheName);
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 confReportAll has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function confReportAll(): void
    {
        \App\Process::$requestMode = 'Cron';
        \App\Utils\ConfReport::$sapi = 'cron';
        $all = \App\Utils\ConfReport::getAll();
Severity: Minor
Found in app/Cli/Environment.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 find has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function find($value): array
    {
        $product = \App\YetiForce\Register::getProduct('YetiForceGeocoder');
        if (empty($value) || !\App\RequestUtil::isNetConnection() || empty($product['params']['login']) || empty($product['params']['pass'])) {
            return [];
Severity: Minor
Found in app/Map/Address/YetiForceGeocoder.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 getNumberOfNewMessages has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getNumberOfNewMessages(?array $roomInfo = null): array
    {
        $numberOfNewMessages = 0;
        $roomList = [];
        $lastMessagesData = [];
Severity: Minor
Found in app/Chat.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 sanitizeDbFormat has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static function sanitizeDbFormat(string $date, string $fromFormat)
    {
        $dbDate = '';
        if ($date) {
            [$y, $m, $d] = self::explode($date, $fromFormat);
Severity: Minor
Found in app/Fields/Date.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 getAllocation has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAllocation($mode, $private, $fieldType)
    {
        $moduleName = false;
        if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
            $moduleName = $this->moduleName;
Severity: Minor
Found in app/Fields/Owner.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 15 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in modules/Settings/MappedFields/actions/ExportTemplate.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 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $mode = $request->getMode();
        if (!empty($mode)) {
            $this->invokeExposedMethod($mode, $request);
Severity: Minor
Found in modules/Users/actions/SaveAjax.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 __getChildEmployees has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function __getChildEmployees($id, &$childAccounts, $depth)
    {
        $userNameSql = App\Module::getSqlForNameInDisplayFormat('Users');
        $dataReader = (new App\Db\Query())
            ->select(['vtiger_ossemployees.*', 'user_name' => new \yii\db\Expression('CASE when (vtiger_users.user_name not like ' . App\Db::getInstance()->quoteValue('') . ") THEN $userNameSql ELSE vtiger_groups.groupname END")])
Severity: Minor
Found in modules/OSSEmployees/OSSEmployees.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 showFieldLayout has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function showFieldLayout(App\Request $request)
    {
        $qualifiedModule = $request->getModule(false);
        $activeTab = 'detailViewLayout';
        if ($request->has('tab')) {
Severity: Minor
Found in modules/Settings/LayoutEditor/views/Index.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 getFieldInstanceByName has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name)
    {
        $moduleName = $this->getModule()->getName(true);
        $fieldsLabel = $this->getEditFields();
        $params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'label' => $fieldsLabel[$name], 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
Severity: Minor
Found in modules/Settings/WebserviceUsers/services/WebservicePremium.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 getTreeData has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private function getTreeData(string $moduleName, array $folders, array $selectedFolders): array
    {
        $tree = $tempArray = [];
        foreach (OSSMailScanner_Record_Model::$mainFolders as $mainFolder) {
            $treeCategory = [
Severity: Minor
Found in modules/Settings/OSSMailScanner/views/Folders.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 getFormatDataSession has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFormatDataSession(array $row): array
    {
        foreach ($row as $key => $value) {
            switch ($key) {
                case 'parent_id':
Severity: Minor
Found in modules/Settings/WebserviceUsers/models/Record.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 getListViewEntries has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListViewEntries($pagingModel)
    {
        $moduleModel = $this->getModule();
        $moduleName = $moduleModel->getName();
        $parentModuleName = $moduleModel->getParentName();
Severity: Minor
Found in modules/Settings/WebserviceUsers/models/ListView.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 transformAdvanceFilterToWorkFlowFilter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static function transformAdvanceFilterToWorkFlowFilter(Vtiger_PDF_Model &$pdfModel)
    {
        $conditions = $pdfModel->get('conditions');
        $wfCondition = [];
        if (!empty($conditions)) {
Severity: Minor
Found in modules/Settings/PDF/models/Record.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 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $recordId = $request->getInteger('id');
        $workflowModel = Settings_Workflows_Record_Model::getInstance($recordId);
        $workflowObject = $workflowModel->getWorkflowObject();
Severity: Minor
Found in modules/Settings/Workflows/actions/ExportWorkflow.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