YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

    public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = false)
    {
        if (\is_object($record)) {
            $body = $record->get('content');
            $subject = $record->get('subject');
Severity: Minor
Found in modules/OSSMail/models/Module.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 unfoldFlowed has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function unfoldFlowed(string $text, bool $delSp = false): string
    {
        $text = preg_split('/\r?\n/', $text);
        $last = -1;
        $qLevel = 0;
Severity: Minor
Found in modules/OSSMail/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 getWidgetTimeControl has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function getWidgetTimeControl($user, $date)
    {
        if (!$date) {
            return ['show_chart' => false];
        }
Severity: Minor
Found in modules/OSSTimeControl/dashboards/TimeControl.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 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $recordId = $request->getInteger('record');
Severity: Minor
Found in modules/Vtiger/views/Edit.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 showRelatedList has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function send()
    {
        $encryptDataTransfer = \App\Config::api('ENCRYPT_DATA_TRANSFER') ? 1 : 0;
        if (200 !== $this->status || 'data' !== $this->responseType) {
            $encryptDataTransfer = 0;
Severity: Minor
Found in api/webservice/Core/Response.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

Method __vtlibGetModulevarValue has 125 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function __vtlibGetModulevarValue($module, $varname)
    {
        $mod_var_mapping = [
            'Accounts' => [
                'IsCustomModule' => false,
Severity: Major
Found in include/utils/VtlibUtils.php - About 5 hrs to fix

    ModTracker_Record_Model has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ModTracker_Record_Model extends Vtiger_Record_Model
    {
        const UPDATE = 0;
        const DELETE = 1;
        const CREATE = 2;
    Severity: Minor
    Found in modules/ModTracker/models/Record.php - About 5 hrs to fix

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

                              if (String(dataItem).length > 0 && !isNaN(Number(dataItem))) {
                                  if (
                                      typeof this.widgetData !== 'undefined' &&
                                      typeof this.widgetData.valueType !== 'undefined' &&
                                      this.widgetData.valueType === 'count'
      public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 1998..2008
      public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2011..2021

      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 135.

      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 3 locations. Consider refactoring.
      Open

                              if (String(defaultLabel).length > 0 && !isNaN(Number(defaultLabel))) {
                                  if (
                                      typeof this.widgetData !== 'undefined' &&
                                      typeof this.widgetData.valueType !== 'undefined' &&
                                      this.widgetData.valueType === 'count'
      public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2011..2021
      public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2043..2053

      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 135.

      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 3 locations. Consider refactoring.
      Open

                                  if (String(label).length > 0 && !isNaN(Number(label))) {
                                      if (
                                          typeof this.widgetData !== 'undefined' &&
                                          typeof this.widgetData.valueType !== 'undefined' &&
                                          this.widgetData.valueType === 'count'
      public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 1998..2008
      public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 2043..2053

      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 135.

      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 addListPrice(App\Request $request)
          {
              $sourceModule = $request->getModule();
              $sourceRecordId = $request->getInteger('src_record');
              if (!\App\Privilege::isPermitted($sourceModule, 'DetailView', $sourceRecordId)) {
      Severity: Major
      Found in modules/PriceBooks/actions/RelationAjax.php and 1 other location - About 5 hrs to fix
      modules/Products/actions/RelationAjax.php on lines 29..43

      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 183.

      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 addListPrice(App\Request $request)
          {
              $sourceModule = $request->getModule();
              $sourceRecordId = $request->getInteger('src_record');
              if (!\App\Privilege::isPermitted($sourceModule, 'DetailView', $sourceRecordId)) {
      Severity: Major
      Found in modules/Products/actions/RelationAjax.php and 1 other location - About 5 hrs to fix
      modules/PriceBooks/actions/RelationAjax.php on lines 60..74

      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 183.

      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

      Method operationsAfterPicklistDelete has 124 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function operationsAfterPicklistDelete($entityData)
          {
              $dbCommand = App\Db::getInstance()->createCommand();
              $pickListFieldName = $entityData['fieldname'];
              $valueToDelete = $entityData['valuetodelete'];
      Severity: Major
      Found in modules/Settings/Picklist/handlers/PickListHandler.php - About 4 hrs to fix

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

                            basic: {
                                maintainAspectRatio: false,
                                title: {
                                    display: false
                                },
        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 895..932

        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 134.

        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

                            basic: {
                                maintainAspectRatio: false,
                                title: {
                                    display: false
                                },
        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 1020..1057

        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 134.

        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 2 locations. Consider refactoring.
        Open

        Vtiger_Detail_Js(
            'KnowledgeBase_Detail_Js',
            {},
            {
                registerShowArticlePreview() {
        public_html/layouts/basic/modules/Faq/resources/Detail.js on lines 4..24

        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 134.

        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 2 locations. Consider refactoring.
        Open

        Vtiger_Detail_Js(
            'Faq_Detail_Js',
            {},
            {
                registerShowArticlePreview() {
        Severity: Major
        Found in public_html/layouts/basic/modules/Faq/resources/Detail.js and 1 other location - About 4 hrs to fix
        public_html/layouts/basic/modules/KnowledgeBase/resources/Detail.js on lines 4..24

        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 134.

        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

        Function getValues has 123 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                getValues: function () {
                    const thisInstance = this;
                    let fieldList = ['columnname', 'comparator', 'value', 'column_condition'],
                        filterContainer = this.getFilterContainer(),
                        conditionGroups = $('.conditionGroup', filterContainer),
        Severity: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/AdvanceFilter.js - About 4 hrs to fix

          Method getRelatedModuleSharingArray has 123 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
              {
                  $relatedModSharingPermission = [];
                  $modShareReadPermission = [];
                  $modShareWritePermission = [];
          Severity: Major
          Found in app/UserPrivilegesFile.php - About 4 hrs to fix
            Severity
            Category
            Status
            Source
            Language