YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

Vtiger_Edit_Js(
    'SCalculations_Edit_Js',
    {},
    {
        getRecordsListParams: function (container) {
public_html/layouts/basic/modules/SQuoteEnquiries/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SRecurringOrders/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SRequirementsCards/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SSingleOrders/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SVendorEnquiries/resources/Edit.js on lines 4..18

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

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

Vtiger_Edit_Js(
    'SRequirementsCards_Edit_Js',
    {},
    {
        getRecordsListParams: function (container) {
public_html/layouts/basic/modules/SCalculations/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SQuoteEnquiries/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SRecurringOrders/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SSingleOrders/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SVendorEnquiries/resources/Edit.js on lines 4..18

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

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

Vtiger_Edit_Js(
    'SRecurringOrders_Edit_Js',
    {},
    {
        getRecordsListParams: function (container) {
public_html/layouts/basic/modules/SCalculations/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SQuoteEnquiries/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SRequirementsCards/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SSingleOrders/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SVendorEnquiries/resources/Edit.js on lines 4..18

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

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

Vtiger_Edit_Js(
    'SVendorEnquiries_Edit_Js',
    {},
    {
        getRecordsListParams: function (container) {
public_html/layouts/basic/modules/SCalculations/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SQuoteEnquiries/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SRecurringOrders/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SRequirementsCards/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SSingleOrders/resources/Edit.js on lines 4..18

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

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

Vtiger_Edit_Js(
    'SSingleOrders_Edit_Js',
    {},
    {
        getRecordsListParams: function (container) {
public_html/layouts/basic/modules/SCalculations/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SQuoteEnquiries/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SRecurringOrders/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SRequirementsCards/resources/Edit.js on lines 4..18
public_html/layouts/basic/modules/SVendorEnquiries/resources/Edit.js on lines 4..18

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

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

/*+***********************************************************************************
 * 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
 * The Initial Developer of the Original Code is vtiger.
Severity: Minor
Found in public_html/layouts/basic/modules/Settings/Vtiger/resources/Index.js - About 4 hrs to fix

    Method getComposeParam has 107 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function getComposeParam(App\Request $request)
        {
            $moduleName = $request->getByType('crmModule');
            $record = $request->getInteger('crmRecord');
            $type = $request->getByType('type');
    Severity: Major
    Found in modules/OSSMail/models/Module.php - About 4 hrs to fix

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

      <?php
      /**
       * YetiForce shop YetiForce RBL file.
       *
       * @package App
      Severity: Major
      Found in app/YetiForce/Shop/Product/YetiForceRbl.php and 2 other locations - About 4 hrs to fix
      app/YetiForce/Shop/Product/YetiForceMap.php on lines 1..51
      app/YetiForce/Shop/Product/YetiForceVulnerabilities.php on lines 1..51

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

      <?php
      /**
       * YetiForce shop YetiForceMap file.
       *
       * @package App
      Severity: Major
      Found in app/YetiForce/Shop/Product/YetiForceMap.php and 2 other locations - About 4 hrs to fix
      app/YetiForce/Shop/Product/YetiForceRbl.php on lines 1..51
      app/YetiForce/Shop/Product/YetiForceVulnerabilities.php on lines 1..51

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

      <?php
      /**
       * YetiForce shop YetiForce Vulnerabilities file.
       *
       * @package App
      Severity: Major
      Found in app/YetiForce/Shop/Product/YetiForceVulnerabilities.php and 2 other locations - About 4 hrs to fix
      app/YetiForce/Shop/Product/YetiForceMap.php on lines 1..51
      app/YetiForce/Shop/Product/YetiForceRbl.php on lines 1..51

      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

      File Base.php has 344 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Abstract base view controller file.
       *
       * @package   Controller
      Severity: Minor
      Found in app/Controller/View/Base.php - About 4 hrs to fix

        Function addRelatedRecord has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

                addRelatedRecord: function (element, callback) {
                    let aDeferred = jQuery.Deferred();
                    let referenceModuleName = this.moduleName;
                    let parentId = this.getParentId();
                    let parentModule = this.parentModuleName;
        Severity: Minor
        Found in public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js - 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 reloadAfterSave has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            reloadAfterSave: function (responseData, params, form, element) {
                if (responseData.skipReload) {
                    return;
                }
                const moduleName = params['module'];
        Severity: Minor
        Found in public_html/layouts/resources/app.js - 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 import has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public function import($zipfile, $overwrite = false)
            {
                $module = $this->getModuleNameFromZip($zipfile);
                if (null !== $module) {
                    $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
        Severity: Minor
        Found in vtlib/Vtiger/PackageImport.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 update has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public function update($moduleInstance, $zipfile, $overwrite = true)
            {
                $module = $this->getModuleNameFromZip($zipfile);
                if (null !== $module) {
                    $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
        Severity: Minor
        Found in vtlib/Vtiger/PackageUpdate.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 process has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public function process(): void
            {
                \App\Utils\ConfReport::saveEnv();
                $this->status = 1;
                $errorsText = '<br>';
        Severity: Minor
        Found in app/SystemWarnings/SystemRequirements/Configuration.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 validSearchParams has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function validSearchParams(string $moduleName, array $searchParams, $convert = true): array
            {
                $searchParamsCount = \count($searchParams);
                if ($searchParamsCount > 2) {
                    throw new Exceptions\IllegalValue("ERR_NUMBER_OF_ARGUMENTS_NOT_ALLOWED||{$searchParamsCount}|| > 2||" . Utils::varExport($searchParams, true), 406);
        Severity: Minor
        Found in app/Condition.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 getBrowserInfo has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getBrowserInfo(): object
            {
                if (empty(self::$browserCache)) {
                    $browserAgent = strtolower(\App\Request::_getServer('HTTP_USER_AGENT', ''));
        
        
        Severity: Minor
        Found in app/RequestUtil.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 getWarnings has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getWarnings($folders, $active = true)
            {
                if (empty($folders)) {
                    return [];
                }
        Severity: Minor
        Found in app/SystemWarnings.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 getRelatedRecords has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getRelatedRecords($record, $hierarchy)
            {
                $moduleName = Record::getType($record);
                $records = $recordsLevel1 = $recordsLevel2 = [];
                if (\in_array(0, $hierarchy)) {
        Severity: Minor
        Found in app/ModuleHierarchy.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

        Severity
        Category
        Status
        Source
        Language