YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getTypeFolder has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getTypeFolder($folder)
    {
        switch ($folder) {
            case 'Received':
                $return = 0;
Severity: Minor
Found in modules/OSSMailScanner/models/Record.php - About 35 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 exec has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function exec($expr)
    {
        if ($expr instanceof VTExpressionSymbol) {
            return $this->env($expr);
        }
Severity: Minor
Found in modules/com_vtiger_workflow/expression_engine/VTExpressionEvaluater.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function doTask($recordModel)
    {
        if (is_numeric($this->template) && $this->template) {
            $entityId = $recordModel->getId();
            $resultInvitees = (new \App\Db\Query())->from('u_#__activity_invitation')->where(['activityid' => $entityId])->createCommand()->query();
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTSendNotificationTask.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function doTask($recordModel)
    {
        $dbCommand = \App\Db::getInstance()->createCommand();
        $moduleName = $recordModel->getModuleName();
        $entityId = $recordModel->getId();
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTAddressBookTask.php - About 35 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 getEmail has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getEmail($cacheKey)
    {
        $header = $this->get('header');
        $text = '';
        if (property_exists($header, $cacheKey)) {
Severity: Minor
Found in modules/OSSMail/models/Mail.php - About 35 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 process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        if (\App\Integrations\SMSProvider::isActiveProvider()) {
            $queryGenerator = new \App\QueryGenerator($this->moduelName);
            $dataReader = $queryGenerator->setFields(['id'])
Severity: Minor
Found in modules/SMSNotifier/crons/SMSNotifier.php - About 35 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 updateActivityReminder has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateActivityReminder()
    {
        if (!$this->isNew() && false === $this->getPreviousValue('reminder_time')) {
            return false;
        }
Severity: Minor
Found in modules/Calendar/models/Record.php - About 35 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 getRecordsListQueryFromRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecordsListQueryFromRequest(App\Request $request): App\QueryGenerator
    {
        $module = $request->getModule();
        $sourceModule = $request->getByType('source_module', 'Alnum');
        $selectedIds = $request->getArray('selected_ids', 'Alnum');
Severity: Minor
Found in modules/SMSNotifier/views/MassSMS.php - About 35 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 setEventFieldsForExport has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setEventFieldsForExport()
    {
        $keysToReplace = ['taskpriority'];
        $keysValuesToReplace = ['taskpriority' => 'priority'];
        foreach ($this->getFields() as $fieldName => $fieldModel) {
Severity: Minor
Found in modules/Calendar/models/Module.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        if ('module.postinstall' === $eventType) {
            \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => $moduleName])->execute();
            $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
Severity: Minor
Found in modules/SQuotes/SQuotes.php - About 35 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 getMail has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getMail($mbox, $id, $msgno = false, bool $fullMode = true)
    {
        if (!$msgno) {
            \App\Log::beginProfile(__METHOD__ . '|imap_msgno', 'Mail|IMAP');
            $msgno = imap_msgno($mbox, $id);
Severity: Minor
Found in modules/OSSMail/models/Record.php - About 35 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 getFields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFields(bool $editable = false)
    {
        $fields = [];
        $sourceModule = $this->relationModel->getParentModuleModel();
        if ('Occurrences' !== $sourceModule->getName()) {
Severity: Minor
Found in modules/ModComments/relations/GetRelatedRecord.php - About 35 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 setTodoFieldsForExport has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setTodoFieldsForExport()
    {
        $keysToReplace = ['taskpriority', 'activitystatus'];
        $keysValuesToReplace = ['taskpriority' => 'priority', 'activitystatus' => 'status'];
        foreach ($this->getFields() as $fieldName => $fieldModel) {
Severity: Minor
Found in modules/Calendar/models/Module.php - About 35 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 importICS has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function importICS(string $filePath)
    {
        $userId = \App\User::getCurrentUserRealId();
        $lastImport = new ICalLastImport();
        $lastImport->clearRecords($userId);
Severity: Minor
Found in modules/Calendar/models/Module.php - About 35 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 insertIntoActivityReminderPopup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function insertIntoActivityReminderPopup()
    {
        $cbrecord = $this->getId();
        if (!empty($cbrecord)) {
            $cbdate = $this->get('date_start');
Severity: Minor
Found in modules/Calendar/models/Record.php - About 35 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 process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $queryGenerator = $this->getQuery($request);
        $count = 0;
        $moduleName = $request->getModule();
Severity: Minor
Found in modules/SMSNotifier/actions/MassSMS.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        if ('module.postinstall' === $eventType) {
            $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
            if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
Severity: Minor
Found in modules/LettersOut/LettersOut.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        if ('module.postinstall' === $eventType) {
            \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => 'Ideas'])->execute();
            $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
Severity: Minor
Found in modules/Ideas/Ideas.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        if ('module.postinstall' === $eventType) {
            \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => 'Locations'])->execute();

Severity: Minor
Found in modules/Locations/Locations.php - About 35 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 getFields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFields(bool $editable = false)
    {
        $fields = [];
        $sourceModule = $this->relationModel->getParentModuleModel();
        if ('Occurrences' !== $sourceModule->getName()) {
Severity: Minor
Found in modules/Occurrences/relations/GetRelatedMembers.php - About 35 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