YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function process()
    {
        $db = App\Db::getInstance();
        $lastUpdatedCrmId = (new App\Db\Query())->select(['crmid'])->from('u_#__openstreetmap_address_updater')->scalar();
        if (false !== $lastUpdatedCrmId) {
Severity: Minor
Found in modules/OpenStreetMap/crons/UpdaterCoordinates.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 getFieldInstanceByName has 172 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name)
    {
        switch ($name) {
            case 'subject':
                $params = [
Severity: Major
Found in modules/Settings/AutomaticAssignment/models/Module.php - About 6 hrs to fix

    `` has 49 functions (exceeds 20 allowed). Consider refactoring.
    Open

        {
            step3Container: false,
            advanceFilterInstance: false,
            conditionBuilderInstance: false,
            ckEditorInstance: false,

      Function getStructure has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getStructure()
          {
              if (!empty($this->structuredValues)) {
                  return $this->structuredValues;
              }
      Severity: Minor
      Found in modules/Documents/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 actions.js has 445 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]} */
      import difference from 'lodash.difference'
      let timer = false
      
      export default {
      Severity: Minor
      Found in public_html/src/layouts/basic/modules/Chat/store/actions.js - About 6 hrs to fix

        File Field.php has 444 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /* +**********************************************************************************
         * The contents of this file are subject to the vtiger CRM Public License Version 1.1
         * ("License"); You may not use this file except in compliance with the License
         * The Original Code is:  vtiger CRM Open Source
        Severity: Minor
        Found in modules/Settings/LayoutEditor/models/Field.php - About 6 hrs to fix

          File Index.js has 441 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(
              'Settings_OSSMailScanner_Index_Js',

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

            <?php
            /* +***********************************************************************************
             * The contents of this file are subject to the vtiger CRM Public License Version 1.0
             * ("License"); You may not use this file except in compliance with the License
             * The Original Code is:  vtiger CRM Open Source
            Severity: Minor
            Found in modules/ModTracker/models/Record.php - About 6 hrs to fix

              Function formatCurrencyValue has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function formatCurrencyValue($value)
                  {
                      $currencyPattern = $this->currencyFormat;
                      $curSeparator = $this->currencySeparator;
                      $decSeparator = $this->decimalSeparator;
              Severity: Minor
              Found in include/fields/CurrencyField.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 getLicenseInformation has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function getLicenseInformation($dir, $libraryName)
                  {
                      $licenseError = false;
                      $returnLicense = '';
                      $licenseToDisplay = '';
              Severity: Minor
              Found in app/Installer/Credits.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 save has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function save()
                  {
                      if (!$this->isNew) {
                          switch ($this->typeSaving) {
                              case self::UPDATE_ALL_EVENTS:
              Severity: Minor
              Found in modules/Calendar/models/RecuringEvents.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 process has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function process()
                  {
                      $html = '';
                      $relationModuleName = 'Products';
                      // Products from main storage
              Severity: Minor
              Found in modules/IStorages/textparsers/ProductsTableHierarchy.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 loadEditor has 164 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          loadEditor(element, customConfig) {
                              this.setElement(element);
                              const instance = this.getEditorInstanceFromName();
                              let config = {
                                  language: CONFIG.langKey,
              Severity: Major
              Found in public_html/layouts/resources/Fields.js - About 6 hrs to fix

                Function constructor has 164 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    constructor(container, projectData) {
                        this.container = $(container);
                        this.containerParent = this.container.parent();
                        this.headerContainer = this.containerParent.parent().find('.js-gantt-header').eq(0);
                        this.weekStart = 6 - CONFIG.firstDayOfWeekNos;
                Severity: Major
                Found in public_html/layouts/basic/modules/Project/resources/Gantt.js - About 6 hrs to fix

                  File RecordConverter.php has 439 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * RecordConverter class.
                   *
                  Severity: Minor
                  Found in app/RecordConverter.php - About 6 hrs to fix

                    File Gantt.js has 435 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';
                    
                    class Gantt {
                        /**
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/Project/resources/Gantt.js - About 6 hrs to fix

                      File ConfigTemplates.php has 435 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * Components config.
                       *
                       * @copyright YetiForce S.A.
                      Severity: Minor
                      Found in config/Components/ConfigTemplates.php - About 6 hrs to fix

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

                            public static function recalculatePasswords(string $method, string $password, string $vector)
                            {
                                $dbAdmin = \App\Db::getInstance('admin');
                                $decryptInstance = static::getInstance();
                                if ($decryptInstance->get('method') === $method && $decryptInstance->get('vector') === $vector && $decryptInstance->get('pass') === $password) {
                        Severity: Minor
                        Found in app/Encryptions/Settings.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 addData has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function addData(Base $importer)
                            {
                                if (!isset($importer->data)) {
                                    return;
                                }
                        Severity: Minor
                        Found in app/Db/Importer.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 convertToNativeLink has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function convertToNativeLink()
                            {
                                $url = $this->get('linkurl');
                                if (empty($url)) {
                                    return $url;
                        Severity: Minor
                        Found in modules/Vtiger/models/Link.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

                        Severity
                        Category
                        Status
                        Source
                        Language