YetiForceCompany/YetiForceCRM

View on GitHub
include/CRMEntity.php

Summary

Maintainability
C
7 hrs
Test Coverage
B
82%

Function retrieveEntityInfo has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function retrieveEntityInfo(int $record, string $module)
    {
        if (!isset($record)) {
            throw new \App\Exceptions\NoPermittedToRecord('LBL_RECORD_NOT_FOUND');
        }
Severity: Minor
Found in include/CRMEntity.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

Method retrieveEntityInfo has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function retrieveEntityInfo(int $record, string $module)
    {
        if (!isset($record)) {
            throw new \App\Exceptions\NoPermittedToRecord('LBL_RECORD_NOT_FOUND');
        }
Severity: Minor
Found in include/CRMEntity.php - About 1 hr to fix

    Function getInstance has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getInstance(string $module)
        {
            if (is_numeric($module)) {
                $module = App\Module::getModuleName($module);
            }
    Severity: Minor
    Found in include/CRMEntity.php - About 45 mins 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 moduleHandler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function moduleHandler($moduleName, $eventType)
        {
            if ($moduleName && 'module.postinstall' === $eventType) {
            } elseif ('module.disabled' === $eventType) {
            } elseif ('module.preuninstall' === $eventType) {
    Severity: Minor
    Found in include/CRMEntity.php - About 25 mins 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

    The method retrieveEntityInfo() has an NPath complexity of 898. The configured NPath complexity threshold is 200.
    Open

        public function retrieveEntityInfo(int $record, string $module)
        {
            if (!isset($record)) {
                throw new \App\Exceptions\NoPermittedToRecord('LBL_RECORD_NOT_FOUND');
            }
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    NPathComplexity

    Since: 0.1

    The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

    Example

    class Foo {
        function bar() {
            // lots of complicated code
        }
    }

    Source https://phpmd.org/rules/codesize.html#npathcomplexity

    The method retrieveEntityInfo() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
    Open

        public function retrieveEntityInfo(int $record, string $module)
        {
            if (!isset($record)) {
                throw new \App\Exceptions\NoPermittedToRecord('LBL_RECORD_NOT_FOUND');
            }
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    CyclomaticComplexity

    Since: 0.1

    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

    Example

    // Cyclomatic Complexity = 11
    class Foo {
    1   public function example() {
    2       if ($a == $b) {
    3           if ($a1 == $b1) {
                    fiddle();
    4           } elseif ($a2 == $b2) {
                    fiddle();
                } else {
                    fiddle();
                }
    5       } elseif ($c == $d) {
    6           while ($c == $d) {
                    fiddle();
                }
    7        } elseif ($e == $f) {
    8           for ($n = 0; $n < $h; $n++) {
                    fiddle();
                }
            } else {
                switch ($z) {
    9               case 1:
                        fiddle();
                        break;
    10              case 2:
                        fiddle();
                        break;
    11              case 3:
                        fiddle();
                        break;
                    default:
                        fiddle();
                        break;
                }
            }
        }
    }

    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

    Refactor this function to reduce its Cognitive Complexity from 31 to the 15 allowed.
    Open

        public function retrieveEntityInfo(int $record, string $module)
    Severity: Critical
    Found in include/CRMEntity.php by sonar-php

    Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

    See

    Missing class import via use statement (line '122', column '17').
    Open

                $query = new \App\Db\Query();
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '150', column '15').
    Open

                    throw new \App\Exceptions\NoPermittedToRecord('ERR_RECORD_NOT_FOUND||' . $record);
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method setRelationTables has a boolean flag argument $secModule, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function setRelationTables($secModule = false)
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Missing class import via use statement (line '119', column '14').
    Open

                throw new \App\Exceptions\NoPermittedToRecord('LBL_RECORD_NOT_FOUND');
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Avoid using static access to class 'vtlib\Deprecated' in method '__construct'.
    Open

            $this->column_fields = vtlib\Deprecated::getColumnFields(static::class);
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class 'App\Config' in method 'getInstance'.
    Open

                if (App\Config::performance('LOAD_CUSTOM_FILES') && file_exists("custom/modules/$module/$module.php")) {
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\vtlib\Deprecated' in method 'getInstance'.
    Open

                    \vtlib\Deprecated::checkFileAccessForInclusion("custom/modules/$module/$module.php");
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\vtlib\Deprecated' in method 'getInstance'.
    Open

                    \vtlib\Deprecated::checkFileAccessForInclusion("modules/$module/$module.php");
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\App\User' in method 'trackLinkedInfo'.
    Open

            \App\Db::getInstance()->createCommand()->update('vtiger_crmentity', ['modifiedtime' => $currentTime, 'modifiedby' => \App\User::getCurrentUserId()], ['crmid' => $crmId])->execute();
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\App\User' in method 'trackUnLinkedInfo'.
    Open

            \App\Db::getInstance()->createCommand()->update('vtiger_crmentity', ['modifiedtime' => $currentTime, 'modifiedby' => \App\User::getCurrentUserId()], ['crmid' => $crmId])->execute();
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\App\Cache' in method 'getInstance'.
    Open

            if (\App\Cache::staticHas('CRMEntity', $module)) {
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\App\Cache' in method 'getInstance'.
    Open

                return clone \App\Cache::staticGet('CRMEntity', $module);
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    The method getInstance uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                } else {
                    \vtlib\Deprecated::checkFileAccessForInclusion("modules/$module/$module.php");
                    require_once "modules/$module/$module.php";
                }
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Avoid using static access to class 'App\Module' in method 'getInstance'.
    Open

                $module = App\Module::getModuleName($module);
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid assigning values to variables in if clauses and the like (line '121', column '7').
    Open

        public function retrieveEntityInfo(int $record, string $module)
        {
            if (!isset($record)) {
                throw new \App\Exceptions\NoPermittedToRecord('LBL_RECORD_NOT_FOUND');
            }
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

    Avoid using static access to class '\App\Fields\SharedOwner' in method 'retrieveEntityInfo'.
    Open

                        $fieldvalue = \App\Fields\SharedOwner::getById($record);
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\App\Field' in method 'retrieveEntityInfo'.
    Open

            if ($cachedModuleFields = \App\Field::getModuleFieldInfosByPresence($module)) {
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\App\Cache' in method 'getInstance'.
    Open

            \App\Cache::staticSave('CRMEntity', $module, clone $focus);
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Define a constant instead of duplicating this literal "vtiger_crmentity" 5 times.
    Open

                $query->from('vtiger_crmentity');
    Severity: Critical
    Found in include/CRMEntity.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Remove this commented out code.
    Open

     * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
    Severity: Major
    Found in include/CRMEntity.php by sonar-php

    Programmers should not comment out code as it bloats programs and reduces readability.

    Unused code should be deleted and can be retrieved from source control history if required.

    See

    • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
    • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
    • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
    • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

    Define a constant instead of duplicating this literal "tablename" 6 times.
    Open

            return strtolower($fieldInfo['tablename'] . $fieldInfo['fieldname']);
    Severity: Critical
    Found in include/CRMEntity.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "crmid" 5 times.
    Open

            $this->tab_name_index += ['u_yf_wapro_records_map' => 'crmid'];
    Severity: Critical
    Found in include/CRMEntity.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "LEFT JOIN" 4 times.
    Open

            'vtiger_entity_stats' => 'LEFT JOIN',
    Severity: Critical
    Found in include/CRMEntity.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "CRMEntity" 3 times.
    Open

            if (\App\Cache::staticHas('CRMEntity', $module)) {
    Severity: Critical
    Found in include/CRMEntity.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Argument 1 (tabId) is string but \App\Module::getModuleName() takes int defined at /code/app/Module.php:129
    Open

                $module = App\Module::getModuleName($module);
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Call to undeclared method \App\Db\Query::select
    Open

                $query->select($columnClause);
    Severity: Critical
    Found in include/CRMEntity.php by phan

    Default value for string $secModule can't be false
    Open

        public function setRelationTables($secModule = false)
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Expected an object instance or the name of a class but saw expression with type bool|string
    Open

            $focus = new $module();
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Call to undeclared method \App\Db\Query::from
    Open

                $query->from('vtiger_crmentity');
    Severity: Critical
    Found in include/CRMEntity.php by phan

    Call to undeclared method \App\Db\Query::andWhere
    Open

                    $query->andWhere(['vtiger_crmentity.setype' => $module]);
    Severity: Critical
    Found in include/CRMEntity.php by phan

    Reference to undeclared property \CRMEntity->table_name
    Open

                    $this->table_name => $this->table_index,
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Call to undeclared method \App\Db\Query::leftJoin
    Open

                    $query->leftJoin($tableName, "vtiger_crmentity.crmid = $tableName.$tableIndex");
    Severity: Critical
    Found in include/CRMEntity.php by phan

    Call to undeclared method \App\Db::createCommand
    Open

            \App\Db::getInstance()->createCommand()->update('vtiger_crmentity', ['modifiedtime' => $currentTime, 'modifiedby' => \App\User::getCurrentUserId()], ['crmid' => $crmId])->execute();
    Severity: Critical
    Found in include/CRMEntity.php by phan

    Reference to undeclared property \CRMEntity->lockFields
    Open

            if (isset($this->lockFields)) {
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Call to undeclared method \App\Db::createCommand
    Open

            \App\Db::getInstance()->createCommand()->update('vtiger_crmentity', ['modifiedtime' => $currentTime, 'modifiedby' => \App\User::getCurrentUserId()], ['crmid' => $crmId])->execute();
    Severity: Critical
    Found in include/CRMEntity.php by phan

    Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\Db::getInstance()->createCommand()->update('vtiger_crmentity', ['modifiedtime' => $currentTime, 'modifiedby' => \App\User::getCurrentUserId()], ['crmid' => $crmId])->execute();
    Severity: Critical
    Found in include/CRMEntity.php by phan

    Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\Db::getInstance()->createCommand()->update('vtiger_crmentity', ['modifiedtime' => $currentTime, 'modifiedby' => \App\User::getCurrentUserId()], ['crmid' => $crmId])->execute();
    Severity: Critical
    Found in include/CRMEntity.php by phan

    Reference to undeclared property \CRMEntity->column_fields
    Open

            $this->column_fields = vtlib\Deprecated::getColumnFields(static::class);
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Reference to undeclared property \CRMEntity->column_fields
    Open

            $this->column_fields['record_module'] = $module;
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Reference to undeclared property \CRMEntity->lockFields
    Open

                return $this->lockFields;
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Call to undeclared method \App\Db\Query::where
    Open

                $query->where(['vtiger_crmentity.crmid' => $record]);
    Severity: Critical
    Found in include/CRMEntity.php by phan

    Reference to undeclared property \CRMEntity->column_fields
    Open

                    $this->column_fields[$fieldInfo['fieldname']] = $fieldvalue;
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Reference to undeclared property \CRMEntity->column_fields
    Open

            $this->column_fields['record_id'] = $record;
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Reference to undeclared property \CRMEntity->table_index
    Open

                    $this->table_name => $this->table_index,
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Reference to undeclared property \CRMEntity->table_index
    Open

                    $this->table_name => $this->table_index,
    Severity: Minor
    Found in include/CRMEntity.php by phan

    Reference to undeclared property \CRMEntity->table_name
    Open

                    $this->table_name => $this->table_index,
    Severity: Minor
    Found in include/CRMEntity.php by phan

    This branch's code block is the same as the block for the branch on line 259.
    Open

            } elseif ('module.preuninstall' === $eventType) {
            } elseif ('module.preupdate' === $eventType) {
    Severity: Major
    Found in include/CRMEntity.php by sonar-php

    Having two cases in a switch statement or two branches in an if chain with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then in an if chain they should be combined, or for a switch, one should fall through to the other.

    Noncompliant Code Example

    switch ($i) {
      case 1:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      case 3:  // Noncompliant; duplicates case 1's implementation
        doSomething();
        break;
      default:
        doTheRest();
    }
    
    if ($a >= 0 && $a < 10) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else if ($a >= 20 && $a < 50) {
      doTheThing();  // Noncompliant; duplicates first condition
    }
    else {
      doTheRest();
    }
    
    if ($b == 0) {
      doOneMoreThing();
    }
    else {
      doOneMoreThing(); // Noncompliant; duplicates then-branch
    }
    
    var b = a ? 12 > 4 : 4;  // Noncompliant; always results in the same value
    

    Compliant Solution

    switch ($i) {
      case 1:
      case 3:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      default:
        doTheRest();
    }
    
    if (($a >= 0 && $a < 10) || ($a >= 20 && $a < 50)) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else {
      doTheRest();
    }
    
    doOneMoreThing();
    
    b = 4;
    

    or

    switch ($i) {
      case 1:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      case 3:
        doThirdThing();
        break;
      default:
        doTheRest();
    }
    
    if ($a >= 0 && $a < 10) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else if ($a >= 20 && $a < 50) {
      doTheThirdThing();
    }
    else {
      doTheRest();
    }
    
    if ($b == 0) {
      doOneMoreThing();
    }
    else {
      doTheRest();
    }
    
    int b = a ? 12 > 4 : 8;
    

    Exceptions

    Blocks in an if chain that contain a single line of code are ignored, as are blocks in a switch statement that contain a single line of code with or without a following break.

    This branch's code block is the same as the block for the branch on line 259.
    Open

            } elseif ('module.disabled' === $eventType) {
            } elseif ('module.preuninstall' === $eventType) {
    Severity: Major
    Found in include/CRMEntity.php by sonar-php

    Having two cases in a switch statement or two branches in an if chain with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then in an if chain they should be combined, or for a switch, one should fall through to the other.

    Noncompliant Code Example

    switch ($i) {
      case 1:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      case 3:  // Noncompliant; duplicates case 1's implementation
        doSomething();
        break;
      default:
        doTheRest();
    }
    
    if ($a >= 0 && $a < 10) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else if ($a >= 20 && $a < 50) {
      doTheThing();  // Noncompliant; duplicates first condition
    }
    else {
      doTheRest();
    }
    
    if ($b == 0) {
      doOneMoreThing();
    }
    else {
      doOneMoreThing(); // Noncompliant; duplicates then-branch
    }
    
    var b = a ? 12 > 4 : 4;  // Noncompliant; always results in the same value
    

    Compliant Solution

    switch ($i) {
      case 1:
      case 3:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      default:
        doTheRest();
    }
    
    if (($a >= 0 && $a < 10) || ($a >= 20 && $a < 50)) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else {
      doTheRest();
    }
    
    doOneMoreThing();
    
    b = 4;
    

    or

    switch ($i) {
      case 1:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      case 3:
        doThirdThing();
        break;
      default:
        doTheRest();
    }
    
    if ($a >= 0 && $a < 10) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else if ($a >= 20 && $a < 50) {
      doTheThirdThing();
    }
    else {
      doTheRest();
    }
    
    if ($b == 0) {
      doOneMoreThing();
    }
    else {
      doTheRest();
    }
    
    int b = a ? 12 > 4 : 8;
    

    Exceptions

    Blocks in an if chain that contain a single line of code are ignored, as are blocks in a switch statement that contain a single line of code with or without a following break.

    This branch's code block is the same as the block for the branch on line 259.
    Open

            } elseif ('module.preupdate' === $eventType) {
            } elseif ('module.postupdate' === $eventType) {
    Severity: Major
    Found in include/CRMEntity.php by sonar-php

    Having two cases in a switch statement or two branches in an if chain with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then in an if chain they should be combined, or for a switch, one should fall through to the other.

    Noncompliant Code Example

    switch ($i) {
      case 1:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      case 3:  // Noncompliant; duplicates case 1's implementation
        doSomething();
        break;
      default:
        doTheRest();
    }
    
    if ($a >= 0 && $a < 10) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else if ($a >= 20 && $a < 50) {
      doTheThing();  // Noncompliant; duplicates first condition
    }
    else {
      doTheRest();
    }
    
    if ($b == 0) {
      doOneMoreThing();
    }
    else {
      doOneMoreThing(); // Noncompliant; duplicates then-branch
    }
    
    var b = a ? 12 > 4 : 4;  // Noncompliant; always results in the same value
    

    Compliant Solution

    switch ($i) {
      case 1:
      case 3:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      default:
        doTheRest();
    }
    
    if (($a >= 0 && $a < 10) || ($a >= 20 && $a < 50)) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else {
      doTheRest();
    }
    
    doOneMoreThing();
    
    b = 4;
    

    or

    switch ($i) {
      case 1:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      case 3:
        doThirdThing();
        break;
      default:
        doTheRest();
    }
    
    if ($a >= 0 && $a < 10) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else if ($a >= 20 && $a < 50) {
      doTheThirdThing();
    }
    else {
      doTheRest();
    }
    
    if ($b == 0) {
      doOneMoreThing();
    }
    else {
      doTheRest();
    }
    
    int b = a ? 12 > 4 : 8;
    

    Exceptions

    Blocks in an if chain that contain a single line of code are ignored, as are blocks in a switch statement that contain a single line of code with or without a following break.

    Either remove or fill this block of code.
    Open

            } elseif ('module.preupdate' === $eventType) {
            } elseif ('module.postupdate' === $eventType) {
    Severity: Major
    Found in include/CRMEntity.php by sonar-php

    Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.

    Noncompliant Code Example

    for ($i = 0; $i < 42; $i++){}  // Empty on purpose or missing piece of code ?
    

    Exceptions

    When a block contains a comment, this block is not considered to be empty.

    Either remove or fill this block of code.
    Open

            } elseif ('module.postupdate' === $eventType) {
            }
    Severity: Major
    Found in include/CRMEntity.php by sonar-php

    Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.

    Noncompliant Code Example

    for ($i = 0; $i < 42; $i++){}  // Empty on purpose or missing piece of code ?
    

    Exceptions

    When a block contains a comment, this block is not considered to be empty.

    This branch's code block is the same as the block for the branch on line 259.
    Open

            } elseif ('module.postupdate' === $eventType) {
            }
    Severity: Major
    Found in include/CRMEntity.php by sonar-php

    Having two cases in a switch statement or two branches in an if chain with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then in an if chain they should be combined, or for a switch, one should fall through to the other.

    Noncompliant Code Example

    switch ($i) {
      case 1:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      case 3:  // Noncompliant; duplicates case 1's implementation
        doSomething();
        break;
      default:
        doTheRest();
    }
    
    if ($a >= 0 && $a < 10) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else if ($a >= 20 && $a < 50) {
      doTheThing();  // Noncompliant; duplicates first condition
    }
    else {
      doTheRest();
    }
    
    if ($b == 0) {
      doOneMoreThing();
    }
    else {
      doOneMoreThing(); // Noncompliant; duplicates then-branch
    }
    
    var b = a ? 12 > 4 : 4;  // Noncompliant; always results in the same value
    

    Compliant Solution

    switch ($i) {
      case 1:
      case 3:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      default:
        doTheRest();
    }
    
    if (($a >= 0 && $a < 10) || ($a >= 20 && $a < 50)) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else {
      doTheRest();
    }
    
    doOneMoreThing();
    
    b = 4;
    

    or

    switch ($i) {
      case 1:
        doSomething();
        break;
      case 2:
        doSomethingDifferent();
        break;
      case 3:
        doThirdThing();
        break;
      default:
        doTheRest();
    }
    
    if ($a >= 0 && $a < 10) {
      doTheThing();
    else if ($a >= 10 && $a < 20) {
      doTheOtherThing();
    }
    else if ($a >= 20 && $a < 50) {
      doTheThirdThing();
    }
    else {
      doTheRest();
    }
    
    if ($b == 0) {
      doOneMoreThing();
    }
    else {
      doTheRest();
    }
    
    int b = a ? 12 > 4 : 8;
    

    Exceptions

    Blocks in an if chain that contain a single line of code are ignored, as are blocks in a switch statement that contain a single line of code with or without a following break.

    Either remove or fill this block of code.
    Open

            if ($moduleName && 'module.postinstall' === $eventType) {
            } elseif ('module.disabled' === $eventType) {
    Severity: Major
    Found in include/CRMEntity.php by sonar-php

    Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.

    Noncompliant Code Example

    for ($i = 0; $i < 42; $i++){}  // Empty on purpose or missing piece of code ?
    

    Exceptions

    When a block contains a comment, this block is not considered to be empty.

    Either remove or fill this block of code.
    Open

            } elseif ('module.disabled' === $eventType) {
            } elseif ('module.preuninstall' === $eventType) {
    Severity: Major
    Found in include/CRMEntity.php by sonar-php

    Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.

    Noncompliant Code Example

    for ($i = 0; $i < 42; $i++){}  // Empty on purpose or missing piece of code ?
    

    Exceptions

    When a block contains a comment, this block is not considered to be empty.

    Either remove or fill this block of code.
    Open

            } elseif ('module.preuninstall' === $eventType) {
            } elseif ('module.preupdate' === $eventType) {
    Severity: Major
    Found in include/CRMEntity.php by sonar-php

    Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.

    Noncompliant Code Example

    for ($i = 0; $i < 42; $i++){}  // Empty on purpose or missing piece of code ?
    

    Exceptions

    When a block contains a comment, this block is not considered to be empty.

    Each class must be in a namespace of at least one level (a top-level vendor name)
    Open

    class CRMEntity
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 34 and the first side effect is on line 23.
    Open

    <?php
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    The property $tab_name_index is not named in camelCase.
    Open

    class CRMEntity
    {
        /** @var array */
        public $tab_name_index = [];
    
    
    Severity: Minor
    Found in include/CRMEntity.php by phpmd

    CamelCasePropertyName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name attributes.

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    Spaces must be used to indent lines; tabs are not allowed
    Open

        ];
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                } else {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    \vtlib\Deprecated::checkFileAccessForInclusion("modules/$module/$module.php");
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $focus->moduleName = $module;
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $module
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return strtolower($fieldInfo['tablename'] . $fieldInfo['fieldname']);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param int    $record - crmid of record
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if ($cachedModuleFields = \App\Field::getModuleFieldInfosByPresence($module)) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Line exceeds 120 characters; contains 151 characters
    Open

                        $columnClause[] = $fieldInfo['tablename'] . '.' . $fieldInfo['columnname'] . ' AS ' . $this->createColumnAliasForField($fieldInfo);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public $tableJoinClause = [
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $query = new \App\Db\Query();
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $focus->init();
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            'vtiger_entity_stats' => 'LEFT JOIN',
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        // Alias prefixed with tablename+fieldname to avoid duplicate column name across tables
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function retrieveEntityInfo(int $record, string $module)
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $requiredTables = $columnClause = [];
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public $tab_name_index = [];
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            \App\Cache::staticSave('CRMEntity', $module, clone $focus);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Retrieve record information of the module.
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->column_fields = vtlib\Deprecated::getColumnFields(static::class);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Loading the system configuration.
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $tabNameIndex = $this->tab_name_index; // copies-on-write
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Constructor which will set the column_fields in this object.
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if (App\Config::performance('LOAD_CUSTOM_FILES') && file_exists("custom/modules/$module/$module.php")) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    \vtlib\Deprecated::checkFileAccessForInclusion("custom/modules/$module/$module.php");
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return $focus;
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->tab_name_index += ['u_yf_wapro_records_map' => 'crmid'];
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        protected function createColumnAliasForField(array $fieldInfo)
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            $requiredTables[$fieldInfo['tablename']] = $tabNameIndex[$fieldInfo['tablename']];
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $focus = new $module();
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return void
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (!isset($record)) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                foreach ($cachedModuleFields as $fieldInfo) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /** @var array */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return self
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public static function getInstance(string $module)
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (\App\Cache::staticHas('CRMEntity', $module)) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Function returns the column alias for a field.
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return string field value
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        // fieldname are always assumed to be unique for a module
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $module = App\Module::getModuleName($module);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    require_once "custom/modules/$module/$module.php";
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function __construct()
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return array returns the array with table names and fieldnames storing relations
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                'Documents' => [
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Function to track when a record is unlinked to a given record.
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $currentTime = date('Y-m-d H:i:s');
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function moduleHandler($moduleName, $eventType)
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (is_numeric($module)) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            // File access security check
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (!class_exists($module)) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (method_exists($focus, 'init')) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    if (isset($tabNameIndex[$fieldInfo['tablename']])) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        $fieldvalue = \App\Fields\SharedOwner::getById($record);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                return 'LEFT JOIN';
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                ],
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            ];
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param mixed $crmId
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            \App\Db::getInstance()->createCommand()->update('vtiger_crmentity', ['modifiedtime' => $currentTime, 'modifiedby' => \App\User::getCurrentUserId()], ['crmid' => $crmId])->execute();
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Line exceeds 120 characters; contains 189 characters
    Open

            \App\Db::getInstance()->createCommand()->update('vtiger_crmentity', ['modifiedtime' => $currentTime, 'modifiedby' => \App\User::getCurrentUserId()], ['crmid' => $crmId])->execute();
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            'u_yf_openstreetmap' => 'LEFT JOIN',
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            'u_yf_wapro_records_map' => 'LEFT JOIN',
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        protected function init(): void
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                throw new \App\Exceptions\NoPermittedToRecord('LBL_RECORD_NOT_FOUND');
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        $columnClause[] = $fieldInfo['tablename'] . '.' . $fieldInfo['columnname'] . ' AS ' . $this->createColumnAliasForField($fieldInfo);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $query->where(['vtiger_crmentity.crmid' => $record]);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function getJoinClause($tableName): string
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function setRelationTables($secModule = false)
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $relTables = [
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function trackUnLinkedInfo($crmId)
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Line exceeds 120 characters; contains 189 characters
    Open

            \App\Db::getInstance()->createCommand()->update('vtiger_crmentity', ['modifiedtime' => $currentTime, 'modifiedby' => \App\User::getCurrentUserId()], ['crmid' => $crmId])->execute();
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                return $this->lockFields;
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $moduleName Module name
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        $fieldvalue = $resultRow[$fieldkey];
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                            $fieldvalue = implode(',', $fieldvalue);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    'vtiger_senotesrel' => ['crmid', 'notesid'],
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public static function trackLinkedInfo($crmId)
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (isset($this->lockFields)) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Invoked when special actions are performed on the module.
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /** @var string[] Tables join clause. */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Get CRMEntity instance.
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                return clone \App\Cache::staticGet('CRMEntity', $module);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    require_once "modules/$module/$module.php";
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param array $fieldInfo - field information
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $module - module name
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        if (!isset($requiredTables[$fieldInfo['tablename']])) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    throw new \App\Exceptions\NoPermittedToRecord('ERR_RECORD_NOT_FOUND||' . $record);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Get table join clause by table name.
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (isset($this->tableJoinClause[$tableName])) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    'vtiger_ossmailview_relation' => ['crmid', 'ossmailviewid'],
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $query->leftJoin($tableName, "vtiger_crmentity.crmid = $tableName.$tableIndex");
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                return $this->tableJoinClause[$tableName];
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $this->table_name => $this->table_index,
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $currentTime = date('Y-m-d H:i:s');
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if ($moduleName && 'module.postinstall' === $eventType) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    if (isset($resultRow[$fieldkey])) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return string
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $this->table_name => $this->table_index,
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return $relTables[$secModule] ?? [];
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $eventType  Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $query->select($columnClause);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $query->andWhere(['vtiger_crmentity.setype' => $module]);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $fieldvalue = '';
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                        if (\is_array($fieldvalue)) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $this->column_fields[$fieldInfo['fieldname']] = $fieldvalue;
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        public function getLockFields()
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Function to track when a new record is linked to a given record.
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $tableName
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *               between module and this module
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            \App\Db::getInstance()->createCommand()->update('vtiger_crmentity', ['modifiedtime' => $currentTime, 'modifiedby' => \App\User::getCurrentUserId()], ['crmid' => $crmId])->execute();
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            } elseif ('module.preupdate' === $eventType) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            } elseif ('module.postupdate' === $eventType) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if (isset($requiredTables['vtiger_crmentity'])) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if ('' != $module) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Gets fields to locking record.
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $columnClause[] = 'vtiger_crmentity.deleted';
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                foreach ($requiredTables as $tableName => $tableIndex) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    $fieldkey = $this->createColumnAliasForField($fieldInfo);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->column_fields['record_module'] = $module;
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                'OSSMailView' => [
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (false === $secModule) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @return array
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            } elseif ('module.disabled' === $eventType) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                if (empty($resultRow)) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * Function to get the relation tables for related modules.
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param string $secModule - $secmodule secondary module name
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                return $relTables;
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $query->from('vtiger_crmentity');
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    unset($requiredTables['vtiger_crmentity']);
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                $resultRow = $query->one();
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return 'INNER JOIN';
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                foreach ($cachedModuleFields as $fieldInfo) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            $this->column_fields['record_id'] = $record;
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            if (strripos($tableName, 'rel') === (\strlen($tableName) - 3)) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         * @param int $crmId
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    //Note : value is retrieved with a tablename+fieldname as we are using alias while building query
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                    if (120 === $fieldInfo['uitype']) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

                ],
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            return [];
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    Spaces must be used to indent lines; tabs are not allowed
    Open

            } elseif ('module.preuninstall' === $eventType) {
    Severity: Minor
    Found in include/CRMEntity.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status