YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function setValueFromRequest(App\Request $request, Vtiger_Record_Model $recordModel, $requestFieldName = false)
    {
        $fieldName = $this->getFieldModel()->getFieldName();
        if (!$requestFieldName) {
            $requestFieldName = $fieldName;
Severity: Minor
Found in modules/ModComments/uitypes/Reference.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 evalGate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function evalGate($tree)
    {
        if (\in_array($tree[0], ['and', 'or'])) {
            switch ($tree[0]) {
                case 'and':
Severity: Minor
Found in modules/com_vtiger_workflow/VTConditionalExpression.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 addWidgetTo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function addWidgetTo($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 getRecordRelatedListViewLinksLeftSide has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecordRelatedListViewLinksLeftSide(Vtiger_RelationListView_Model $viewModel)
    {
        $links = parent::getRecordRelatedListViewLinksLeftSide($viewModel);
        if ($viewModel->getRelationModel()->isEditable() && $this->isEditable()) {
            if (\in_array($this->getValueByField('activitystatus'), Calendar_Module_Model::getComponentActivityStateLabel('current'))) {
Severity: Minor
Found in modules/Calendar/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 getQuery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQuery()
    {
        $moduleName = $this->relationModel->getParentModuleModel()->getName();
        $fields = $this->relationModel->getRelationModuleModel()->getReferenceFieldsForModule($moduleName);
        if (!$fields) {
Severity: Minor
Found in modules/Calendar/relations/GetActivities.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function parse()
    {
        $op = [
            'and' => ['op', 'and'],
            'or' => ['op', 'or'],
Severity: Minor
Found in modules/com_vtiger_workflow/VTConditionalParser.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 getFullName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getFullName($text)
    {
        $return = '';
        foreach ($text as $row) {
            if ('' != $return) {
Severity: Minor
Found in modules/OSSMail/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 undoImport has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function undoImport(App\Request $request)
    {
        if ($request->has('type') && 'ics' === $request->getByType('type', 'Text')) {
            $currentUserModel = Users_Record_Model::getCurrentUserModel();
            $moduleName = $request->getModule();
Severity: Minor
Found in modules/Calendar/views/Import.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 process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        \App\Log::trace('Start cron CalDAV');
        if(!\App\YetiForce\Shop::check('YetiForceDav')){
            $this->logs = \App\YetiForce\Shop::checkAlert('YetiForceDav');
Severity: Minor
Found in modules/Calendar/crons/CalDav.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 editViewPreSave has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function editViewPreSave(App\EventHandler $eventHandler)
    {
        $recordModel = $eventHandler->getRecordModel();
        $response = ['result' => true];
        $fieldModel = $recordModel->getModule()->getFieldByName('ean');
Severity: Minor
Found in modules/Products/handlers/DuplicateEan.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 saveRecord has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveRecord(App\Request $request)
    {
        parent::saveRecord($request);
        $data = $this->record->getData();
        if ($request->getBoolean('reapeat')) {
Severity: Minor
Found in modules/Calendar/actions/Save.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 process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $pauser = \App\Pauser::getInstance('CrmActivity');
        $lastId = (int) $pauser->getValue();

Severity: Minor
Found in modules/Calendar/crons/SetCrmActivity.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 editViewPreSave has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function editViewPreSave(App\EventHandler $eventHandler)
    {
        $recordModel = $eventHandler->getRecordModel();
        $response = ['result' => true];
        $fieldModel = $recordModel->getModule()->getFieldByName('vat_id');
Severity: Minor
Found in modules/Accounts/handlers/DuplicateVatId.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 getHeaders has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHeaders()
    {
        $headerFields = parent::getHeaders();
        if ('IStorages' === $this->getRelationModel()->get('modulename') && 'getManyToMany' === $this->getRelationModel()->get('name')) {
            $qtyInStockField = new Vtiger_Field_Model();
Severity: Minor
Found in modules/Products/models/RelationListView.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 saveToDb has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveToDb()
    {
        $dbCommand = \App\Db::getInstance()->createCommand();
        $tableData = array_intersect_key($this->getData(), $this->changes);
        if ($tableData) {
Severity: Minor
Found in modules/CustomView/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 getQueryByModuleField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQueryByModuleField($sourceModule, $field, $record, App\QueryGenerator $queryGenerator)
    {
        $supportedModulesList = [$this->getName(), 'Vendors', 'Leads', 'Accounts', 'PriceBooks'];
        if (\in_array($sourceModule, $supportedModulesList) || Vtiger_Module_Model::getInstance($sourceModule)->isInventory()) {
            $condition = ['and', ['vtiger_products.discontinued' => 1]];
Severity: Minor
Found in modules/Products/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 updateStockInStorage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateStockInStorage(string $name): array
    {
        $igin = $iidn = [];
        foreach ($this->toUpdate as $crmId => $product) {
            if ($product['difference'] > 0) {
Severity: Minor
Found in modules/Products/models/Stocktaking.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 process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $statusActivity = Calendar_Module_Model::getComponentActivityStateLabel();
        $dataReader = (new App\Db\Query())->select(['vtiger_activity.activityid', 'vtiger_activity.due_date', 'vtiger_activity.time_end',
            'vtiger_activity.date_start', 'vtiger_activity.time_start', 'activitystatus' => 'vtiger_activity.status', ])
Severity: Minor
Found in modules/Calendar/crons/ActivityState.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 addGroup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function addGroup(?array $rule, int $parentId, int $index)
    {
        if (empty($rule) || empty($rule['rules'])) {
            return;
        }
Severity: Minor
Found in modules/CustomView/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 process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $record = $request->getInteger('record');
        $load = $request->get('noloadlibs');
Severity: Minor
Found in modules/OSSMailView/views/Preview.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