YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getAllErrors has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAllErrors(bool $cache = false)
    {
        $fileCache = ROOT_DIRECTORY . '/app_data/ConfReport_AllErrors.php';
        if ($cache && file_exists($fileCache) && filemtime($fileCache) > strtotime('-15 minute')) {
            return require $fileCache;
Severity: Minor
Found in app/Utils/ConfReport.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 getFieldInstanceByName has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name)
    {
        $params = [];
        $qualifiedModuleName = 'Settings:Picklist';
        $tableName = $this->getTableName();
Severity: Minor
Found in app/Fields/Picklist/Item.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 getPayerId has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getPayerId(): string
    {
        $bbanLength = $this->countryIban->BBANLength();
        $conditionsForPayerId = $this->fieldParams['conditions'];
        $payerCharactersAmount = $bbanLength - \strlen($this->fieldParams['sortCode']) - \strlen($this->fieldParams['clientId']);
Severity: Minor
Found in app/Fields/Iban.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 find has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function find($value): array
    {
        if (empty($value) || !\App\RequestUtil::isNetConnection()) {
            return [];
        }
Severity: Minor
Found in app/Map/Address/NominatimGeocoder.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 getEditFields has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getEditFields(): array
    {
        $fields = [];
        $editFields = ['name'];
        $editFields[] = 'icon';
Severity: Minor
Found in app/Fields/Picklist/Item.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 getQueryInitUsers has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQueryInitUsers($private = false, $status = false, $roles = false)
    {
        $entityData = \App\Module::getEntityInfo('Users');
        $selectFields = array_unique(array_merge($entityData['fieldnameArr'], ['id' => 'id', 'is_admin', 'cal_color', 'status']));
        // Including deleted vtiger_users for now.
Severity: Minor
Found in app/Fields/Owner.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 setRecordAddress has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function setRecordAddress(string $moduleName, \Vtiger_Record_Model $record): void
    {
        foreach ($this->card->ADR as $property) {
            if ($typeOfAddress = $this->getTypeOfAddress($property)) {
                $address = $this->convertAddress($property->getParts());
Severity: Minor
Found in app/Integrations/Dav/Card.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 cleanAttachments has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function cleanAttachments()
    {
        foreach ($this->getModule()->getFieldsByType(['image', 'multiImage'], true) as $fieldName => $fieldModel) {
            $currentData = [];
            if ($this->get($fieldName) && ($this->isNew() || false !== $this->getPreviousValue($fieldName))) {
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 flattenKeys has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static function flattenKeys(array $array, string $type = '_', float $depth = INF): array
    {
        $result = [];
        foreach ($array as $key => $item) {
            if (\is_array($item)) {
Severity: Minor
Found in app/Utils.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 addRoleToPicklist has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static function addRoleToPicklist($fields): void
    {
        \App\Log::trace('Entering ' . __METHOD__);
        $db = \App\Db::getInstance();
        $schema = $db->getSchema();
Severity: Minor
Found in app/Db/Updater.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 getFields has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFields(): array
    {
        $fieldsModel = [];
        foreach ($this->fields as $fieldName => $data) {
            if (isset($data['picklistValuesFunction'])) {
Severity: Minor
Found in app/RecordCollectors/Base.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 isMemberEditable has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    private function isMemberEditable(string $member): bool
    {
        $userModel = \App\User::getCurrentUserModel();
        [$type, $id] = explode(':', $member);
        if (!$userModel->isAdmin() && null === $this->subordinates) {
Severity: Minor
Found in modules/Users/actions/Groups.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 transformAdvanceFilterToWorkFlowFilter has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function transformAdvanceFilterToWorkFlowFilter()
    {
        \App\Log::trace('Entering ' . __METHOD__ . '() method ...');
        $conditions = $this->get('conditions');
        $wfCondition = [];
Severity: Minor
Found in modules/Settings/MappedFields/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 delete has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete()
    {
        $db = \App\Db::getInstance();
        try {
            parent::delete();
Severity: Minor
Found in modules/Settings/LayoutEditor/models/Field.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 saveSwitchUsers has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveSwitchUsers($data): void
    {
        $switchUsers = $switchUsersRaw = [];
        if (!empty($data) && \count($data)) {
            foreach ($data as $row) {
Severity: Minor
Found in modules/Settings/Users/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 getTree has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTree($category = false, $treeValue = false)
    {
        $tree = [];
        $templateId = $this->getId();
        if (empty($templateId)) {
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 importUserModuleStep2 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function importUserModuleStep2(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $uploadDir = Settings_ModuleManager_Module_Model::getUploadDirectory();
        $qualifiedModuleName = $request->getModule(false);
Severity: Minor
Found in modules/Settings/ModuleManager/views/ModuleImport.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 getFieldInstanceByName has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name)
    {
        $moduleName = $this->getModule()->getName(true);
        $fieldsLabel = $this->getEditFields();
        $params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'label' => $fieldsLabel[$name], 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
Severity: Minor
Found in modules/Settings/WebserviceUsers/services/WebserviceStandard.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 saveToDb has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveToDb()
    {
        $db = \App\Db::getInstance('admin');
        $tablesData = $this->getValuesForSave();
        $transaction = $db->beginTransaction();
Severity: Minor
Found in modules/Settings/PickListDependency/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 initializeListViewContents has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
    {
        $qualifiedModuleName = $request->getModule(false);
        $pageNumber = $request->getInteger('page');
        $orderBy = $request->getForSql('orderby');
Severity: Minor
Found in modules/Settings/Vtiger/views/List.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