YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function validate($value, $isUserFormat = false)
    {
        $hashValue = \is_array($value) ? ',' . implode(',', $value) . ',' : $value;
        if (isset($this->validate[$hashValue]) || empty($value)) {
            return;
Severity: Minor
Found in modules/Vtiger/uitypes/MultiListFields.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 getRelationsByFields has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRelationsByFields($privileges = true)
    {
        $module = $this->get('module');
        $moduleModel = Vtiger_Module_Model::getInstance($module);
        $relatedModelFields = $moduleModel->getFields();
Severity: Minor
Found in modules/Vtiger/models/TransferOwnership.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 getDetailViewRelatedLinks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDetailViewRelatedLinks()
    {
        $recordModel = $this->getRecord();
        $parentModuleModel = $this->getModule();
        $this->getWidgets();
Severity: Minor
Found in modules/Vtiger/models/DetailView.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 getWidgets has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getWidgets(int $recordId): array
    {
        $widgets = [];
        $moduleModel = $this->getRelatedModuleModel();
        foreach ($this->getWidgetsList() as $widgetCol) {
Severity: Minor
Found in modules/Vtiger/models/RelationListView.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 getRelationQuery has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRelationQuery($returnQueryGenerator = false)
    {
        if ($this->has('Query')) {
            return $this->get('Query');
        }
Severity: Minor
Found in modules/Vtiger/models/RelationListView.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 loadConditions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadConditions(): void
    {
        foreach ($this->wizardMap as $id => &$map) {
            $map['id'] = $id;
            if (isset($map['conditionsStatus'])) {
Severity: Minor
Found in modules/Vtiger/models/ProcessWizard.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 checkUserPermissions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkUserPermissions()
    {
        $permissions = $this->get('template_members');
        if (empty($permissions)) {
            return true;
Severity: Minor
Found in modules/Vtiger/models/PDF.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 getTreeList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private function getTreeList()
    {
        $trees = [];
        $isDeletable = $this->getRelationModel()->privilegeToTreeDelete();
        $lastId = 0;
Severity: Minor
Found in modules/Vtiger/models/TreeCategoryModal.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        if ($mode = $request->getMode()) {
            $this->invokeExposedMethod($mode, $request);
        } else {
Severity: Minor
Found in modules/Vtiger/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 process has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $this->recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
        $moduleModel = $this->recordModel->getModule();
Severity: Minor
Found in modules/Vtiger/views/QuickCreateAjax.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function setDataFromRequest(App\Request $request)
    {
        if ($request->has('xmlExportType')) {
            $this->exportModel->setTemplate($request->getByType('xmlExportType', 'Text'));
        }
Severity: Minor
Found in modules/Vtiger/actions/QuickExportData.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $componentName = $request->getByType('name');
        if (!empty($componentName)) {
Severity: Minor
Found in modules/Vtiger/views/ShowWidget.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 checkPermission has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPermission(App\Request $request)
    {
        $moduleName = $request->getModule();
        $recordId = $request->getInteger('record');
        if (empty($recordId)) {
Severity: Minor
Found in modules/Vtiger/actions/Watchdog.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $transferOwnerId = $request->getInteger('transferOwnerId');
        $relatedModules = $request->getByType('related_modules', 'Text');
Severity: Minor
Found in modules/Vtiger/actions/TransferOwnership.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 loadColumns has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadColumns(): void
    {
        $moduleName = $this->fieldModel->getModuleName();
        $fieldName = $this->fieldModel->getName();
        $fieldNameForColor = App\Colors::sanitizeValue($fieldName);
Severity: Minor
Found in modules/Vtiger/views/Kanban.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 getSummaryFields has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getSummaryFields(): array
    {
        if (empty($this->board['detail_fields'])) {
            $summaryFieldsList = $this->moduleModel->getSummaryViewFieldsList();
            $fields = [];
Severity: Minor
Found in modules/Vtiger/views/Kanban.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 getListViewCount has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListViewCount(App\Request $request)
    {
        $moduleName = $request->getModule();
        if (!$this->listViewModel) {
            $cvId = App\CustomView::getInstance($moduleName)->getViewId();
Severity: Minor
Found in modules/Vtiger/views/ListAjax.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 getSummaryValuesFromData has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSummaryValuesFromData($data)
    {
        $sum = $purchase = $totalOrNet = 0;
        if (\is_array($data)) {
            foreach ($data as $row) {
Severity: Minor
Found in modules/Vtiger/inventoryfields/MarginP.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 getRelationListModel has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getRelationListModel(App\Request $request)
    {
        $parentRecordModel = \Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule());
        $relationId = $request->isEmpty('relationId') ? false : $request->getInteger('relationId');
        $cvId = $request->isEmpty('cvId', true) ? 0 : $request->getByType('cvId', \App\Purifier::ALNUM);
Severity: Minor
Found in modules/Vtiger/actions/RelationAjax.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 getTaxParam has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTaxParam(string $taxParam, float $net, ?array $return = []): array
    {
        $taxParam = json_decode($taxParam, true);
        if (empty($taxParam)) {
            return [];
Severity: Minor
Found in modules/Vtiger/inventoryfields/Tax.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