YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function process has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        \App\Log::trace('Start create AddressBook');

        $limit = App\Config::performance('CRON_MAX_NUMBERS_RECORD_ADDRESS_BOOK_UPDATER');
Severity: Minor
Found in modules/Vtiger/crons/AddressBook.php - About 6 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 ListSearch.js has 432 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */
'use strict';

jQuery.Class(
    'YetiForce_ListSearch_Js',
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/ListSearch.js - About 6 hrs to fix

    Function initInventoryValuesAuto has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        private function initInventoryValuesAuto()
        {
            $invData = [];
            $counter = 1;
            foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
    Severity: Minor
    Found in app/RecordConverter.php - About 6 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 getPrivilegeQuery has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getPrivilegeQuery(Db\Query $query, $moduleName, $user = false, $relatedRecord = null)
        {
            if ($user && $user instanceof User) {
                $userId = $user->getId();
            } elseif (!$user) {
    Severity: Minor
    Found in app/PrivilegeQuery.php - About 6 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 getTypeDetailsForAddField has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getTypeDetailsForAddField($fieldType, $params)
        {
            $displayType = 1;
            $importerType = new \App\Db\Importers\Base();
            switch ($fieldType) {
    Severity: Minor
    Found in modules/Settings/LayoutEditor/models/Module.php - About 6 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 41 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getStructure()
        {
            if (!empty($this->structuredValues)) {
                return $this->structuredValues;
            }
    Severity: Minor
    Found in modules/Vtiger/models/EditRecordStructure.php - About 6 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 Purifier.php has 426 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Purifier file.
     *
     * @package App
    Severity: Minor
    Found in app/Purifier.php - About 6 hrs to fix

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

          public function process()
          {
              $html = '';
              $inventoryRows = [];
              if (!$this->textParser->recordModel->getModule()->isInventory()) {
      Severity: Major
      Found in app/TextParser/ProductsTable.php - About 6 hrs to fix

        Method updateTables has 154 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function updateTables(Base $importer)
            {
                $this->logs .= "> start update tables ({$importer->dbType})\n";
                $startMain = microtime(true);
                $schema = $importer->db->getSchema();
        Severity: Major
        Found in app/Db/Importer.php - About 6 hrs to fix

          File MultiImage.php has 421 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * UIType MultiImage Field Class.
           *
           * @package   UIType
          Severity: Minor
          Found in modules/Vtiger/uitypes/MultiImage.php - About 6 hrs to fix

            Function hideHorizontalBarDatalabelsIfNeeded has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

                            hideHorizontalBarDatalabelsIfNeeded: function hideHorizontalBarDatalabelsIfNeeded(chart) {
                                let getDatasetsMeta = function (chart) {
                                    const datasets = [];
                                    const data = chart.data;
                                    if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {

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

                            hideVerticalBarDatalabelsIfNeeded: function (chart) {
                                let getDatasetsMeta = function (chart) {
                                    const datasets = [];
                                    const data = chart.data;
                                    if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {

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

                public static function vtwsConvertlead($entityvalues, Users_Record_Model $user)
                {
                    \App\Log::trace('Start ' . __METHOD__);
                    if (empty($entityvalues['assignedTo'])) {
                        $entityvalues['assignedTo'] = $user->id;
            Severity: Minor
            Found in include/Webservices/ConvertLead.php - About 6 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 getBacktrace has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getBacktrace($minLevel = 1, $maxLevel = 0, $sep = '#')
                {
                    $trace = '';
                    foreach (debug_backtrace() as $k => $v) {
                        if ($k < $minLevel) {
            Severity: Minor
            Found in app/Debuger.php - About 6 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 loadData has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

                public function loadData(): void
                {
                    if (empty($this->data)) {
                        return;
                    }
            Severity: Minor
            Found in app/RecordCollectors/Base.php - About 6 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 getWidgetTimeControl has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getWidgetTimeControl($user, $time)
                {
                    if (!$time) {
                        return ['show_chart' => false];
                    }
            Severity: Minor
            Found in modules/OSSTimeControl/dashboards/AllTimeControl.php - About 6 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

            Method doTask has 152 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function doTask($recordModel)
                {
                    if (!\App\Module::isModuleActive('Calendar')) {
                        return;
                    }
            Severity: Major
            Found in modules/com_vtiger_workflow/tasks/VTCreateTodoTask.php - About 6 hrs to fix

              Method importRecords has 151 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function importRecords()
                  {
                      $moduleName = $this->module;
                      $tableName = Import_Module_Model::getDbTableName($this->user);
              
              
              Severity: Major
              Found in modules/Import/actions/Data.php - About 6 hrs to fix

                File Record.php has 417 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                /**
                 * Settings TreesManager record model class.
                 *
                Severity: Minor
                Found in modules/Settings/TreesManager/models/Record.php - About 6 hrs to fix

                  Cron has 44 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Cron
                  {
                      protected static $cronAction = false;
                      protected static $baseTable = 'vtiger_cron_task';
                      protected static $schemaInitialized = false;
                  Severity: Minor
                  Found in vtlib/Vtiger/Cron.php - About 6 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language