YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function registerSummaryViewContainerEvents has 134 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        registerSummaryViewContainerEvents: function (summaryViewContainer) {
            let thisInstance = this;
            this.registerEventForActivityWidget();
            this.registerChangeFilterForWidget();
            this.registerAddingInventoryRecords();
Severity: Major
Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 5 hrs to fix

    Method getFieldInstanceByName has 134 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getFieldInstanceByName($name)
        {
            $moduleName = $this->getName(true);
            $params = ['uitype' => 7, 'column' => $name, 'name' => $name,  'displaytype' => 1, 'typeofdata' => 'I~M', 'presence' => 0, 'isEditableReadOnly' => false, 'maximumlength' => '', 'validator' => [['name' => 'NumberRange100']], 'source' => 'main'];
            switch ($name) {
    Severity: Major
    Found in modules/Settings/ConfigEditor/models/Module.php - About 5 hrs to fix

      Method process has 132 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function process(App\Request $request)
          {
              if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
                  header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
              }
      Severity: Major
      Found in include/main/WebUI.php - About 5 hrs to fix

        Method getFieldInstanceByName has 132 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getFieldInstanceByName($name)
            {
                $params = [];
                $qualifiedModuleName = 'Settings:Picklist';
                $tableName = $this->getTableName();
        Severity: Major
        Found in app/Fields/Picklist/Item.php - About 5 hrs to fix

          Function exportRelatedLists has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public function exportRelatedLists(ModuleBasic $moduleInstance)
              {
                  if (!$moduleInstance->isentitytype) {
                      return;
                  }
          Severity: Minor
          Found in vtlib/Vtiger/PackageExport.php - About 5 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 purifyMultiDimensionArray has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              private function purifyMultiDimensionArray($values, $template)
              {
                  if (\is_array($template)) {
                      foreach ($values as $firstKey => $value) {
                          if (\is_array($value)) {
          Severity: Minor
          Found in app/Request.php - About 5 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 getSender has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getSender(): array
              {
                  if (isset($this->senderCache)) {
                      return $this->senderCache;
                  }
          Severity: Minor
          Found in app/Mail/Rbl.php - About 5 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 getStructure has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getStructure()
              {
                  if (!empty($this->structuredValues)) {
                      return $this->structuredValues;
                  }
          Severity: Minor
          Found in modules/Users/models/DetailRecordStructure.php - About 5 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 save has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public function save()
              {
                  $db = \App\Db::getInstance();
                  $settingsModel = Settings_Menu_Module_Model::getInstance();
                  $edit = $this->get('edit');
          Severity: Minor
          Found in modules/Settings/Menu/models/Record.php - About 5 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 createXml has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public function createXml($entries, $entriesInventory)
              {
                  $exportBlockName = \App\Config::component('Export', 'BLOCK_NAME');
                  $xml = new \XMLWriter();
                  $xml->openMemory();
          Severity: Minor
          Found in modules/Vtiger/models/ExportToXml.php - About 5 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 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public function process(App\Request $request)
              {
                  $moduleName = $request->getModule();
                  $relatedModuleName = $request->getByType('relatedModule', 2);
                  $parentId = $request->getInteger('record');
          Severity: Minor
          Found in modules/Vtiger/views/RelatedList.php - About 5 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 getFirstRowData has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getFirstRowData($hasHeader = true)
              {
                  $isInventory = $this->moduleModel->isInventory();
                  $rowData = $headers = $standardData = $inventoryData = [];
                  foreach ($this->data as $currentRow => $data) {
          Severity: Minor
          Found in modules/Import/readers/CSVReader.php - About 5 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 createQuery has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              public function createQuery(): void
              {
                  $moduleName = $this->controller->request->getModule();
                  $this->queryGenerator = new \App\QueryGenerator($moduleName);
                  if ($cvId = $this->controller->request->getHeader('x-cv-id')) {
          Severity: Minor
          Found in api/webservice/WebserviceStandard/BaseModule/RecordsList.php - About 5 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

          File MultiAttachment.php has 385 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * UIType Multi Attachment Field File.
           *
           * @package   UIType
          Severity: Minor
          Found in modules/Vtiger/uitypes/MultiAttachment.php - About 5 hrs to fix

            Method showRelatedRecords has 131 lines of code (exceeds 25 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: Major
            Found in modules/Vtiger/views/Detail.php - About 5 hrs to fix

              Method initializeContent has 130 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function initializeContent(App\Request $request)
                  {
                      $viewer = $this->getViewer($request);
                      $this->moduleName = $request->getModule();
                      $this->sourceModule = $request->getByType('src_module', 2);
              Severity: Major
              Found in modules/Vtiger/views/RecordsList.php - About 5 hrs to fix

                Vtiger_Cache has 39 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Vtiger_Cache
                {
                    private static $selfInstance = false;
                    public static $cacheEnable = true;
                    protected $connector;
                Severity: Minor
                Found in include/runtime/Cache.php - About 5 hrs to fix

                  File ConfigTemplate.php has 379 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * OSSMail module config.
                   *
                   * @copyright YetiForce S.A.
                  Severity: Minor
                  Found in modules/OSSMail/ConfigTemplate.php - About 5 hrs to fix

                    Function exportFields has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function exportFields(ModuleBasic $moduleInstance, $blockid)
                        {
                            $dataReader = (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $moduleInstance->id, 'block' => $blockid])->createCommand()->query();
                            if (0 === $dataReader->count()) {
                                return;
                    Severity: Minor
                    Found in vtlib/Vtiger/PackageExport.php - About 5 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 recordsList has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function recordsList($params)
                        {
                            [$moduleName, $columns, $conditions, $viewIdOrName, $limit, $maxLength, $params] = array_pad(explode('|', $params, 7), 7, '');
                            $paramsArray = $params ? self::parseFieldParam($params) : [];
                            $cvId = 0;
                    Severity: Minor
                    Found in app/TextParser.php - About 5 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