YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getListViewEntries has a Cognitive Complexity of 9 (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/BusinessHours/models/ListView.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function doTask($recordModel)
    {
        $moduleName = $recordModel->getModuleName();
        $recordId = $recordModel->getId();
        switch ($this->recipients) {
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTWatchdog.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $viewer = $this->getViewer($request);

        $moduleName = $request->getModule();
Severity: Minor
Found in modules/SMSNotifier/views/MassSMS.php - About 55 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 deleteAllRecords has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function deleteAllRecords(string $untilModifiedTime, int $userId)
    {
        $actualUserId = App\User::getCurrentUserId();
        try {
            if (!App\User::isExists($userId)) {
Severity: Minor
Found in modules/RecycleBin/models/Module.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $this->preProcess($request);
        $moduleName = $request->getModule();
        $srcModule = $request->getByType('srcModule', 'Alnum');
Severity: Minor
Found in modules/PermissionInspector/views/UserListModal.php - About 55 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 getMailsFromIMAP has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getMailsFromIMAP(?int $user = null)
    {
        $accounts = self::getAccountsList(false, true);
        $mails = [];
        $mailLimit = 5;
Severity: Minor
Found in modules/OSSMail/models/Record.php - About 55 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 computeUsedUnits has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function computeUsedUnits($ticketData, $operator = '+')
    {
        $trackingUnit = strtolower($this->column_fields['tracking_unit']);
        $workingHoursPerDay = 24;

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

    public static function getAllParentComments(int $parentId, string $moduleName, array $hierarchy = [], Vtiger_Paging_Model $pagingModel = null)
    {
        $queryGenerator = new \App\QueryGenerator('ModComments');
        $queryGenerator->setFields(array_merge(array_keys(\App\Field::getModuleFieldInfosByPresence('ModComments')), ['id']));
        $queryGenerator->setSourceRecord($parentId);
Severity: Minor
Found in modules/ModComments/models/Record.php - About 55 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 getFieldsByType has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldsByType($type, bool $active = false): array
    {
        $restrictedField = ['picklist' => ['activitystatus', 'visibility', 'duration_minutes']];
        if (!\is_array($type)) {
            $type = [$type];
Severity: Minor
Found in modules/Calendar/models/Module.php - About 55 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 entityAfterSave has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function entityAfterSave(App\EventHandler $eventHandler)
    {
        $ids = [];
        $recordModel = $eventHandler->getRecordModel();
        foreach ($recordModel->getModule()->getFieldsByReference() as $fieldModel) {
Severity: Minor
Found in modules/Calendar/handlers/CalendarHandler.php - About 55 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 __construct has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct()
    {
        if (!is_dir($this->filterPath)) {
            return false;
        }
Severity: Minor
Found in modules/Calendar/models/CalendarFilters.php - About 55 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 getQueryByModuleField has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQueryByModuleField($sourceModule, $field, $record, App\QueryGenerator $queryGenerator)
    {
        if (('Accounts' === $sourceModule && 'account_id' === $field && $record) || \in_array($sourceModule, ['Campaigns', 'Products', 'Services'])) {
            if ('Campaigns' === $sourceModule && $record) {
                $subQuery = (new \App\Db\Query())->select(['crmid'])->from('vtiger_campaign_records')->where(['campaignid' => $record]);
Severity: Minor
Found in modules/Accounts/models/Module.php - About 55 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 getRssClient has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getRssClient(string $url): SimplePie
    {
        $feed = new SimplePie();
        if (!empty(\Config\Security::$proxyConnection)) {
            $proxy = [];
Severity: Minor
Found in modules/Rss/models/Record.php - About 55 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 getListViewMassActions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListViewMassActions($linkParams)
    {
        $moduleModel = $this->getModule();
        $moduleName = $moduleModel->getName();

Severity: Minor
Found in modules/Documents/models/ListView.php - About 55 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 entityChangeState has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function entityChangeState(App\EventHandler $eventHandler)
    {
        if (!ModTracker::isTrackingEnabledForModule($eventHandler->getModuleName())) {
            return false;
        }
Severity: Minor
Found in modules/ModTracker/handlers/ModTrackerHandler.php - About 55 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 checkPermission has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPermission(App\Request $request)
    {
        $sourceModule = $request->getByType('sourceModule', 2);
        if ($request->has('record')) {
            $recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('record'));
Severity: Minor
Found in modules/ModTracker/actions/ChangesReviewedOn.php - About 55 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 getQueryByModuleField has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQueryByModuleField($sourceModule, $field, $record, App\QueryGenerator $queryGenerator)
    {
        if (!empty($record) && \in_array($sourceModule, ['Campaigns', 'Products', 'Services'])) {
            switch ($sourceModule) {
                case 'Campaigns':
Severity: Minor
Found in modules/Leads/models/Module.php - About 55 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 getDisplayValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
    {
        if (null === $value || '' === $value) {
            return '';
        }
Severity: Minor
Found in modules/Vtiger/uitypes/Picklist.php - About 55 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 editViewPreSave has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function editViewPreSave(App\EventHandler $eventHandler)
    {
        $recordModel = $eventHandler->getRecordModel();
        $response = ['result' => true];
        $fieldsDependency = \App\FieldsDependency::getByRecordModel(\App\Request::_getByType('fromView'), $recordModel);
Severity: Minor
Found in modules/Vtiger/handlers/FieldsDependency.php - About 55 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 getApiDisplayValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getApiDisplayValue($value, Vtiger_Record_Model $recordModel, array $params = [])
    {
        $value = \App\Json::decode($value);
        if (!$value || !\is_array($value)) {
            return [];
Severity: Minor
Found in modules/Vtiger/uitypes/MultiImage.php - About 55 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