YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    private function addSearchLabel(): void
    {
        $query = (new App\Db\Query())->select(['vtiger_crmentity.crmid', 'vtiger_crmentity.setype'])
            ->from('vtiger_crmentity')
            ->innerJoin('vtiger_tab', 'vtiger_tab.name = vtiger_crmentity.setype')
Severity: Minor
Found in modules/Vtiger/crons/LabelUpdater.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 getCustomFields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCustomFields(): array
    {
        $fields = [];
        $fromRelations = (array) ($this->Data['fromRelation'] ?? []);
        if ($fromRelations && ($relations = array_intersect_key($this->getRelations($this->moduleModel->getId()), array_flip($fromRelations)))) {
Severity: Minor
Found in modules/Vtiger/widgets/Documents.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 addRelation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function addRelation(App\Request $request)
    {
        $sourceModule = $request->getModule();
        $sourceRecordId = $request->getInteger('src_record');
        $relatedModule = $request->getByType('related_module', 2);
Severity: Minor
Found in modules/Vtiger/actions/RelationAjax.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 massDeleteRelation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function massDeleteRelation(App\Request $request)
    {
        $sourceModule = $request->getModule();
        $relatedModuleName = $request->getByType('relatedModule', 2);
        $sourceRecordId = $request->getInteger('src_record');
Severity: Minor
Found in modules/Vtiger/actions/RelationAjax.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 getValueForEditView has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getValueForEditView(string $name)
    {
        $value = '';
        switch ($name) {
            case 'title':
Severity: Minor
Found in modules/Vtiger/dashboards/ChartFilterModel.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 getHeaders has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHeaders()
    {
        $this->initListViewController();
        if (empty($this->listviewHeaders)) {
            $headerFieldModels = [];
Severity: Minor
Found in modules/Vtiger/dashboards/ProductsSoldToRenew.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 transformToAdvancedFilterCondition has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function transformToAdvancedFilterCondition($conditions = false)
    {
        $transformedConditions = [];
        $firstGroup = [];
        $secondGroup = [];
Severity: Minor
Found in modules/Vtiger/helpers/AdvancedFilter.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)
    {
        $currentUser = Users_Record_Model::getCurrentUserModel();
        $viewer = $this->getViewer($request);
        $moduleName = 'Home';
Severity: Minor
Found in modules/Vtiger/dashboards/CalendarActivities.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 transformInventoryReference has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function transformInventoryReference($value, $getArray = false)
    {
        $value = trim($value);
        if (!empty($value)) {
            if (strpos($value, '::::') > 0) {
Severity: Minor
Found in modules/Import/actions/Data.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 getChildIds has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getChildIds(int $id, &$childIds = []): array
    {
        $recordsIds = (new App\Db\Query())->select([
            'vtiger_troubletickets.ticketid',
        ])->from('vtiger_troubletickets')
Severity: Minor
Found in modules/HelpDesk/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 getFields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFields($blockInstance = false)
    {
        if (empty($this->fields)) {
            $moduleModel = $this->getImportModuleModel();
            $this->fields = [];
Severity: Minor
Found in modules/Import/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)
    {
        $currentUser = Users_Record_Model::getCurrentUserModel();
        $moduleName = 'Home';
        $page = $request->getInteger('page');
Severity: Minor
Found in modules/Vtiger/dashboards/OverdueActivities.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 checkPermission has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPermission(App\Request $request)
    {
        if (!Users_Privileges_Model::getCurrentUserPrivilegesModel()->hasModulePermission($request->getModule())) {
            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
        }
Severity: Minor
Found in modules/MailIntegration/actions/Mail.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 getFieldInstanceByName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name)
    {
        if (!isset($this->customFields[$name])) {
            return parent::getFieldInstanceByName($name);
        }
Severity: Minor
Found in modules/Vtiger/dashboards/MultifilterModel.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 getInstanceFromDb has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getInstanceFromDb($row)
    {
        $map = [];
        foreach ($row as $key => $value) {
            if ('content' == $key) {
Severity: Minor
Found in modules/Import/models/Map.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 setDataFromRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setDataFromRequest(App\Request $request)
    {
        parent::setDataFromRequest($request);
        foreach ($this->customFields as $fieldName => $fieldInfo) {
            if ($request->has($fieldName)) {
Severity: Minor
Found in modules/FInvoice/dashboards/SummationByMonthsModel.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 setDataFromRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setDataFromRequest(App\Request $request)
    {
        foreach ($this->customFields as $fieldName => $fieldInfo) {
            if ($request->has($fieldName)) {
                $value = $request->getByType($fieldName, $fieldInfo['purifyType']);
Severity: Minor
Found in modules/Vtiger/dashboards/MultifilterModel.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)
    {
        $moduleName = $request->getModule();
        $moduleModel = OpenStreetMap_Module_Model::getInstance($moduleName);
        $coordinatesModel = OpenStreetMap_Coordinate_Model::getInstance();
Severity: Minor
Found in modules/OpenStreetMap/views/MapModal.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 loadWebserviceByField has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function loadWebserviceByField(\Vtiger_Field_Model $fieldModel, \Api\Core\BaseAction $actionModel, ?array $fieldData = null): void
    {
        if (null === $fieldData) {
            $fieldData = self::getFields($actionModel->controller->app['id'], $fieldModel->getModuleId())[$fieldModel->getName()] ?? [];
        }
Severity: Minor
Found in api/webservice/WebserviceStandard/Fields.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 getGanttTasks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getGanttTasks($projectIds)
    {
        $taskTime = 0;
        $queryGenerator = new App\QueryGenerator('ProjectTask');
        $queryGenerator->setFields(['id', 'projectid', 'projecttaskname', 'parentid', 'projectmilestoneid', 'projecttaskprogress', 'projecttaskpriority', 'startdate', 'enddate', 'targetenddate', 'sum_time', 'projecttask_no', 'projecttaskstatus', 'estimated_work_time', 'assigned_user_id']);
Severity: Minor
Found in modules/Project/models/Gantt.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