YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function secureFile has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public static function secureFile(self $file): bool
    {
        if ('image' !== $file->getShortMimeType(0)) {
            return false;
        }
Severity: Minor
Found in app/Fields/File.php - About 2 hrs 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 saveInventoryCrm has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveInventoryCrm(\Vtiger_Record_Model $recordModel, Maps\Inventory $mapModel): bool
    {
        $inventoryData = [];
        $savedAllProducts = true;
        if ($mapModel->dataCrm['currency_id']) {
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Base.php - About 2 hrs 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 parseMail has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private function parseMail(): void
    {
        $moduleName = $this->record->getModuleName();
        $usedTypes = [];
        foreach (self::MAIL_FIELDS[$moduleName] as $key => $type) {
Severity: Minor
Found in app/Integrations/Dav/Card.php - About 2 hrs 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 create has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function create()
    {
        if (\array_diff_key($this->getData(), $this->template)) {
            throw new Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE', 406);
        }
Severity: Minor
Found in app/ConfigFile.php - About 2 hrs 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 getAdvanceData has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAdvanceData(array &$response): void
    {
        if (isset($response['Typ'], $response['SilosID']) && ($reportName = $this->getReportName($response['Typ'], $response['SilosID']))) {
            $responseFromGus = $this->getData('DanePobierzPelnyRaport', ['pRegon' => $response['Regon'], 'pNazwaRaportu' => $reportName]);
            if (empty($responseFromGus)) {
Severity: Minor
Found in app/RecordCollectors/Helper/GusClient.php - About 2 hrs 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 19 (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/Users/actions/Save.php - About 2 hrs 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 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $type = $request->getByType('type', 1);
        $range = $request->getByType('range', 'DateRangeUserFormat');
        if (!isset(App\Log::$owaspColumnMapping[$type])) {
Severity: Minor
Found in modules/Settings/Log/actions/LogsOwasp.php - About 2 hrs 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 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue(string $key)
    {
        $value = $this->get($key);
        switch ($key) {
            case 'tabid':
Severity: Minor
Found in modules/Settings/AdvancedPermission/models/Record.php - About 2 hrs 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 getAddFieldTypeInfo has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAddFieldTypeInfo()
    {
        $fieldTypesInfo = [];
        $addFieldSupportedTypes = $this->getAddSupportedFieldTypes();
        $lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];
Severity: Minor
Found in modules/Settings/LayoutEditor/models/Module.php - About 2 hrs 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 saveInventoryField has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveInventoryField(App\Request $request)
    {
        $inventory = Vtiger_Inventory_Model::getInstance($request->getByType('sourceModule', 'Standard'));
        if ($isNew = $request->isEmpty('id')) {
            $fieldModel = $inventory->getFieldCleanInstance($request->getByType('type'));
Severity: Minor
Found in modules/Settings/LayoutEditor/actions/SaveAjax.php - About 2 hrs 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 checkLoop has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkLoop(): ?int
    {
        $error = null;
        $groupsDown = $allGroups = $this->getMembersByType(\App\PrivilegeUtil::MEMBER_TYPE_GROUPS);
        if (!$groupsDown) {
Severity: Minor
Found in modules/Settings/Groups/models/Record.php - About 2 hrs 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 addWidget has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function addWidget($data, $moduleName, $addToUser = false)
    {
        \App\Log::trace('Entering Settings_WidgetsManagement_Module_Model::addWidget(' . $moduleName . ') method ...');
        $db = App\Db::getInstance();
        $status = false;
Severity: Minor
Found in modules/Settings/WidgetsManagement/models/Module.php - About 2 hrs 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 findEmailAddress has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function findEmailAddress($field, $searchModule = false, $returnArray = true)
    {
        $return = [];
        $emails = $this->get($field);
        if (empty($emails)) {
Severity: Minor
Found in modules/OSSMail/models/Mail.php - About 2 hrs 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 __getChildAccounts has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function __getChildAccounts($id, &$childAccounts, $depthBase)
    {
        \App\Log::trace('Entering __getChildAccounts(' . $id . ',' . $depthBase . ') method ...');
        if (empty($id) || $depthBase == App\Config::module('Accounts', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting __getChildAccounts method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/Accounts/Accounts.php - About 2 hrs 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 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQuery()
    {
        $queryGenerator = new App\QueryGenerator($this->getModuleName());
        if ($this->has('customFilter')) {
            $queryGenerator->initForCustomViewById($this->get('customFilter'));
Severity: Minor
Found in modules/Occurrences/models/Calendar.php - About 2 hrs 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 getRelationField has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRelationField()
    {
        $relationField = $this->get('relationField');
        if (!$relationField) {
            $relationField = false;
Severity: Minor
Found in modules/Campaigns/models/Relation.php - About 2 hrs 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 syncCrmRecord has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function syncCrmRecord($moduleName)
    {
        $create = $updates = 0;
        $query = $this->getCrmRecordsToSync($moduleName);
        if (!$query) {
Severity: Minor
Found in modules/API/models/CardDAV.php - About 2 hrs 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 getTilesDisplayValue has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTilesDisplayValue($value, $record = false, $recordModel = false, $rawText = false)
    {
        $rawValue = $value;
        if (!$value || !($value = \App\Json::decode($value))) {
            return '';
Severity: Minor
Found in modules/Vtiger/uitypes/MultiImage.php - About 2 hrs 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 getListViewDisplayValue has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListViewDisplayValue($value, $record = false, $recordModel = false, $rawText = false)
    {
        $values = \App\Fields\SharedOwner::getById($record);
        if (empty($values)) {
            return '';
Severity: Minor
Found in modules/Vtiger/uitypes/SharedOwner.php - About 2 hrs 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 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $userId = \App\User::getCurrentUserId();
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
Severity: Minor
Found in modules/OSSMailView/dashboards/Graf.php - About 2 hrs 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