YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function validate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate()
    {
        if ($this->isNew() || false !== $this->getPreviousValue('roleid') || false !== $this->getPreviousValue('user_name')) {
            $query = (new App\Db\Query())->from('vtiger_users')
                ->leftJoin('vtiger_user2role', 'vtiger_user2role.userid = vtiger_users.id')
Severity: Minor
Found in modules/Users/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 getSwitchUsers has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getSwitchUsers($showRole = false): array
    {
        require ROOT_DIRECTORY . '/user_privileges/switchUsers.php';
        $baseUserId = \App\User::getCurrentUserRealId();
        $users = [];
Severity: Minor
Found in modules/Users/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 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $qualifiedModuleName = $request->getModule(false);
        if (!$request->isEmpty('record', true)) {
            $recordModel = Settings_TreesManager_Record_Model::getInstanceById($request->getInteger('record'));
Severity: Minor
Found in modules/Settings/TreesManager/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 change has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function change(App\Request $request): void
    {
        $moduleName = $request->getModule();
        $password = $request->getRaw('password');
        $userRecordModel = Users_Record_Model::getInstanceById($request->getInteger('record'), $moduleName);
Severity: Minor
Found in modules/Users/actions/Password.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 getFields has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFields($source = false)
    {
        \App\Log::trace('Entering ' . __METHOD__ . '() method ...');
        $moduleModel = Vtiger_Module_Model::getInstance($this->getName());
        $fields = [];
Severity: Minor
Found in modules/Settings/MappedFields/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 getItemModelFromRequest has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getItemModelFromRequest(App\Request $request): App\Fields\Picklist\Item
    {
        $moduleName = $request->getByType('source_module', \App\Purifier::ALNUM);
        $pickListFieldName = $request->getByType('picklistName', \App\Purifier::ALNUM);
        $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
Severity: Minor
Found in modules/Settings/Picklist/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 save has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function save()
    {
        $db = App\Db::getInstance('webservice');
        $table = $this->baseTable;
        $index = $this->baseIndex;
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 changeStatusAllTasks has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function changeStatusAllTasks(App\Request $request)
    {
        $record = $request->getInteger('record');
        $status = $request->get('status');
        if (!empty($record)) {
Severity: Minor
Found in modules/Settings/Workflows/actions/TaskAjax.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 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        try {
            $orderId = $message = '';
            $responseType = 'success';
Severity: Minor
Found in modules/Settings/YetiForce/actions/Buy.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 getDisplayValue has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue(string $key)
    {
        $fieldValue = $this->get($key);
        switch ($key) {
            case 'frequency':
Severity: Minor
Found in modules/Settings/CronTasks/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 getLastCronIteration has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getLastCronIteration()
    {
        $result = [];
        $totalDiff = $finalLastStart = $finalLastEnd = $finishedTasks = 0;
        $timedout = false;
Severity: Minor
Found in modules/Settings/CronTasks/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 getRenewalValue has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRenewalValue()
    {
        if ($this->isEmpty('serviceid') || !\App\Record::isExists($this->get('serviceid'), 'Services')) {
            return 'PLL_NOT_APPLICABLE_VERIFICATION';
        }
Severity: Minor
Found in modules/OSSSoldServices/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 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(OSSMail_Mail_Model $mail)
    {
        $type = $mail->getTypeEmail();
        $exceptionsAll = OSSMailScanner_Record_Model::getConfig('exceptions');
        if (!empty($exceptionsAll['crating_mails'])) {
Severity: Minor
Found in modules/OSSMailScanner/scanneractions/CreatedEmail.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 parseValueForDate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseValueForDate($condition)
    {
        $value = $condition['value'];
        $operation = $condition['operation'];

Severity: Minor
Found in modules/com_vtiger_workflow/WorkFlowScheduler.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 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function doTask($recordModel)
    {
        if (!empty($this->mailTemplate) && !empty($this->pdfTemplate) && \App\Record::isExists($this->mailTemplate, 'EmailTemplates') && \Vtiger_PDF_Model::getInstanceById($this->pdfTemplate)) {
            $mailerContent = [];
            if (!empty($this->smtp)) {
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTSendPdf.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 calculateProgress has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function calculateProgress()
    {
        $db = \App\Db::getInstance();
        $params = [];

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

    public static function getComponentActivityStateLabel($key = '')
    {
        $pickListValues = App\Fields\Picklist::getValuesName('activitystatus');
        if (!\is_array($pickListValues)) {
            return [];
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 getRecordModelFromRequest has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecordModelFromRequest(App\Request $request)
    {
        if ('QuickEdit' === $request->getByType('fromView')) {
            $fields = array_merge(['reasontoedit', 'commentcontent'], array_keys($this->record->getModule()->getFieldsByType('serverAccess', true)));
        } else {
Severity: Minor
Found in modules/ModComments/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 getQuery has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getQuery(App\Request $request)
    {
        $moduleName = $request->getByType('source_module', \App\Purifier::ALNUM);
        $sourceModule = $request->getModule();
        $cvId = $request->isEmpty('viewname') ? '' : $request->getByType('viewname', \App\Purifier::ALNUM);
Severity: Minor
Found in modules/SMSNotifier/actions/MassSMS.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 setCrmActivity has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function setCrmActivity($referenceIds, $refModuleName = null)
    {
        $db = \App\Db::getInstance();
        foreach ($referenceIds as $id => $fieldName) {
            if (empty($fieldName)) {
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

Severity
Category
Status
Source
Language