YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

    public function process()
    {
        $html = '';
        $inventoryRows = [];
        if (!$this->textParser->recordModel->getModule()->isInventory()) {
Severity: Major
Found in app/TextParser/ProductsTable.php - About 6 hrs to fix

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

            updateUserColor: function (e) {
                let target = $(e.currentTarget);
                let colorPreview = $('#calendarColorPreviewUser' + target.data('record'));
                let request = (color) => {
                    return new Promise((resolve, reject) => {
    public_html/layouts/basic/modules/Settings/Colors/resources/Index.js on lines 142..160
    public_html/layouts/basic/modules/Settings/Colors/resources/Index.js on lines 197..215

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

    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

            updateGroupColor: function (e) {
                let target = $(e.currentTarget);
                let colorPreview = $('#calendarColorPreviewGroup' + target.data('record'));
                let request = (color) => {
                    return new Promise((resolve, reject) => {
    public_html/layouts/basic/modules/Settings/Colors/resources/Index.js on lines 87..105
    public_html/layouts/basic/modules/Settings/Colors/resources/Index.js on lines 197..215

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

    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

            updateModuleColor: function (e) {
                let target = $(e.currentTarget);
                let colorPreview = $('#calendarColorPreviewModule' + target.data('record'));
                let request = (color) => {
                    return new Promise((resolve, reject) => {
    public_html/layouts/basic/modules/Settings/Colors/resources/Index.js on lines 87..105
    public_html/layouts/basic/modules/Settings/Colors/resources/Index.js on lines 142..160

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

    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 updateTables has 154 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function updateTables(Base $importer)
        {
            $this->logs .= "> start update tables ({$importer->dbType})\n";
            $startMain = microtime(true);
            $schema = $importer->db->getSchema();
    Severity: Major
    Found in app/Db/Importer.php - About 6 hrs to fix

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

      <?php
      
      /**
       * Record Class for SSalesProcesses.
       *
      Severity: Major
      Found in modules/SSalesProcesses/models/Record.php and 2 other locations - About 6 hrs to fix
      modules/Competition/models/Record.php on lines 1..35
      modules/Project/models/Record.php on lines 1..35

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

      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

      <?php
      
      /**
       * Record Class for Project.
       *
      Severity: Major
      Found in modules/Project/models/Record.php and 2 other locations - About 6 hrs to fix
      modules/Competition/models/Record.php on lines 1..35
      modules/SSalesProcesses/models/Record.php on lines 1..34

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

      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

                  foreach (static::getDatashare('role2role', $modTabId, $currentUserRoles) as $row) {
                      $shareRoleId = $row['share_roleid'];
                      $shareIdRoles = [];
                      $shareIdRoles[] = $shareRoleId;
                      $shareIdMembers[$row['shareid']] = ['ROLE' => $shareIdRoles];
      Severity: Major
      Found in app/PrivilegeUtil.php and 2 other locations - About 6 hrs to fix
      app/PrivilegeUtil.php on lines 835..852
      app/PrivilegeUtil.php on lines 859..876

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

      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

                  foreach (static::getDatashare('role2rs', $modTabId, $parRoleList) as $row) {
                      $shareRoleId = $row['share_roleid'];
                      $shareIdRoles = [];
                      $shareIdRoles[] = $shareRoleId;
                      $shareIdMembers[$row['shareid']] = ['ROLE' => $shareIdRoles];
      Severity: Major
      Found in app/PrivilegeUtil.php and 2 other locations - About 6 hrs to fix
      app/PrivilegeUtil.php on lines 809..826
      app/PrivilegeUtil.php on lines 859..876

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

      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

      <?php
      
      /**
       * Record Class for Competition.
       *
      Severity: Major
      Found in modules/Competition/models/Record.php and 2 other locations - About 6 hrs to fix
      modules/Project/models/Record.php on lines 1..35
      modules/SSalesProcesses/models/Record.php on lines 1..34

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

      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

                      foreach (static::getDatashare('role2group', $modTabId, $groupList) as $row) {
                          $shareRoleId = $row['share_roleid'];
                          $shareIdRoles = [];
                          $shareIdRoles[] = $shareRoleId;
                          $shareIdMembers[$row['shareid']] = ['ROLE' => $shareIdRoles];
      Severity: Major
      Found in app/PrivilegeUtil.php and 2 other locations - About 6 hrs to fix
      app/PrivilegeUtil.php on lines 809..826
      app/PrivilegeUtil.php on lines 835..852

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

      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 MultiImage.php has 421 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * UIType MultiImage Field Class.
       *
       * @package   UIType
      Severity: Minor
      Found in modules/Vtiger/uitypes/MultiImage.php - About 6 hrs to fix

        Function hideHorizontalBarDatalabelsIfNeeded has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
        Open

                        hideHorizontalBarDatalabelsIfNeeded: function hideHorizontalBarDatalabelsIfNeeded(chart) {
                            let getDatasetsMeta = function (chart) {
                                const datasets = [];
                                const data = chart.data;
                                if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {

        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 hideVerticalBarDatalabelsIfNeeded has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
        Open

                        hideVerticalBarDatalabelsIfNeeded: function (chart) {
                            let getDatasetsMeta = function (chart) {
                                const datasets = [];
                                const data = chart.data;
                                if (typeof data !== 'undefined' && typeof data.datasets !== 'undefined' && Array.isArray(data.datasets)) {

        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 vtwsConvertlead has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function vtwsConvertlead($entityvalues, Users_Record_Model $user)
            {
                \App\Log::trace('Start ' . __METHOD__);
                if (empty($entityvalues['assignedTo'])) {
                    $entityvalues['assignedTo'] = $user->id;
        Severity: Minor
        Found in include/Webservices/ConvertLead.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 getBacktrace has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getBacktrace($minLevel = 1, $maxLevel = 0, $sep = '#')
            {
                $trace = '';
                foreach (debug_backtrace() as $k => $v) {
                    if ($k < $minLevel) {
        Severity: Minor
        Found in app/Debuger.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 loadData has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
        Open

            public function loadData(): void
            {
                if (empty($this->data)) {
                    return;
                }
        Severity: Minor
        Found in app/RecordCollectors/Base.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 getWidgetTimeControl has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getWidgetTimeControl($user, $time)
            {
                if (!$time) {
                    return ['show_chart' => false];
                }
        Severity: Minor
        Found in modules/OSSTimeControl/dashboards/AllTimeControl.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 doTask has 152 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function doTask($recordModel)
            {
                if (!\App\Module::isModuleActive('Calendar')) {
                    return;
                }
        Severity: Major
        Found in modules/com_vtiger_workflow/tasks/VTCreateTodoTask.php - About 6 hrs to fix

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

                  foreach ($rows as &$row) {
                      $row['related'] = \App\Record::getHtmlLink($row['related'], null, \App\Config::main('href_max_length'));
                      $info = '';
                      if ($row['source_id']) {
                          $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';
          Severity: Major
          Found in app/Controller/Components/Action/InterestsConflict.php and 1 other location - About 6 hrs to fix
          app/Controller/Components/Action/InterestsConflict.php on lines 233..246

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

          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