YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function importLayout has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function importLayout($zipfile)
    {
        $name = $this->_modulexml->name;
        $label = $this->_modulexml->label;
        \App\Log::trace("Importing $name ... STARTED", __METHOD__);
Severity: Minor
Found in vtlib/Vtiger/LayoutImport.php - About 4 hrs 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 parseParams has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseParams(array $params)
    {
        foreach ($params as $param => $value) {
            switch ($param) {
                case 'margin-top':
Severity: Minor
Found in app/Pdf/Drivers/Base.php - About 4 hrs 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 parsePhone has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    private function parsePhone(): void
    {
        $country = null;
        if ($userId = $this->user ? $this->user->getId() : null) {
            $country = \App\Fields\Country::getCountryCode(\App\User::getUserModel($userId)->getDetail('sync_carddav_default_country'));
Severity: Minor
Found in app/Integrations/Dav/Card.php - About 4 hrs 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 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate(array $data, bool $throw = true)
    {
        $message = null;
        $code = null;
        $result = false;
Severity: Minor
Found in modules/Settings/LayoutEditor/models/Module.php - About 4 hrs 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 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $dbCommand = App\Db::getInstance()->createCommand();
        $scannerModel = Vtiger_Record_Model::getCleanInstance('OSSMailScanner');
        $dataReader = (new App\Db\Query())->select([
Severity: Minor
Found in modules/OSSMailScanner/crons/Bind.php - About 4 hrs 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 normalizeData has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    protected function normalizeData()
    {
        foreach ($this->data as &$dividing) {
            foreach ($dividing as $groupValueKey => &$values) {
                // iterate data one more time to search other group values
Severity: Minor
Found in modules/Vtiger/models/ChartFilter.php - About 4 hrs 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 showRelatedRecords has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function showRelatedRecords(App\Request $request)
    {
        $parentId = $request->getInteger('record');
        $pageNumber = $request->getInteger('page');
        $relationId = $request->isEmpty('relationId') ? false : $request->getInteger('relationId');
Severity: Minor
Found in modules/Vtiger/views/Detail.php - About 4 hrs 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 showSearchResults has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function showSearchResults(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $advFilterList = $request->getArray('advfilterlist', 'Text');
Severity: Minor
Found in modules/Vtiger/views/BasicAjax.php - About 4 hrs 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 118 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Method db has 117 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static function db(): array
        {
            $benchmarkCountGroup = 20;
            $insertCountGroup = 5;
            $updateCountGroup = 5;
    Severity: Major
    Found in app/Utils/Benchmarks.php - About 4 hrs to fix

      Validator has 36 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Validator
      {
          /**
           * Function verifies if given value can be recognized as bool.
           *
      Severity: Minor
      Found in app/Validator.php - About 4 hrs to fix

        DateField has 36 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class DateField extends BaseField
        {
            use \App\Conditions\RecordTraits\Comparison;
            use \App\Conditions\RecordTraits\ComparisonField;
        
        
        Severity: Minor
        Found in app/Conditions/RecordFields/DateField.php - About 4 hrs to fix

          Calendar has 36 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Calendar
          {
              /**
               * Record model instance.
               *
          Severity: Minor
          Found in app/Integrations/Dav/Calendar.php - About 4 hrs to fix

            Method initializeListViewContents has 116 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
                {
                    $moduleName = $request->getModule();
                    $cvId = $request->getByType('viewname', 2);
                    $pageNumber = $request->getInteger('page');
            Severity: Major
            Found in modules/Users/views/List.php - About 4 hrs to fix

              Method generate has 115 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function generate(App\Request $request): void
                  {
                      $pdfModuleName = $request->getModule();
                      $view = $request->getByType('fromview', \App\Purifier::STANDARD);
                      $recordId = $request->isEmpty('record', true) ? null : $request->getInteger('record');
              Severity: Major
              Found in modules/Vtiger/actions/PDF.php - About 4 hrs to fix

                Function registerParams has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                Open

                        registerParams(selectElement, params) {
                            if (typeof params.dropdownParent === 'undefined') {
                                const modalParent = $(selectElement).closest('.modal-body');
                                if (modalParent.length) {
                                    params.dropdownParent = modalParent;
                Severity: Minor
                Found in public_html/layouts/resources/Fields.js - About 4 hrs 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 retrieveEntityInfo has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function retrieveEntityInfo(int $record, string $module)
                    {
                        if (!isset($record)) {
                            throw new \App\Exceptions\NoPermittedToRecord('LBL_RECORD_NOT_FOUND');
                        }
                Severity: Minor
                Found in include/CRMEntity.php - About 4 hrs 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 hardDrive has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static function hardDrive(): array
                    {
                        $countGroup = 50;
                        $maxTime = 0.2;
                        $read = $write = [];
                Severity: Minor
                Found in app/Utils/Benchmarks.php - About 4 hrs 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 updateRecords has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function updateRecords()
                    {
                        if ($this->isEmpty('id')) {
                            return [];
                        }
                Severity: Minor
                Found in app/Fields/RecordNumber.php - About 4 hrs 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 transferOwnershipForWorkflow has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                Open

                    private static function transferOwnershipForWorkflow($oldId, $newId)
                    {
                        $db = \App\Db::getInstance();
                        $ownerName = static::getLabel($oldId);
                        $newOwnerName = static::getLabel($newId);
                Severity: Minor
                Found in app/Fields/Owner.php - About 4 hrs 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