YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public static function saveWidget($params)
    {
        $db = App\Db::getInstance();
        $tabid = $params['tabid'];
        $data = $params['data'];
Severity: Minor
Found in modules/Settings/Widgets/models/Module.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 getListFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListFields(): array
    {
        if (!isset($this->listFieldModels)) {
            foreach (parent::getListFields() as $fieldName => $fieldModel) {
                if ('tabid' !== $fieldName) {
Severity: Minor
Found in modules/Settings/PickListDependency/models/Module.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 getHeaderSwitch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getHeaderSwitch($sourceModule, $index = [])
    {
        $data = [];
        $moduleName = is_numeric($sourceModule) ? \App\Module::getModuleName($sourceModule) : $sourceModule;
        foreach (\App\Relation::getByModule($moduleName) as $moduleData) {
Severity: Minor
Found in modules/Settings/Widgets/models/Module.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 getMenuUrl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMenuUrl($row)
    {
        switch ($row['type']) {
            case 0:
                $moduleModel = Vtiger_Module_Model::getInstance($row['module']);
Severity: Minor
Found in modules/Settings/Menu/models/Module.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 getFiletrs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFiletrs(array $modules): array
    {
        $filetrs = $tabid = [];
        foreach ($modules as $value) {
            if (!\in_array($value['related_tabid'], $tabid)) {
Severity: Minor
Found in modules/Settings/Widgets/models/Module.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 addBasic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function addBasic(string $type): void
    {
        $db = App\Db::getInstance('log');
        if ('view' == $type && App\Request::_isAjax()) {
            self::lockTracking();
Severity: Minor
Found in modules/Settings/Vtiger/models/Tracker.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 getCheckboxs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCheckboxs(array $modules): array
    {
        $checkBoxs = [];
        $tabid = [];
        foreach ($modules as $value) {
Severity: Minor
Found in modules/Settings/Widgets/models/Module.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 getConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getConfig($type)
    {
        $cache = Vtiger_Cache::get('MarketingProcesses', $type);
        if ($cache) {
            \App\Log::trace('End ' . __METHOD__);
Severity: Minor
Found in modules/Settings/MarketingProcesses/models/Module.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 saveModuleCustomNumberingAdvanceData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveModuleCustomNumberingAdvanceData(App\Request $request)
    {
        $updated = false;
        $sourceModule = $request->getByType('sourceModule', 2);
        $moduleId = \App\Module::getModuleId($sourceModule);
Severity: Minor
Found in modules/Settings/RecordNumbering/actions/SaveAjax.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 forVerification has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function forVerification(App\Request $request)
    {
        $rows = [];
        $query = $this->getQuery($request);
        $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);
Severity: Minor
Found in modules/Settings/MailRbl/actions/GetData.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 getListFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListFields(): array
    {
        if (!isset($this->listFieldModels)) {
            $fields = $this->listFields;
            $fieldObjects = [];
Severity: Minor
Found in modules/Settings/AutomaticAssignment/models/Module.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 request has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function request(App\Request $request)
    {
        $rows = [];
        $query = $this->getQuery($request);
        $query->from('s_#__mail_rbl_request')->select(['id', 'status', 'type', 'datetime', 'user', 'header', 'body']);
Severity: Minor
Found in modules/Settings/MailRbl/actions/GetData.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 setEmailSearchList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function setEmailSearchList($value)
    {
        $dbCommand = App\Db::getInstance()->createCommand();
        if (null === $value || 'null' == $value) {
            $dbCommand->update('vtiger_ossmailscanner_config', ['value' => ''], ['conf_type' => 'emailsearch', 'parameter' => 'fields'])->execute();
Severity: Minor
Found in modules/OSSMailScanner/models/Record.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 loadCustomLanguageFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadCustomLanguageFile(array $languages, string $moduleName)
    {
        $result = [];
        $moduleName = str_replace(self::URL_SEPARATOR, DIRECTORY_SEPARATOR, $moduleName);
        foreach ($languages as $language) {
Severity: Minor
Found in modules/Settings/LangManagement/models/Module.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 doTask has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function doTask($recordModel = null)
    {
        $users = [];
        foreach ($this->members as $member) {
            $users = array_merge($users, \App\PrivilegeUtil::getUserByMember($member));
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTEmailReport.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 save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function save(Workflow $workflow)
    {
        if (isset($workflow->id)) {
            $wf = $workflow;
            if (null === $wf->filtersavedinnew) {
Severity: Minor
Found in modules/com_vtiger_workflow/VTWorkflowManager.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 moduleHandler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        $dbCommand = \App\Db::getInstance()->createCommand();
        if ('module.postinstall' === $eventType) {
            $this->turnOn();
Severity: Minor
Found in modules/OSSMailScanner/OSSMailScanner.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 removeWidgetFrom has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function removeWidgetFrom($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')
    {
        if (empty($moduleNames)) {
            return;
        }
Severity: Minor
Found in modules/ModComments/ModComments.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 updateServiceContractState has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateServiceContractState($focusId)
    {
        $this->id = $focusId;
        $this->retrieveEntityInfo($focusId, 'ServiceContracts');
        $dataReader = (new App\Db\Query())->select(['relcrmid'])
Severity: Minor
Found in modules/ServiceContracts/ServiceContracts.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 findEmailUser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function findEmailUser($emails)
    {
        $notFound = 0;
        if (!empty($emails)) {
            foreach (explode(',', $emails) as $email) {
Severity: Minor
Found in modules/OSSMail/models/Mail.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