YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getSupportedDrivers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getSupportedDrivers(): array
    {
        $drivers = [];
        foreach ((new \DirectoryIterator(__DIR__ . \DIRECTORY_SEPARATOR . 'Drivers')) as $fileInfo) {
            $fileName = $fileInfo->getBasename('.php');
Severity: Minor
Found in app/Pdf/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 isPermittedBySharing has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
    {
        $sharingPrivileges = \App\User::getSharingFile($userId);
        //Retreiving the default Organisation sharing Access
        $othersPermissionId = $sharingPrivileges['defOrgShare'][$tabId];
Severity: Minor
Found in app/Privilege.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 truncateHtml has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function truncateHtml(?string $html, ?string $size = 'medium', ?int $length = 200, $showBtn = false): string
    {
        if (empty($html)) {
            return '';
        }
Severity: Minor
Found in app/Layout.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 dropIndexes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function dropIndexes(array $tables)
    {
        $this->logs .= "> start drop indexes\n";
        $startMain = microtime(true);
        $db = \App\Db::getInstance();
Severity: Minor
Found in app/Db/Importer.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 getActiveAdminId has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getActiveAdminId()
    {
        $cache = Vtiger_Cache::getInstance();
        if ($cache->getAdminUserId()) {
            return $cache->getAdminUserId();
Severity: Minor
Found in modules/Users/Users.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 getQueryToUsersByMembers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getQueryToUsersByMembers(array $members): Db\Query
    {
        $queryGenerator = (new \App\QueryGenerator('Users'))->setFields(['id']);
        $columName = $queryGenerator->getColumnName('id');
        $conditions = ['or'];
Severity: Minor
Found in app/PrivilegeUtil.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 baseModuleActions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function baseModuleActions(): int
    {
        $i = 0;
        $curentProfile = [];
        foreach ((new \App\Db\Query())->from('vtiger_profile2standardpermissions')->all() as $row) {
Severity: Minor
Found in app/Db/Fixer.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 getDataFromApi has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function getDataFromApi($params): void
    {
        $params['format'] = 'json';
        if (!empty($this->token)) {
            $params['token'] = $this->token;
Severity: Minor
Found in app/RecordCollectors/DkCvr.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 findForeignKeyToColumn has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function findForeignKeyToColumn(string $findTableName, string $findColumnName)
    {
        $foreignKeys = [];
        foreach ($this->getTableNames() as $tableName) {
            $tableSchema = $this->getTableSchema($tableName);
Severity: Minor
Found in app/Db/Drivers/SchemaTrait.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 getIndexes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getIndexes(Base $importer, $table)
    {
        if (!isset($table['index'])) {
            return false;
        }
Severity: Minor
Found in app/Db/Importer.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 getRecordListViewLinksLeftSide has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecordListViewLinksLeftSide()
    {
        $links = $recordLinks = [];
        if ($this->isViewable()) {
            $recordLinks['LBL_SHOW_COMPLETE_DETAILS'] = [
Severity: Minor
Found in modules/Users/models/Record.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 parseTreeDataForSave has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseTreeDataForSave(array $tree): array
    {
        $values = [];
        foreach ($tree as $branch) {
            $value = [];
Severity: Minor
Found in modules/Settings/TreesManager/models/Record.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 replaceValue has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function replaceValue($tree, $templateId)
    {
        $db = App\Db::getInstance();
        $modules = $this->get('share');
        $modules[] = $this->get('tabid');
Severity: Minor
Found in modules/Settings/TreesManager/models/Record.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 getBaseModuleToolsExceptions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getBaseModuleToolsExceptions()
    {
        $exceptions = [];
        $actionIds = (new \App\Db\Query())->select(['actionname', 'actionid'])->from('vtiger_actionmapping')->createCommand()->queryAllByGroup();
        foreach (static::$baseModuleToolsExceptions as $moduleName => $moduleException) {
Severity: Minor
Found in modules/Settings/ModuleManager/models/Module.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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPermission(App\Request $request)
    {
        $currentUserModel = Users_Record_Model::getCurrentUserModel();
        switch ($request->getMode()) {
            case 'reset':
Severity: Minor
Found in modules/Users/views/PasswordModal.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 reloadApprovals has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function reloadApprovals(int $contactId): array
    {
        if (\App\Record::isExists($contactId)) {
            $moduleName = 'ApprovalsRegister';
            $relatedModule = 'Approvals';
Severity: Minor
Found in modules/ApprovalsRegister/models/Module.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 refreshBanks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function refreshBanks()
    {
        $db = App\Db::getInstance();
        $dataReader = (new \App\Db\Query())->select(['id', 'bank_name'])
            ->from('yetiforce_currencyupdate_banks')
Severity: Minor
Found in modules/Settings/CurrencyUpdate/models/Module.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 update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function update(App\Request $request): void
    {
        $response = new Vtiger_Response();
        try {
            $fieldInstance = Settings_LayoutEditor_Field_Model::getInstance($request->getInteger('fieldId'));
Severity: Minor
Found in modules/Settings/LayoutEditor/actions/WebserviceApps.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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function setDataFromRequest(App\Request $request)
    {
        foreach ($this->getEditFields() as $fieldName => $fieldModel) {
            if ($request->has($fieldName)) {
                $value = $request->isEmpty($fieldName) && !$fieldModel->isMandatory() ? '' : $request->getByType($fieldName, $fieldModel->get('purifyType'));
Severity: Minor
Found in modules/Settings/SMSNotifier/models/Record.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 check has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function check(): bool
    {
        $db = \App\Db::getInstance();
        $check = $db->isTableExists(\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME) && $db->isTableExists(\App\Integrations\Wapro::LOG_TABLE_NAME);
        if ($check) {
Severity: Minor
Found in modules/Settings/Wapro/models/Activation.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