YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function verifyDashboard has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function verifyDashboard($moduleName)
    {
        \App\Log::trace('Entering ' . __METHOD__ . '(' . $moduleName . ')');
        $currentUser = Users_Record_Model::getCurrentUserModel();
        $blockId = Settings_WidgetsManagement_Module_Model::getBlocksFromModule($moduleName, $currentUser->getRole(), $this->get('dashboardId'));
Severity: Minor
Found in modules/Vtiger/models/DashBoard.php - About 35 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 getCreateViewUrl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCreateViewUrl(bool $fullView = false)
    {
        $createViewUrl = $this->getRelationModel()->getCreateViewUrl($fullView);
        if (!empty(Config\Relation::$addSearchParamsToCreateView) && ($searchParams = $this->getArray('search_params')) && isset($searchParams['and']) && \is_array($searchParams['and'])) {
            foreach ($searchParams['and'] as $row) {
Severity: Minor
Found in modules/Vtiger/models/RelationListView.php - About 35 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 getInventoryDataById has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getInventoryDataById(int $recordId, string $moduleName, ?Vtiger_Paging_Model $pagingModel = null): array
    {
        $inventory = self::getInstance($moduleName);
        $query = (new \App\Db\Query())->from($inventory->getTableName(self::TABLE_POSTFIX_DATA))->indexBy('id')->where(['crmid' => $recordId]);
        if ($inventory->isField('seq')) {
Severity: Minor
Found in modules/Vtiger/models/Inventory.php - About 35 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 getDiscountsConfig has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getDiscountsConfig(string $key = '')
    {
        if (\App\Cache::has('Inventory', 'DiscountConfiguration')) {
            $config = \App\Cache::get('Inventory', 'DiscountConfiguration');
        } else {
Severity: Minor
Found in modules/Vtiger/models/Inventory.php - About 35 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 getCustomAutoComplete has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCustomAutoComplete(string $sourceFieldName, Vtiger_Record_Model $recordModel)
    {
        $values = [];
        $inventoryMap = App\Config::module($this->getModuleName(), 'INVENTORY_ON_SELECT_AUTO_COMPLETE');
        if ($inventoryMap) {
Severity: Minor
Found in modules/Vtiger/models/Inventory.php - About 35 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 getFieldValueColor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getFieldValueColor($groupValue, $dividingValue)
    {
        $color = App\Colors::EMPTY_COLOR;
        if ($this->areColorsFromDividingField()) {
            if (!empty($this->fieldValueColors[$dividingValue])) {
Severity: Minor
Found in modules/Vtiger/models/ChartFilter.php - About 35 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 getInActiveFields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getInActiveFields($raw = true)
    {
        $inActiveFields = [];
        foreach ($this->getFields() as $fieldName => $fieldModel) {
            if (!$fieldModel->isActiveField()) {
Severity: Minor
Found in modules/Vtiger/models/Block.php - About 35 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 getFieldsByType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldsByType($type, bool $active = false): array
    {
        if (!\is_array($type)) {
            $type = [$type];
        }
Severity: Minor
Found in modules/Vtiger/models/Module.php - About 35 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 getParser has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParser()
    {
        if (!isset($this->textParser)) {
            if (isset($this->variables['recordId'])) {
                $this->textParser = \App\TextParser::getInstanceById($this->variables['recordId'], $this->get('module_name'));
Severity: Minor
Found in modules/Vtiger/models/PDF.php - About 35 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 getSummaryViewFieldsList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSummaryViewFieldsList()
    {
        if (!isset($this->summaryFields)) {
            $summaryFields = [];
            foreach ($this->getFields() as $fieldName => &$fieldModel) {
Severity: Minor
Found in modules/Vtiger/models/Module.php - About 35 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 getFieldFilterValueType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldFilterValueType($fieldname)
    {
        $conditions = $this->get('conditions');
        if (!empty($conditions) && \is_array($conditions)) {
            foreach ($conditions as $filter) {
Severity: Minor
Found in modules/Vtiger/models/PDF.php - About 35 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 loadGroup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadGroup(): void
    {
        if (isset($this->wizardMap[0]['groupConditions'])) {
            foreach ($this->wizardMap as $groupMap) {
                if (isset($groupMap['groupConditions']) && \App\Condition::checkConditions($groupMap['groupConditions'], $this->recordModel)) {
Severity: Minor
Found in modules/Vtiger/models/ProcessWizard.php - About 35 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 initInventoryDataFromRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function initInventoryDataFromRequest(App\Request $request): void
    {
        $inventory = Vtiger_Inventory_Model::getInstance($this->getModuleName());
        $rawInventory = $request->getRaw('inventory');
        if (isset($rawInventory['_NUM_'])) {
Severity: Minor
Found in modules/Vtiger/models/Record.php - About 35 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 getQuickCreateFields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQuickCreateFields()
    {
        $quickCreateFieldList = [];
        foreach ($this->getFieldsByBlocks() as $blockFields) {
            foreach ($blockFields as $fieldName => $fieldModel) {
Severity: Minor
Found in modules/Vtiger/models/Module.php - About 35 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 getFieldFilterValueType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldFilterValueType($fieldname)
    {
        $conditions = $this->get('conditions');
        if (!empty($conditions) && \is_array($conditions)) {
            foreach ($conditions as $filter) {
Severity: Minor
Found in modules/Vtiger/models/MappedFields.php - About 35 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 getSideBarLinks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSideBarLinks($linkParams)
    {
        $menuUrl = '';
        if (isset($_REQUEST['parent'])) {
            $menuUrl .= '&parent=' . \App\Request::_getByType('parent', 'Alnum');
Severity: Minor
Found in modules/Vtiger/models/Module.php - About 35 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 getMandatoryFieldModels has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMandatoryFieldModels()
    {
        $mandatoryFields = [];
        if ($fieldsArray = $this->getFields()) {
            foreach ($fieldsArray as $field) {
Severity: Minor
Found in modules/Vtiger/models/Module.php - About 35 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 getEntityModules has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getEntityModules()
    {
        $moduleModels = Vtiger_Cache::get('vtiger', 'EntityModules');
        if (!$moduleModels) {
            $presence = [0, 2];
Severity: Minor
Found in modules/Vtiger/models/Module.php - About 35 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 process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        if ($request->isEmpty('mode')) {
            if (!$this->checkImportStatus($request)) {
                $this->importBasicStep($request);
Severity: Minor
Found in modules/Vtiger/views/Import.php - About 35 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 undoRecords has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function undoRecords(string $moduleName)
    {
        $dbTableName = Import_Module_Model::getDbTableName(App\User::getCurrentUserModel());
        $dataReader = (new \App\Db\Query())->select(['recordid'])
            ->from($dbTableName)
Severity: Minor
Found in modules/Vtiger/views/Import.php - About 35 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