YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public static function getWatchingModules($userId = false)
    {
        if (false === $userId) {
            $userId = \App\User::getCurrentUserId();
        }
Severity: Minor
Found in modules/Vtiger/models/Watchdog.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 getValueByField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getValueByField(string $fieldName)
    {
        if (!$this->has($fieldName) || '' === $this->get($fieldName)) {
            $focus = $this->getEntity();
            if (isset($focus->column_fields[$fieldName]) && '' !== $focus->column_fields[$fieldName]) {
Severity: Minor
Found in modules/Vtiger/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 isTreeRelation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function isTreeRelation()
    {
        if (\in_array($this->getRelationModuleModel()->getName(), ['OutsourcedProducts', 'Products', 'Services', 'OSSOutsourcedServices'])) {
            foreach ($this->getRelationModuleModel()->getFieldsByType('tree') as $field) {
                if ($field->isActiveField()) {
Severity: Minor
Found in modules/Vtiger/models/Relation.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 getTotalCountURL has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTotalCountURL($user = false)
    {
        $url = 'index.php?module=' . $this->getTargetModule() . '&action=Pagination&mode=getTotalCount&viewname=' . $this->widgetModel->get('filterid');
        if (!$user) {
            $user = App\User::getCurrentUserId();
Severity: Minor
Found in modules/Vtiger/models/MiniList.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 updateWidgetPosition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function updateWidgetPosition($position, $linkId, $widgetId, $userId)
    {
        $currentPosition = [];
        if (!$linkId && !$widgetId) {
            return;
Severity: Minor
Found in modules/Vtiger/models/Widget.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 getInstanceById has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getInstanceById(int $relationId)
    {
        if (!isset(self::$cachedInstancesById[$relationId])) {
            $row = \App\Relation::getById($relationId);
            $relationModel = false;
Severity: Minor
Found in modules/Vtiger/models/Relation.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 getListViewURL has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListViewURL($user = false)
    {
        $url = 'index.php?module=' . $this->getTargetModule() . '&view=List&viewname=' . $this->widgetModel->get('filterid');
        if (!$user) {
            $user = App\User::getCurrentUserId();
Severity: Minor
Found in modules/Vtiger/models/MiniList.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 getActiveTemplatesForRecord has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getActiveTemplatesForRecord($recordId, $view, $moduleName = false)
    {
        \App\Log::trace('Entering ' . __METHOD__ . '(' . $recordId . ',' . $view . ',' . $moduleName . ') method ...');
        if (!\App\Record::isExists($recordId)) {
            \App\Log::trace('Exiting ' . __METHOD__ . ' method ...');
Severity: Minor
Found in modules/Vtiger/models/MappedFields.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 getTypeRelationModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTypeRelationModel(): App\Relation\RelationAbstraction
    {
        if (!isset($this->typeRelationModel)) {
            $name = ucfirst($this->get('name'));
            $relationClassName = Vtiger_Loader::getComponentClassName('Relation', $name, $this->getParentModuleModel()->getName(), false);
Severity: Minor
Found in modules/Vtiger/models/Relation.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 getRecordStructureModuleFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecordStructureModuleFields(): array
    {
        $recordStructureModulesField = [];
        foreach ($this->moduleModel->getFieldsByReference() as $referenceField) {
            if (!$referenceField->isActiveField()) {
Severity: Minor
Found in modules/Vtiger/views/ExportRecords.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)
    {
        $mode = $request->getMode();
        if (!empty($mode)) {
            echo $this->invokeExposedMethod($mode, $request);
Severity: Minor
Found in modules/Vtiger/views/Detail.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 builder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function builder(App\Request $request): void
    {
        $viewer = $this->getViewer($request);
        $advanceCriteria = $request->getArray('advanceCriteria', \App\Purifier::TEXT);
        $relatedModuleSkip = $request->getBoolean('relatedModuleSkip', false);
Severity: Minor
Found in modules/Vtiger/views/ConditionBuilder.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 getDuplicate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDuplicate()
    {
        $fromRecord = $this->record->getId();
        $this->record->set('id', '');
        foreach ($this->record->getModule()->getFields() as $fieldModel) {
Severity: Minor
Found in modules/Vtiger/views/Edit.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 recordChanger has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function recordChanger(App\Request $request)
    {
        $this->getRecordModelFromRequest($request);
        $id = $request->getInteger('id');
        $field = App\Field::getQuickChangerFields($this->record->getModule()->getId())[$id] ?? false;
Severity: Minor
Found in modules/Vtiger/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 getReferenceModule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getReferenceModule($record): ?Vtiger_Module_Model
    {
        if (!empty($record)) {
            $referenceModuleList = $this->getReferenceModules();
            $referenceEntityType = vtlib\Functions::getCRMRecordMetadata($record)['setype'] ?? '';
Severity: Minor
Found in modules/Vtiger/inventoryfields/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 getReferenceModule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getReferenceModule($record): ?Vtiger_Module_Model
    {
        if (!empty($record)) {
            $referenceModuleList = $this->getParamsConfig()['modules'] ?? [];
            $referenceModuleList = !\is_array($referenceModuleList) ? [$referenceModuleList] : $referenceModuleList;
Severity: Minor
Found in modules/Vtiger/inventoryfields/Name.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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, string $columnName, bool $isUserFormat, $originalValue = null)
    {
        if ($columnName === $this->getColumnName()) {
            if (!is_numeric($value) || !isset(\App\Fields\Currency::getAll()[$value])) {
                throw new \App\Exceptions\Security("ERR_ILLEGAL_FIELD_VALUE||$columnName||" . print_r($value, true), 406);
Severity: Minor
Found in modules/Vtiger/inventoryfields/Currency.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 getUserRole has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getUserRole(App\Request $request): void
    {
        if (!App\Config::performance('SEARCH_ROLES_BY_AJAX')) {
            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
        }
Severity: Minor
Found in modules/Vtiger/actions/Fields.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 getListRecord has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getListRecord($module, array $columnList, $limit)
    {
        $moduleList = [];
        $recordList = [];
        if (!$module) {
Severity: Minor
Found in modules/Vtiger/helpers/ListUpdatedRecord.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 owners has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function owners(App\Request $request)
    {
        $owner = App\Fields\Owner::getInstance();
        $owner->showRoleName = true;
        $owner->find($request->getByType('value', 'Text'));
Severity: Minor
Found in modules/Vtiger/actions/Search.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