YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function getRecordsFromArray(array $rows)
    {
        $listViewRecordModels = $relatedFields = [];
        $moduleModel = $this->getRelationModel()->getRelationModuleModel();
        $recordId = $this->getParentRecordModel()->getId();
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 loadListViewCondition has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadListViewCondition()
    {
        $queryGenerator = $this->getQueryGenerator();
        if ($entityState = $this->get('entityState')) {
            $queryGenerator->setStateCondition($entityState);
Severity: Minor
Found in modules/Vtiger/models/ListView.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 getDefaultValidator has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDefaultValidator(): array
    {
        $validator = [];
        $fieldName = $this->getName();
        switch ($fieldName) {
Severity: Minor
Found in modules/Vtiger/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 getDisplayValue has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
    {
        $extra = '';
        $href = $international = \App\Purifier::encodeHtml($value);
        if ((\Config\Main::$phoneFieldAdvancedVerification ?? false) && ($format = \App\Config::main('phoneFieldAdvancedHrefFormat', \libphonenumber\PhoneNumberFormat::RFC3966)) !== false) {
Severity: Minor
Found in modules/Vtiger/uitypes/Phone.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 validate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, $isUserFormat = false)
    {
        if (empty($value)) {
            return;
        }
Severity: Minor
Found in modules/Vtiger/uitypes/MultiEmail.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 getDisplayValue has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
    {
        if (empty($value)) {
            return '';
        }
Severity: Minor
Found in modules/Vtiger/uitypes/Tree.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 getSummaryInfo has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSummaryInfo()
    {
        $moduleName = $this->getModuleName();
        $path = "modules/$moduleName/summary_blocks";
        if (!is_dir($path)) {
Severity: Minor
Found in modules/Vtiger/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 getFieldInstanceByName has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name)
    {
        $moduleName = 'Settings:WidgetsManagement';
        $field = $this->getEditFields()[$name] ?? null;
        if (!$field) {
Severity: Minor
Found in modules/Vtiger/models/Widget.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 getStructure has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStructure(): array
    {
        $summaryFieldsList = $this->getModule()->getSummaryViewFieldsList();
        $recordModel = $this->getRecord();
        $fieldsDependency = \App\FieldsDependency::getByRecordModel('Detail', $recordModel);
Severity: Minor
Found in modules/Vtiger/models/SummaryRecordStructure.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 getEntries has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getEntries(): array
    {
        $entries = [];
        $addInventoryData = $this->fullData && $this->moduleInstance->isInventory();
        if ($addInventoryData) {
Severity: Minor
Found in modules/Vtiger/models/ExportToCsv.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 getAll has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAll($presence = [], $restrictedModulesList = [], $isEntityType = false)
    {
        $allModules = \vtlib\Functions::getAllModules($isEntityType, true);
        $moduleModels = [];
        foreach ($allModules as &$row) {
Severity: Minor
Found in modules/Vtiger/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 checkImportStatus has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkImportStatus(App\Request $request)
    {
        $moduleName = $request->getModule();
        $user = \App\User::getCurrentUserModel();
        // Check if import on the module is locked
Severity: Minor
Found in modules/Vtiger/views/Import.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 positions has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function positions(App\Request $request): void
    {
        $currentUserId = App\User::getCurrentUserId();
        if ($positionsMap = $request->getMultiDimensionArray('position', [['row' => 'Integer',    'col' => 'Integer']])) {
            foreach ($positionsMap as $id => $position) {
Severity: Minor
Found in modules/Vtiger/actions/Widget.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 getQuery has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQuery(App\Request $request)
    {
        $moduleName = $request->getModule();
        $sourceModule = $request->getByType('sourceModule', 2);
        if ($sourceModule) {
Severity: Minor
Found in modules/Vtiger/views/SendMailModal.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 14 (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/ExportData.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 getQuery has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getQuery($recordId, $moduleName, $type)
    {
        $queries = [];
        $db = App\Db::getInstance();
        if (\in_array('Calendar', $type) && ($field = current(\Vtiger_Module_Model::getInstance('Calendar')->getReferenceFieldsForModule($moduleName)))) {
Severity: Minor
Found in modules/Vtiger/widgets/HistoryRelation.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 getChildIStorages has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getChildIStorages($id, &$childIStorages, $depthBase)
    {
        \App\Log::trace('Entering getChildIStorages(' . $id . ',' . $depthBase . ') method ...');

        if (empty($id) || $depthBase === App\Config::module('IStorages', 'MAX_HIERARCHY_DEPTH')) {
Severity: Minor
Found in modules/IStorages/IStorages.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 updateData has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static function updateData(int $recordId)
    {
        $recordModel = \Vtiger_Record_Model::getInstanceById($recordId, 'Queue');
        $data = \App\Json::decode($recordModel->get('changes')) ?: [];
        if ($data) {
Severity: Minor
Found in modules/Queue/handlers/Queue.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 getStatuses has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStatuses()
    {
        $closingStatuses = Settings_RealizationProcesses_Module_Model::getStatusNotModify();
        if (empty($closingStatuses['Project'])) {
            $closingStatuses['Project'] = ['status' => []];
Severity: Minor
Found in modules/Project/models/Gantt.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 moduleHandler has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        if ('module.postinstall' === $eventType) {
            $moduleInstance = vtlib\Module::getInstance($moduleName);

Severity: Minor
Found in modules/Project/Project.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