YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

<?php
/**
 * IPreOrder CRMEntity Class.
 *
 * @copyright YetiForce S.A.
Severity: Major
Found in modules/IPreOrder/IPreOrder.php and 9 other locations - About 5 hrs to fix
modules/IGDN/IGDN.php on lines 1..65
modules/IGDNC/IGDNC.php on lines 1..65
modules/IGIN/IGIN.php on lines 1..65
modules/IGRN/IGRN.php on lines 1..65
modules/IGRNC/IGRNC.php on lines 1..65
modules/IIDN/IIDN.php on lines 1..65
modules/ISTDN/ISTDN.php on lines 1..65
modules/ISTN/ISTN.php on lines 1..65
modules/ISTRN/ISTRN.php on lines 1..65

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

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

<?php
/**
 * IIDN CRMEntity Class.
 *
 * @copyright YetiForce S.A.
Severity: Major
Found in modules/IIDN/IIDN.php and 9 other locations - About 5 hrs to fix
modules/IGDN/IGDN.php on lines 1..65
modules/IGDNC/IGDNC.php on lines 1..65
modules/IGIN/IGIN.php on lines 1..65
modules/IGRN/IGRN.php on lines 1..65
modules/IGRNC/IGRNC.php on lines 1..65
modules/IPreOrder/IPreOrder.php on lines 1..65
modules/ISTDN/ISTDN.php on lines 1..65
modules/ISTN/ISTN.php on lines 1..65
modules/ISTRN/ISTRN.php on lines 1..65

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

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

<?php
/**
 * IGDNC CRMEntity Class.
 *
 * @copyright YetiForce S.A.
Severity: Major
Found in modules/IGDNC/IGDNC.php and 9 other locations - About 5 hrs to fix
modules/IGDN/IGDN.php on lines 1..65
modules/IGIN/IGIN.php on lines 1..65
modules/IGRN/IGRN.php on lines 1..65
modules/IGRNC/IGRNC.php on lines 1..65
modules/IIDN/IIDN.php on lines 1..65
modules/IPreOrder/IPreOrder.php on lines 1..65
modules/ISTDN/ISTDN.php on lines 1..65
modules/ISTN/ISTN.php on lines 1..65
modules/ISTRN/ISTRN.php on lines 1..65

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

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

<?php
/**
 * IGRNC CRMEntity Class.
 *
 * @copyright YetiForce S.A.
Severity: Major
Found in modules/IGRNC/IGRNC.php and 9 other locations - About 5 hrs to fix
modules/IGDN/IGDN.php on lines 1..65
modules/IGDNC/IGDNC.php on lines 1..65
modules/IGIN/IGIN.php on lines 1..65
modules/IGRN/IGRN.php on lines 1..65
modules/IIDN/IIDN.php on lines 1..65
modules/IPreOrder/IPreOrder.php on lines 1..65
modules/ISTDN/ISTDN.php on lines 1..65
modules/ISTN/ISTN.php on lines 1..65
modules/ISTRN/ISTRN.php on lines 1..65

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

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

<?php
/**
 * IGIN CRMEntity Class.
 *
 * @copyright YetiForce S.A.
Severity: Major
Found in modules/IGIN/IGIN.php and 9 other locations - About 5 hrs to fix
modules/IGDN/IGDN.php on lines 1..65
modules/IGDNC/IGDNC.php on lines 1..65
modules/IGRN/IGRN.php on lines 1..65
modules/IGRNC/IGRNC.php on lines 1..65
modules/IIDN/IIDN.php on lines 1..65
modules/IPreOrder/IPreOrder.php on lines 1..65
modules/ISTDN/ISTDN.php on lines 1..65
modules/ISTN/ISTN.php on lines 1..65
modules/ISTRN/ISTRN.php on lines 1..65

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

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

    public function getHierarchy(): array
    {
        $focus = CRMEntity::getInstance($this->getModuleName());
        $hierarchy = $focus->getHierarchy($this->getId());
        foreach ($hierarchy['entries'] as $id => $storageInfo) {
Severity: Major
Found in modules/Partners/models/Record.php and 1 other location - About 5 hrs to fix
modules/Contacts/models/Record.php on lines 53..70

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

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

    public function getHierarchy()
    {
        $focus = CRMEntity::getInstance($this->getModuleName());
        $hierarchy = $focus->getHierarchy($this->getId());
        foreach ($hierarchy['entries'] as $competitionId => $data) {
Severity: Major
Found in modules/Contacts/models/Record.php and 1 other location - About 5 hrs to fix
modules/Partners/models/Record.php on lines 19..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 201.

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

                if (fieldInfo !== undefined && fieldInfo.type === 'reference') {
                    let mapFields = editInstance.getMappingRelatedField(
                        fieldInfo.name,
                        editInstance.getReferencedModuleName(blockElement),
                        form
public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 914..928

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

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

                if (fieldInfo !== undefined && fieldInfo.type === 'reference') {
                    let mapFields = editInstance.getMappingRelatedField(
                        fieldInfo.name,
                        editInstance.getReferencedModuleName(blockElement),
                        massEditContainer
Severity: Major
Found in public_html/layouts/basic/modules/Vtiger/resources/List.js and 1 other location - About 5 hrs to fix
public_html/layouts/basic/modules/Vtiger/resources/ChangesJsonModal.js on lines 23..37

Duplicated Code

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

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

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

Tuning

This issue has a mass of 152.

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

<?php
/**
 * Settings OSSMailView index view class.
 *
 * @copyright YetiForce S.A.
Severity: Minor
Found in modules/Settings/WidgetsManagement/models/Module.php - About 5 hrs to fix

    `` has 43 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default {
        setDialog(state, idOpen) {
            state.session.dialog = idOpen
        },
        miniMode(state, isMini) {
    Severity: Minor
    Found in public_html/src/layouts/basic/modules/Chat/store/mutations.js - About 5 hrs to fix

      PrivilegeUtil has 43 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class PrivilegeUtil
      {
          /** @var int Allowed group nests */
          public const GROUP_LOOP_LIMIT = 5;
      
      
      Severity: Minor
      Found in app/PrivilegeUtil.php - About 5 hrs to fix

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

            public function preProcessSettings(App\Request $request)
            {
                if (!empty(\Config\Security::$askSuperUserAboutVisitPurpose) && !\App\Session::has('showedModalVisitPurpose') && !\App\User::getCurrentUserModel()->isAdmin()) {
                    \App\Process::addEvent([
                        'name' => 'showSuperUserVisitPurpose',
        Severity: Major
        Found in modules/Settings/Users/views/Edit.php and 1 other location - About 5 hrs to fix
        modules/Settings/Users/views/Detail.php on lines 35..52

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

        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 preProcessSettings(App\Request $request)
            {
                if (!empty(\Config\Security::$askSuperUserAboutVisitPurpose) && !\App\Session::has('showedModalVisitPurpose') && !\App\User::getCurrentUserModel()->isAdmin()) {
                    \App\Process::addEvent([
                        'name' => 'showSuperUserVisitPurpose',
        Severity: Major
        Found in modules/Settings/Users/views/Detail.php and 1 other location - About 5 hrs to fix
        modules/Settings/Users/views/Edit.php on lines 46..63

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

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

            public static function purifyByType($input, $type, $convert = false)
            {
                if (\is_array($input)) {
                    $value = [];
                    foreach ($input as $k => $v) {
        Severity: Major
        Found in app/Purifier.php - About 5 hrs to fix

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

              public function process(App\Request $request)
              {
                  $moduleName = $request->getModule();
                  $relatedModuleName = $request->getByType('relatedModule', 2);
                  $parentId = $request->getInteger('record');
          Severity: Major
          Found in modules/Vtiger/views/RelatedList.php - About 5 hrs to fix

            File ServiceContracts.php has 408 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Service contracts utils file.
             *
             * @package App
            Severity: Minor
            Found in app/Utils/ServiceContracts.php - About 5 hrs to fix

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

                          foreach (static::getDatashare('user2user', $modTabId, $userid) as $row) {
                              $shareUserId = (int) $row['share_userid'];
                              $shareIdUsers = [];
                              $shareIdUsers[] = $shareUserId;
                              if (1 === (int) $row['permission']) {
              Severity: Major
              Found in app/PrivilegeUtil.php and 3 other locations - About 5 hrs to fix
              app/PrivilegeUtil.php on lines 1184..1201
              app/PrivilegeUtil.php on lines 1203..1221
              app/PrivilegeUtil.php on lines 1223..1240

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

              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('user2rs', $modTabId, $parRoleList) as $row) {
                              $shareUserId = (int) $row['share_userid'];
                              $shareIdUsers = [];
                              $shareIdUsers[] = $shareUserId;
                              if (1 === (int) $row['permission']) {
              Severity: Major
              Found in app/PrivilegeUtil.php and 3 other locations - About 5 hrs to fix
              app/PrivilegeUtil.php on lines 1165..1182
              app/PrivilegeUtil.php on lines 1184..1201
              app/PrivilegeUtil.php on lines 1203..1221

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

              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('user2group', $modTabId, $groupList) as $row) {
                              $shareUserId = (int) $row['share_userid'];
                              $shareIdUsers = [];
                              $shareIdUsers[] = $shareUserId;
                              if (1 === (int) $row['permission']) {
              Severity: Major
              Found in app/PrivilegeUtil.php and 3 other locations - About 5 hrs to fix
              app/PrivilegeUtil.php on lines 1165..1182
              app/PrivilegeUtil.php on lines 1203..1221
              app/PrivilegeUtil.php on lines 1223..1240

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

              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