YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

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

                  if (typeof fullFormUrl !== 'undefined' && fullFormUrl.indexOf('?') !== -1) {
                      let urlSplit = fullFormUrl.split('?');
                      let queryString = urlSplit[1];
                      let queryParameters = queryString.split('&');
                      for (let index = 0; index < queryParameters.length; index++) {
      public_html/layouts/basic/modules/HelpDesk/resources/Edit.js on lines 147..158

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

      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

                  if (typeof fullFormUrl !== 'undefined' && fullFormUrl.indexOf('?') !== -1) {
                      let urlSplit = fullFormUrl.split('?');
                      let queryString = urlSplit[1];
                      let queryParameters = queryString.split('&');
                      for (let index = 0; index < queryParameters.length; index++) {
      Severity: Major
      Found in public_html/layouts/basic/modules/HelpDesk/resources/Edit.js and 1 other location - About 6 hrs to fix
      public_html/layouts/basic/modules/HelpDesk/resources/Detail.js on lines 308..319

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

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

      <?php
      /**
       * Main module file.
       *
       * @package CRMEntity
      Severity: Major
      Found in modules/Passwords/Passwords.php and 3 other locations - About 6 hrs to fix
      modules/Approvals/Approvals.php on lines 1..78
      modules/ApprovalsRegister/ApprovalsRegister.php on lines 1..77
      modules/Occurrences/Occurrences.php on lines 1..79

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

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

      <?php
      /**
       * Main Occurrences module class.
       *
       * @package   App
      Severity: Major
      Found in modules/Occurrences/Occurrences.php and 3 other locations - About 6 hrs to fix
      modules/Approvals/Approvals.php on lines 1..78
      modules/ApprovalsRegister/ApprovalsRegister.php on lines 1..77
      modules/Passwords/Passwords.php on lines 1..95

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

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

      <?php
      /**
       * Main module file.
       *
       * @package CRMEntity
      Severity: Major
      Found in modules/Approvals/Approvals.php and 3 other locations - About 6 hrs to fix
      modules/ApprovalsRegister/ApprovalsRegister.php on lines 1..77
      modules/Occurrences/Occurrences.php on lines 1..79
      modules/Passwords/Passwords.php on lines 1..95

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

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

      <?php
      /**
       * Main module file.
       *
       * @package CRMEntity
      Severity: Major
      Found in modules/ApprovalsRegister/ApprovalsRegister.php and 3 other locations - About 6 hrs to fix
      modules/Approvals/Approvals.php on lines 1..78
      modules/Occurrences/Occurrences.php on lines 1..79
      modules/Passwords/Passwords.php on lines 1..95

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

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

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

                      registerShowHierarchy: function () {
                          let thisInstance = this,
                              hierarchyButton = $('.detailViewTitle'),
                              params = {
                                  module: app.getModuleName(),
              public_html/layouts/basic/modules/Contacts/resources/Detail.js on lines 114..134
              public_html/layouts/basic/modules/Project/resources/Detail.js on lines 115..135

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

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

                      registerShowHierarchy: function () {
                          let thisInstance = this,
                              hierarchyButton = $('.detailViewTitle'),
                              params = {
                                  module: app.getModuleName(),
              public_html/layouts/basic/modules/HelpDesk/resources/Detail.js on lines 106..126
              public_html/layouts/basic/modules/Project/resources/Detail.js on lines 115..135

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

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

                      registerShowHierarchy: function () {
                          let thisInstance = this,
                              hierarchyButton = $('.detailViewTitle'),
                              params = {
                                  module: app.getModuleName(),
              public_html/layouts/basic/modules/Contacts/resources/Detail.js on lines 114..134
              public_html/layouts/basic/modules/HelpDesk/resources/Detail.js on lines 106..126

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

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

                          foreach (static::getDatashare('rs2user', $modTabId, $userid) as $row) {
                              $shareRoleIds = static::getRoleSubordinates($row['share_roleandsubid']);
                              $shareRoleIds[] = $row['share_roleandsubid'];
                              foreach ($shareRoleIds as $shareRoleId) {
                                  if (1 === (int) $row['permission']) {
              Severity: Major
              Found in app/PrivilegeUtil.php and 3 other locations - About 6 hrs to fix
              app/PrivilegeUtil.php on lines 898..916
              app/PrivilegeUtil.php on lines 918..936
              app/PrivilegeUtil.php on lines 938..956

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

              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

              Severity
              Category
              Status
              Source
              Language