YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function importTaskMethod has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function importTaskMethod(array &$method, array &$messages)
    {
        $scriptData = base64_decode($method['script_content']);
        $functionPath = $method['function_path'];
        if (!$this->checkPathForImportMethod($functionPath)) {
Severity: Minor
Found in modules/Settings/Workflows/models/Module.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 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name)
    {
        $params = [];
        $qualifiedModuleName = $this->getName(true);
        $tableName = $this->getModule()->baseTable;
Severity: Minor
Found in modules/Settings/PickListDependency/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 getMapping has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMapping($editable = false)
    {
        if (empty($this->mapping)) {
            $query = (new \App\Db\Query())->from('vtiger_convertleadmapping');
            if ($editable) {
Severity: Minor
Found in modules/Settings/Leads/models/Mapping.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 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $qualifiedModuleName = $request->getModule(false);
        $recordId = $request->get('record');
        $roleName = $request->get('rolename');
Severity: Minor
Found in modules/Settings/Roles/actions/Save.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 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function transformAdvanceFilterToWorkFlowFilter()
    {
        $conditions = $this->get('conditions');
        $wfCondition = [];

Severity: Minor
Found in modules/Settings/Workflows/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 historyVisitPurpose has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function historyVisitPurpose(App\Request $request)
    {
        $rows = $columns = [];
        foreach ($request->getArray('columns') as $key => $value) {
            $columns[$key] = $value['name'];
Severity: Minor
Found in modules/Settings/AdminAccess/actions/GetData.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 getChild has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getChild($id, &$childRow, $depthBase)
    {
        if (empty($id) || $depthBase == App\Config::module('Partners', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');

Severity: Minor
Found in modules/Partners/Partners.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 getModFromLang has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getModFromLang($lang)
    {
        $modules = [];
        $settings = [];
        $format = \App\Language::FORMAT;
Severity: Minor
Found in modules/Settings/LangManagement/models/Module.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 getNextTriggerTime has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getNextTriggerTime()
    {
        $default_timezone = \App\Config::main('default_timezone');
        $admin = Users::getActiveAdminUser();
        $adminTimeZone = $admin->time_zone;
Severity: Minor
Found in modules/com_vtiger_workflow/Workflow.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 setDataFromRequest has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function setDataFromRequest(App\Request $request)
    {
        foreach ($this->getFieldNames() as $fieldName) {
            if ($request->has($fieldName)) {
                switch ($fieldName) {
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTUpdateRelatedFieldTask.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 doTask has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function doTask($recordModel)
    {
        $entityId = $recordModel->getId();

        $delta = $recordModel->getPreviousValue();
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTUpdateCalendarDates.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 searchByDomains has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function searchByDomains(string $moduleName, string $fieldName, array $emails)
    {
        $cacheKey = 'MailSearchByDomains' . $moduleName . '_' . $fieldName;
        $crmids = [];
        foreach ($emails as $email) {
Severity: Minor
Found in modules/OSSMail/models/Mail.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 insertIntoInviteTable has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function insertIntoInviteTable()
    {
        if (!\App\Request::_has('inviteesid')) {
            \App\Log::info('No invitations in request, Exiting insertIntoInviteeTable method ...');
            return;
Severity: Minor
Found in modules/Calendar/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 getCalendarState has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getCalendarState($data = [])
    {
        if ($data) {
            $activityStatus = $data['activitystatus'];
            if (\in_array($activityStatus, self::getComponentActivityStateLabel('history'))) {
Severity: Minor
Found in modules/Calendar/models/Module.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 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $baseModuleName = 'Accounts';
        $viewer = $this->getViewer($request);
        $filter = $request->has('filter') ? $request->getByType('filter', 'Alnum') : \App\CustomView::getInstance($baseModuleName)->getViewId();
Severity: Minor
Found in modules/Products/views/TreeRecords.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 getFreeTimeInDay has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFreeTimeInDay(string $day, string $activityType, int $ownerId = null)
    {
        $currentUser = empty($ownerId) ? \App\User::getCurrentUserModel() : \App\User::getUserModel($ownerId);
        if (empty($activityType)) {
            $activityType = $currentUser->get('defaultactivitytype');
Severity: Minor
Found in modules/Calendar/actions/GetFreeTime.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 save has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function save()
    {
        $db = \App\Db::getInstance();
        $currentUserModel = Users_Record_Model::getCurrentUserModel();

Severity: Minor
Found in modules/CustomView/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 getChildSales has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getChildSales($id, &$childSalesProcesses, $depthBase)
    {
        \App\Log::trace('Entering getChildSales(' . $id . ',' . $depthBase . ') method ...');
        if (empty($id) || $depthBase == App\Config::module('SSalesProcesses', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getChildSales method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/SSalesProcesses/SSalesProcesses.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 entityAfterSave has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function entityAfterSave(App\EventHandler $eventHandler)
    {
        $recordModel = $eventHandler->getRecordModel();
        foreach ($recordModel->getModule()->getFieldsByType(['image', 'multiImage', 'multiAttachment'], true) as $fieldName => $fieldModel) {
            $currentData = [];
Severity: Minor
Found in modules/Vtiger/handlers/Files.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 moduleHandler has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        if ('module.postinstall' === $eventType) {
            // Mark the module as Standard module
            \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => $moduleName])->execute();
Severity: Minor
Found in modules/ProjectTask/ProjectTask.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