YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function createRecordByModel($moduleName, $fieldData, ?int $relationId = 0, ?int $sourceId = 0)
    {
        $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
        if (isset($fieldData['inventoryData'])) {
            $inventoryData = $fieldData['inventoryData'];
Severity: Minor
Found in modules/Import/actions/Data.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 arrayCombine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function arrayCombine($keys, $values)
    {
        $combine = $dup = [];
        foreach ($keys as $key => $keyData) {
            if (isset($combine[$keyData])) {
Severity: Minor
Found in modules/Import/readers/CSVReader.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 readCoordinatesByRecords has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function readCoordinatesByRecords(array $records)
    {
        $moduleModel = $this->get('srcModuleModel');
        $groupByField = $this->get('groupBy');
        $coordinatesCenter = $this->get('coordinatesCenter');
Severity: Minor
Found in modules/OpenStreetMap/models/Coordinate.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 getRawDataFromRow has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getRawDataFromRow(array $row): array
    {
        $row = parent::getRawDataFromRow($row);
        $unitPrice = $row['unit_price'] = (new \Vtiger_MultiCurrency_UIType())->getValueForCurrency($row['unit_price'], \App\Fields\Currency::getDefault()['id']);
        $regionalTaxes = $availableTaxes = '';
Severity: Minor
Found in api/webservice/WebservicePremium/Products/RecordsTree.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 getSearchParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSearchParams($stage, $assignedto, $dates)
    {
        $listSearchParams = [];
        $conditions = [];
        array_push($conditions, ['sales_stage', 'e', $stage]);
Severity: Minor
Found in modules/Project/dashboards/ProjectWidget.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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get(): array
    {
        $moduleName = $this->controller->request->getModule();
        $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
        $return = [];
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/RelatedModules.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 toXml has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function toXml($data, \SimpleXMLElement &$xmlData)
    {
        foreach ($data as $key => $value) {
            if (is_numeric($key)) {
                $key = 'item' . $key;
Severity: Minor
Found in api/webservice/Core/Response.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 updateUser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateUser(array $data = []): void
    {
        if (!\is_array($this->userData['custom_params'])) {
            $this->userData['custom_params'] = \App\Json::isEmpty($this->userData['custom_params']) ? [] : \App\Json::decode($this->userData['custom_params']);
        }
Severity: Minor
Found in api/webservice/Core/BaseAction.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 getRecordFromRow has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getRecordFromRow(array $row): array
    {
        $record = parent::getRecordFromRow($row);
        $unitPrice = (new \Vtiger_MultiCurrency_UIType())->getValueForCurrency($row['unit_price'], \App\Fields\Currency::getDefault()['id']);
        $regionalTaxes = $availableTaxes = '';
Severity: Minor
Found in api/webservice/WebservicePremium/Products/RecordsTree.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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get(): array
    {
        $rawData = $this->recordModel->getData();
        $displayData = $fieldsLabel = [];
        foreach ($this->recordModel->getModule()->getFields() as $fieldModel) {
Severity: Minor
Found in api/webservice/WebserviceStandard/Users/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 post has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function post()
    {
        $response = ['id' => ''];
        $message = '';
        (new \Api\ManageConsents\Save($this->controller->app['id']))
Severity: Minor
Found in api/webservice/ManageConsents/ApprovalsRegister/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 post has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function post()
    {
        $moduleName = $this->controller->request->getModule();
        $templateId = $this->controller->request->getInteger('templateId');
        $email = $this->controller->request->getByType('e-mail', 'Email');
Severity: Minor
Found in api/webservice/ManageConsents/BaseModule/SendEmail.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