YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

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

    public function loadFieldValuesFromSource(App\Request $request): array
    {
        $fieldValues = [];
        $sourceRelatedField = $this->recordModel->getModule()->getValuesFromSource($request);
        foreach ($sourceRelatedField as $fieldName => $fieldValue) {
Severity: Minor
Found in modules/Vtiger/views/QuickCreateAjax.php - About 2 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 uploadAndParse has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function uploadAndParse(App\Request $request)
    {
        if (Import_Utils_Helper::validateFileUpload($request)) {
            $user = App\User::getCurrentUserModel();
            $fileReader = Import_Module_Model::getFileReader($request, $user);
Severity: Minor
Found in modules/Vtiger/views/Import.php - About 2 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 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        if ($request->isAjax()) {
Severity: Minor
Found in modules/Vtiger/views/List.php - About 2 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 getParent has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0)
    {
        \App\Log::trace('Entering getParent(' . $id . ') method ...');
        if ($depthBase == App\Config::module('Contacts', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/Contacts/Contacts.php - About 2 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 helpDeskNewCommentOwner has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function helpDeskNewCommentOwner(Vtiger_Record_Model $recordModel)
    {
        \App\Log::trace('Entering helpDeskNewCommentOwner');
        $relatedToId = $recordModel->get('related_to');
        $result = (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'crmid' => $relatedToId])->scalar();
Severity: Minor
Found in modules/HelpDesk/workflows/HelpDeskWorkflow.php - About 2 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 getParent has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
    {
        \App\Log::trace('Entering getParent(' . $id . ') method ...');
        if ($depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/Project/Project.php - About 2 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 getInventoryData has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getInventoryData(): array
    {
        $inventoryData = [];
        foreach ($this->inventory as $inventoryKey => $inventoryItem) {
            foreach (\Vtiger_Inventory_Model::getInstance($this->moduleName)->getFields() as $columnName => $fieldModel) {
Severity: Minor
Found in api/webservice/WebservicePremium/Inventory.php - About 2 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 getChild has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getChild(int $id, array &$childRow, int $depthBase): array
    {
        \App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
        if (empty($id) || $depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/Project/Project.php - About 2 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 showEditView has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        showEditView: function (id) {
            var thisInstance = this;
            var aDeferred = jQuery.Deferred();

            var progressIndicatorElement = jQuery.progressIndicator({

    Function registerUserList has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function registerUserList() {
        var selectUsers = $('.js-header__btn--mail select');
        if (selectUsers.data('select2')) {
            selectUsers.select2('destroy');
        } else {
    Severity: Major
    Found in public_html/layouts/basic/modules/OSSMail/resources/checkmails.js - About 2 hrs to fix

      Function registerMassRecordsEvents has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              registerMassRecordsEvents: function () {
                  const self = this;
                  self.getRelatedContainer().on('click', '.js-mass-record-event', function () {
                      let target = $(this);
                      if (self.checkListRecordSelected() !== true) {
      Severity: Major
      Found in public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js - About 2 hrs to fix

        Function registerChangeTaxModal has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                registerChangeTaxModal: function (modal, parentRow, params) {
                    let thisInstance = this;
                    let form = modal.find('form');
                    form.validationEngine(app.validationEngineOptions);
                    modal.on('change', '.individualTaxType', function (e) {
        Severity: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 2 hrs to fix

          Function render has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  render: function () {
                      this.$list = new ListWidget({
                          itemRenderer: function (li, e) {
                              $('<span />').addClass(csscls('message')).text(e.message).appendTo(li);
                              if (e.file) {
          Severity: Major
          Found in public_html/layouts/resources/debugbar/logs.js - About 2 hrs to fix

            Function init has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                init: function (editor) {
                    if (editor.addFeature) {
                        editor.addFeature({
                            allowedContent: 'img[alt,id,!src]{width,height};'
                        });

              Function showModalData has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  showModalData(data, container, paramsObject, cb, url, sendByAjaxCb) {
                      const thisInstance = this;
                      let params = {
                          show: true
                      };
              Severity: Major
              Found in public_html/layouts/resources/app.js - About 2 hrs to fix

                Method testAddConfiguration has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function testAddConfiguration(): void
                    {
                        $app = \Settings_WebserviceApps_Record_Model::getCleanInstance();
                        $app->set('type', 'WebservicePremium');
                        $app->set('status', 1);
                Severity: Major
                Found in tests/Integrations/WebservicePremiumTest.php - About 2 hrs to fix

                  Method getConfig has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function getConfig()
                      {
                          $php = [];
                          foreach (ini_get_all() as $key => $value) {
                              $php[$key] = $value['local_value'];
                  Severity: Major
                  Found in app/Utils/ConfReport.php - About 2 hrs to fix

                    Method find has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function find($value): array
                        {
                            if (empty($value) || !\App\RequestUtil::isNetConnection()) {
                                return [];
                            }
                    Severity: Major
                    Found in app/Map/Address/NominatimGeocoder.php - About 2 hrs to fix

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

                          public function process(App\Request $request)
                          {
                              $type = $request->getByType('type');
                              if (!isset(\App\Log::$logsViewerColumnMapping[$type])) {
                                  throw new \App\Exceptions\NoPermittedForAdmin('ERR_ILLEGAL_VALUE');
                      Severity: Major
                      Found in modules/Settings/Log/actions/LogsViewer.php - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language