YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

Function setFieldMapping has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    public function setFieldMapping($fieldValueMapping, $recordModel, $parentRecordModel)
    {
        $ownerFields = [];
        $entityType = $this->entity_type;
        foreach ($recordModel->getModule()->getFields() as $name => $fieldModel) {
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTCreateEntityTask.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 loadFieldInfo has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadFieldInfo(): array
    {
        if (null !== $this->fieldInfo) {
            return $this->fieldInfo;
        }
Severity: Minor
Found in modules/Vtiger/models/Field.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 getTicketsByStatus has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTicketsByStatus($owner)
    {
        $moduleName = 'HelpDesk';
        $ticketStatus = Settings_SupportProcesses_Module_Model::getTicketStatusNotModify();
        $query = new \App\Db\Query();
Severity: Minor
Found in modules/HelpDesk/dashboards/TicketsByStatus.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 transformInventoryFieldFromMap has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    public function transformInventoryFieldFromMap($value, $mapData)
    {
        if (!empty($value)) {
            if ($this->currentInventoryRawData['name']) {
                [$entityName] = $this->transformInventoryReference($this->currentInventoryRawData['name'], true);
Severity: Minor
Found in modules/Import/actions/Data.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 registerUnlock has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        registerUnlock: function (container) {
            let form = container.find('.js-filter-form');
            App.Fields.Date.registerRange(form);
            let table = $('#js-unlock-table');
            if (table.hasClass('dataTable')) {
Severity: Major
Found in public_html/layouts/basic/components/InterestsConflict.js - About 4 hrs to fix

    Method exportFields has 102 lines of code (exceeds 25 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: Major
    Found in vtlib/Vtiger/PackageExport.php - About 4 hrs to fix

      Method addField has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function addField($fieldType, $blockId, $params)
          {
              $label = $params['fieldLabel'];
              $name = strtolower($params['fieldName']);
              $pickListValues = [];
      Severity: Major
      Found in modules/Settings/LayoutEditor/models/Module.php - About 4 hrs to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            public function __construct()
            {
                parent::__construct();
                if ($nonce = \App\Session::get('CSP_TOKEN')) {
                    $this->headers->csp['script-src'] .= " 'nonce-{$nonce}'";
        Severity: Major
        Found in modules/Users/actions/Login.php and 1 other location - About 4 hrs to fix
        modules/Users/views/Login.php on lines 15..29

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 164.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            public function __construct()
            {
                parent::__construct();
                if ($nonce = \App\Session::get('CSP_TOKEN')) {
                    $this->headers->csp['script-src'] .= " 'nonce-{$nonce}'";
        Severity: Major
        Found in modules/Users/views/Login.php and 1 other location - About 4 hrs to fix
        modules/Users/actions/Login.php on lines 31..45

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 164.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        File Widgets.js has 336 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_Widgets_Index_Js',

          Similar blocks of code found in 6 locations. Consider refactoring.
          Open

          <?php
          
          /**
           * RelationAjax Class for MultiCompany.
           *
          Severity: Major
          Found in modules/MultiCompany/actions/RelationAjax.php and 5 other locations - About 4 hrs to fix
          modules/Competition/actions/RelationAjax.php on lines 1..31
          modules/Contacts/actions/RelationAjax.php on lines 1..31
          modules/Partners/actions/RelationAjax.php on lines 1..38
          modules/Project/actions/RelationAjax.php on lines 1..37
          modules/SSalesProcesses/actions/RelationAjax.php on lines 1..31

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 163.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 6 locations. Consider refactoring.
          Open

          <?php
          
          /**
           * RelationAjax Class for Competition.
           *
          Severity: Major
          Found in modules/Contacts/actions/RelationAjax.php and 5 other locations - About 4 hrs to fix
          modules/Competition/actions/RelationAjax.php on lines 1..31
          modules/MultiCompany/actions/RelationAjax.php on lines 1..32
          modules/Partners/actions/RelationAjax.php on lines 1..38
          modules/Project/actions/RelationAjax.php on lines 1..37
          modules/SSalesProcesses/actions/RelationAjax.php on lines 1..31

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 163.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 6 locations. Consider refactoring.
          Open

          <?php
          
          /**
           * RelationAjax Class for Competition.
           *
          Severity: Major
          Found in modules/Competition/actions/RelationAjax.php and 5 other locations - About 4 hrs to fix
          modules/Contacts/actions/RelationAjax.php on lines 1..31
          modules/MultiCompany/actions/RelationAjax.php on lines 1..32
          modules/Partners/actions/RelationAjax.php on lines 1..38
          modules/Project/actions/RelationAjax.php on lines 1..37
          modules/SSalesProcesses/actions/RelationAjax.php on lines 1..31

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 163.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 6 locations. Consider refactoring.
          Open

          <?php
          
          /**
           * RelationAjax Class for SSalesProcesses.
           *
          Severity: Major
          Found in modules/SSalesProcesses/actions/RelationAjax.php and 5 other locations - About 4 hrs to fix
          modules/Competition/actions/RelationAjax.php on lines 1..31
          modules/Contacts/actions/RelationAjax.php on lines 1..31
          modules/MultiCompany/actions/RelationAjax.php on lines 1..32
          modules/Partners/actions/RelationAjax.php on lines 1..38
          modules/Project/actions/RelationAjax.php on lines 1..37

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 163.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 6 locations. Consider refactoring.
          Open

          <?php
          
          /**
           * RelationAjax Class for Partners.
           *
          Severity: Major
          Found in modules/Partners/actions/RelationAjax.php and 5 other locations - About 4 hrs to fix
          modules/Competition/actions/RelationAjax.php on lines 1..31
          modules/Contacts/actions/RelationAjax.php on lines 1..31
          modules/MultiCompany/actions/RelationAjax.php on lines 1..32
          modules/Project/actions/RelationAjax.php on lines 1..37
          modules/SSalesProcesses/actions/RelationAjax.php on lines 1..31

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 163.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 6 locations. Consider refactoring.
          Open

          <?php
          
          /**
           * RelationAjax Class for Project.
           *
          Severity: Major
          Found in modules/Project/actions/RelationAjax.php and 5 other locations - About 4 hrs to fix
          modules/Competition/actions/RelationAjax.php on lines 1..31
          modules/Contacts/actions/RelationAjax.php on lines 1..31
          modules/MultiCompany/actions/RelationAjax.php on lines 1..32
          modules/Partners/actions/RelationAjax.php on lines 1..38
          modules/SSalesProcesses/actions/RelationAjax.php on lines 1..31

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 163.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          File Rule.php has 334 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * Settings SharingAccess rule model class.
           *
           * @copyright YetiForce S.A.
          Severity: Minor
          Found in modules/Settings/SharingAccess/models/Rule.php - About 4 hrs to fix

            Calendar_Js has 32 functions (exceeds 20 allowed). Consider refactoring.
            Open

            window.Calendar_Js = class {
                static monthFormat = {
                    'yyyy-mm-dd': 'YYYY-MMMM',
                    'mm-dd-yyyy': 'MMMM-YYYY',
                    'dd-mm-yyyy': 'MMMM-YYYY',
            Severity: Minor
            Found in public_html/layouts/resources/Calendar.js - About 4 hrs to fix

              CustomView has 32 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class CustomView
              {
                  const CV_STATUS_DEFAULT = 0;
                  const CV_STATUS_PRIVATE = 1;
                  const CV_STATUS_PENDING = 2;
              Severity: Minor
              Found in app/CustomView.php - About 4 hrs to fix

                Request has 32 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Request
                {
                    /**
                     * Raw request data.
                     *
                Severity: Minor
                Found in app/Request.php - About 4 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language