YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getPicklistValues has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPicklistValues(string $moduleName): array
    {
        $modules = $this->getParamsConfig();
        if ($moduleName) {
            foreach ($modules as $module => $field) {
Severity: Minor
Found in modules/Vtiger/inventoryfields/PicklistField.php - About 55 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 getDefaultMandatoryFieldValues has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDefaultMandatoryFieldValues()
    {
        $key = $this->module . '_' . $this->user->getId();
        if (\App\Cache::staticHas('DefaultMandatoryFieldValues', $key)) {
            return \App\Cache::staticGet('DefaultMandatoryFieldValues', $key);
Severity: Minor
Found in modules/Import/actions/Data.php - About 55 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 validateFileUpload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function validateFileUpload(App\Request $request)
    {
        $currentUser = \App\User::getCurrentUserModel();

        $uploadMaxSize = \App\Config::getMaxUploadSize();
Severity: Minor
Found in modules/Import/helpers/Utils.php - About 55 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 getImportStatusCount has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getImportStatusCount()
    {
        $statusCount = ['TOTAL' => 0, 'IMPORTED' => 0, 'FAILED' => 0, 'PENDING' => 0,
            'CREATED' => 0, 'SKIPPED' => 0, 'UPDATED' => 0, 'MERGED' => 0, ];
        $tableName = Import_Module_Model::getDbTableName($this->user);
Severity: Minor
Found in modules/Import/actions/Data.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function checkPermission(): void
    {
        parent::checkPermission();
        $moduleName = $this->controller->request->getModule();
        if ('POST' === $this->controller->method) {
Severity: Minor
Found in api/webservice/WebserviceStandard/Users/Record.php - About 55 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 get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function get(): array
    {
        $privileges = [];
        if (\App\User::isExists($this->getUserData('user_id'))) {
            $moduleName = $this->controller->request->getModule('module');
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/Privileges.php - About 55 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 getQuery has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQuery()
    {
        $queryGenerator = new \App\QueryGenerator($this->controller->request->getModule());
        $limit = 1000;
        if ($requestLimit = $this->controller->request->getHeader('x-row-limit')) {
Severity: Minor
Found in api/webservice/ManageConsents/Approvals/RecordsList.php - About 55 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 getParentRecordsIdsRecursive has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function getParentRecordsIdsRecursive($parentId, $parents = [])
    {
        if (empty($parentId)) {
            return $parents;
        }
Severity: Minor
Found in modules/Project/models/Gantt.php - About 55 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 debugRequest has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function debugRequest(): void
    {
        if (\App\Config::debug('apiLogAllRequests')) {
            $log = '============ Request ' . \App\RequestUtil::requestId() . ' (Controller) ======  ' . date('Y-m-d H:i:s') . "  ======\n";
            $log .= 'REQUEST_METHOD: ' . \App\Request::getRequestMethod() . PHP_EOL;
Severity: Minor
Found in api/webservice/Controller.php - About 55 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 entityAfterSave has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function entityAfterSave(App\EventHandler $eventHandler)
    {
        $recordModel = $eventHandler->getRecordModel();
        if (!$recordModel->isNew()) {
            if (false !== ($value = $recordModel->getPreviousValue('parentid'))) {
Severity: Minor
Found in modules/Project/handlers/ProjectHandler.php - About 55 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 handleError has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function handleError(): void
    {
        if (\App\Config::debug('apiLogException')) {
            $request = Request::init();
            $error = "code: {$this->getCode()} | message: {$this->getMessage()}\n";
Severity: Minor
Found in api/webservice/Core/Exception.php - About 55 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 saveCommentAjax has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

            element,
            commentMode,
            commentContentValue,
            editCommentReason,
            commentId,
Severity: Major
Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 50 mins to fix

    Method register has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function register($name, $handlerClass, $frequency, $module = 'Home', $status = 1, $sequence = 0, $description = '')
    Severity: Major
    Found in vtlib/Vtiger/Cron.php - About 50 mins to fix

      Method imapConnect has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
      Severity: Major
      Found in modules/OSSMail/models/Record.php - About 50 mins to fix

        Method setChartDatasetsColorsSingle has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            protected function setChartDatasetsColorsSingle(&$chartData, $datasetIndex, $dataset, $groupValue, $group, $dividingValue, $dividing)
        Severity: Major
        Found in modules/Vtiger/models/ChartFilter.php - About 50 mins to fix

          Method setChartDatasetsColorsMulti has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              protected function setChartDatasetsColorsMulti(&$chartData, $datasetIndex, $dataset, $groupValue, $group, $dividingValue, $dividing)
          Severity: Major
          Found in modules/Vtiger/models/ChartFilter.php - About 50 mins to fix

            Function triggerChangeAccessKey has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                    triggerChangeAccessKey: function (url) {
                        app.showConfirmModal({
                            title: app.vtranslate('JS_NEW_ACCESS_KEY_REQUESTED'),
                            text: app.vtranslate('JS_CHANGE_ACCESS_KEY_CONFIRMATION'),
                            confirmedCallback: () => {
            Severity: Minor
            Found in public_html/layouts/basic/modules/Users/resources/Detail.js - About 45 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 createTree has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                    createTree: function () {
                        const self = this;
                        if (!this.jstreeInstance) {
                            self.jstreeLastID = parseInt($('#treeLastID').val());
                            let treeValues = $('#treeValues').val(),

            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 onBusinessHoursRowClick has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                    onBusinessHoursRowClick(e) {
                        e.stopPropagation();
                        const target = $(e.target);
                        const isCheckbox = target.hasClass('js-business-hours-checkbox');
                        const row = target.closest('tr');
            Severity: Minor
            Found in public_html/layouts/basic/modules/Settings/SlaPolicy/resources/Edit.js - About 45 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 loadDefaultValueWidget has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                    loadDefaultValueWidget: function (element) {
                        var thisInstance = this;
                        var id = element.val() + '_defaultvalue';
                        var affectedRow = jQuery('#defaultValuesElementsContainer').find('#' + id);
                        var dafeultTd = element.closest('td').next();

            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