YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/helpers/Util.php

Summary

Maintainability
C
7 hrs
Test Coverage
F
25%

Method formatDateDiffInStrings has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function formatDateDiffInStrings($dateTime)
    {
        // http://www.php.net/manual/en/datetime.diff.php#101029
        $seconds = strtotime('now') - strtotime($dateTime);
        if (0 === $seconds) {
Severity: Minor
Found in modules/Vtiger/helpers/Util.php - About 1 hr to fix

    Function formatDateIntoStrings has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function formatDateIntoStrings($date, $time = false)
        {
            $currentUser = Users_Record_Model::getCurrentUserModel();
            $dateTimeInUserFormat = App\Fields\DateTime::formatToDisplay($date . ' ' . $time);
    
    
    Severity: Minor
    Found in modules/Vtiger/helpers/Util.php - About 1 hr 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 formatDateIntoStrings has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function formatDateIntoStrings($date, $time = false)
        {
            $currentUser = Users_Record_Model::getCurrentUserModel();
            $dateTimeInUserFormat = App\Fields\DateTime::formatToDisplay($date . ' ' . $time);
    
    
    Severity: Minor
    Found in modules/Vtiger/helpers/Util.php - About 1 hr to fix

      Function formatDateDiffInStrings has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function formatDateDiffInStrings($dateTime)
          {
              // http://www.php.net/manual/en/datetime.diff.php#101029
              $seconds = strtotime('now') - strtotime($dateTime);
              if (0 === $seconds) {
      Severity: Minor
      Found in modules/Vtiger/helpers/Util.php - About 1 hr 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

      Avoid too many return statements within this method.
      Open

                  return $prefix . self::pluralize($months, 'LBL_MONTH') . $suffix;
      Severity: Major
      Found in modules/Vtiger/helpers/Util.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $prefix . self::pluralize($days, 'LBL_DAY') . $suffix;
        Severity: Major
        Found in modules/Vtiger/helpers/Util.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $prefix . $result . $suffix;
          Severity: Major
          Found in modules/Vtiger/helpers/Util.php - About 30 mins to fix

            The method formatDateDiffInStrings() has an NPath complexity of 576. The configured NPath complexity threshold is 200.
            Open

                public static function formatDateDiffInStrings($dateTime)
                {
                    // http://www.php.net/manual/en/datetime.diff.php#101029
                    $seconds = strtotime('now') - strtotime($dateTime);
                    if (0 === $seconds) {
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 formatDateDiffInStrings() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
            Open

                public static function formatDateDiffInStrings($dateTime)
                {
                    // http://www.php.net/manual/en/datetime.diff.php#101029
                    $seconds = strtotime('now') - strtotime($dateTime);
                    if (0 === $seconds) {
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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

            Reduce the number of returns of this function 7, down to the maximum allowed 3.
            Open

                public static function formatDateDiffInStrings($dateTime)
            Severity: Major
            Found in modules/Vtiger/helpers/Util.php by sonar-php

            Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

            Noncompliant Code Example

            With the default threshold of 3:

            function myFunction(){ // Noncompliant as there are 4 return statements
              if (condition1) {
                return true;
              } else {
                if (condition2) {
                  return false;
                } else {
                  return true;
                }
              }
              return false;
            }
            

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

                public static function formatDateIntoStrings($date, $time = false)
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 '166', column '15').
            Open

                    return (new \App\Db\Query())->from('vtiger_currency_info')->where(['<', 'defaultid', '0'])->one();
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 '225', column '15').
            Open

                    return (new App\Db\Query())->from('vtiger_users')
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 '\App\Language' in method 'formatDateIntoStrings'.
            Open

                        $dayInfo = \App\Language::translate('LBL_' . date('D', $date));
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Language' in method 'formatDateDiffInStrings'.
            Open

                        return \App\Language::translate('LBL_JUSTNOW');
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 'DateTimeField' in method 'formatDateIntoStrings'.
            Open

                    $userDate = DateTimeField::__convertToUserFormat($date, $currentUser->get('date_format'));
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Language' in method 'pluralize'.
            Open

                    return $count . ' ' . ((1 === $count) ? \App\Language::translate("$text") : \App\Language::translate("{$text}S"));
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 'Vtiger_Time_UIType' in method 'formatDateIntoStrings'.
            Open

                        $displayTime = Vtiger_Time_UIType::getTimeValueInAMorPM($displayTime);
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Language' in method 'formatDateIntoStrings'.
            Open

                            $todayInfo .= ' ' . \App\Language::translate('LBL_AT') . ' ' . $displayTime;
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Language' in method 'formatDateIntoStrings'.
            Open

                        $tomorrowInfo = \App\Language::translate('LBL_TOMORROW');
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Language' in method 'pluralize'.
            Open

                    return $count . ' ' . ((1 === $count) ? \App\Language::translate("$text") : \App\Language::translate("{$text}S"));
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 'getActiveAdminCurrentDateTime'.
            Open

                    $default_timezone = \App\Config::main('default_timezone');
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Language' in method 'formatDateDiffInStrings'.
            Open

                        $suffix = ' ' . \App\Language::translate('LBL_AGO');
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Language' in method 'formatDateIntoStrings'.
            Open

                            $dayInfo .= ' ' . \App\Language::translate('LBL_AT') . ' ' . $displayTime;
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 formatDateIntoStrings uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                    } else {
                        if ('mm-dd-yyyy' === $currentUser->get('date_format')) {
                            $dateInUserFormat = str_replace('-', '/', $dateInUserFormat);
                        }
                        $date = strtotime($dateInUserFormat);
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 'Users' in method 'getActiveAdminCurrentDateTime'.
            Open

                    $admin = Users::getActiveAdminUser();
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Language' in method 'formatDateIntoStrings'.
            Open

                        $todayInfo = \App\Language::translate('LBL_TODAY');
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 'Users_Privileges_Model' in method 'convertTimeIntoUsersDisplayFormat'.
            Open

                        $userModel = Users_Privileges_Model::getCurrentUserModel();
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Language' in method 'formatDateDiffInStrings'.
            Open

                        $prefix = \App\Language::translate('LBL_DUE') . ' ';
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Fields\Date' in method 'formatDateIntoStrings'.
            Open

                    $today = App\Fields\Date::formatToDisplay(date('Y-m-d H:i:s'));
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Language' in method 'formatDateIntoStrings'.
            Open

                            $tomorrowInfo .= ' ' . \App\Language::translate('LBL_AT') . ' ' . $displayTime;
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Fields\DateTime' in method 'formatDateIntoStrings'.
            Open

                    $dateTimeInUserFormat = App\Fields\DateTime::formatToDisplay($date . ' ' . $time);
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 convertTimeIntoUsersDisplayFormat uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                    } else {
                        $userModel = Users_Privileges_Model::getCurrentUserModel();
                    }
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 'Users_Record_Model' in method 'formatDateIntoStrings'.
            Open

                    $currentUser = Users_Record_Model::getCurrentUserModel();
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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\Fields\Date' in method 'formatDateIntoStrings'.
            Open

                    $tomorrow = App\Fields\Date::formatToDisplay(date('Y-m-d H:i:s', strtotime('tomorrow')));
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 'Vtiger_Time_UIType' in method 'convertTimeIntoUsersDisplayFormat'.
            Open

                        $time = Vtiger_Time_UIType::getTimeValueInAMorPM($time);
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 'Users_Privileges_Model' in method 'convertTimeIntoUsersDisplayFormat'.
            Open

                        $userModel = Users_Privileges_Model::getInstanceFromUserObject($userObject);
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.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 "Y-m-d H:i:s" 3 times.
            Open

                    $today = App\Fields\Date::formatToDisplay(date('Y-m-d H:i:s'));
            Severity: Critical
            Found in modules/Vtiger/helpers/Util.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 "LBL_AT" 3 times.
            Open

                            $todayInfo .= ' ' . \App\Language::translate('LBL_AT') . ' ' . $displayTime;
            Severity: Critical
            Found in modules/Vtiger/helpers/Util.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.

            Saw unextractable annotation for comment '* @param <vtiger_users_model> $userObject'</vtiger_users_model>
            Open

                 * @param <Vtiger_Users_Model> $userObject
            Severity: Info
            Found in modules/Vtiger/helpers/Util.php by phan

            Saw unextractable annotation for comment '* @param <time> $time'</time>
            Open

                 * @param <Time>               $time
            Severity: Info
            Found in modules/Vtiger/helpers/Util.php by phan

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

                    return (new App\Db\Query())->from('vtiger_users')
            Severity: Critical
            Found in modules/Vtiger/helpers/Util.php by phan

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

                    return (new \App\Db\Query())->from('vtiger_currency_info')->where(['<', 'defaultid', '0'])->one();
            Severity: Critical
            Found in modules/Vtiger/helpers/Util.php by phan

            Reference to undeclared property \Users->time_zone
            Open

                    $adminTimeZone = $admin->time_zone;
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.php by phan

            Saw unextractable annotation for comment '* @param <number> $count'</number>
            Open

                 * @param <Number> $count
            Severity: Info
            Found in modules/Vtiger/helpers/Util.php by phan

            Saw unextractable annotation for comment '* @param <time> $time'</time>
            Open

                 * @param <Time> $time
            Severity: Info
            Found in modules/Vtiger/helpers/Util.php by phan

            Saw unextractable annotation for comment '* @param <date> $date'</date>
            Open

                 * @param <Date> $date
            Severity: Info
            Found in modules/Vtiger/helpers/Util.php by phan

            Saw unextractable annotation for comment '* @param <date time> $dateTime'</date>
            Open

                 * @param <Date Time> $dateTime
            Severity: Info
            Found in modules/Vtiger/helpers/Util.php by phan

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

            class Vtiger_Util_Helper

            The class Vtiger_Util_Helper is not named in CamelCase.
            Open

            class Vtiger_Util_Helper
            {
                /**
                 * Function parses date into readable format.
                 *
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.php by phpmd

            CamelCaseClassName

            Since: 0.2

            It is considered best practice to use the CamelCase notation to name classes.

            Example

            class class_name {
            }

            Source

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

                 * Function parses date into readable format.

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

                    } elseif ($seconds < 0) {

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

                /**

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

                    }

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

                    $hours = floor($minutes / 60);

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

                            $monthAgo = self::pluralize($month, 'LBL_MONTH');

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

                 *

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

                    $seconds = strtotime('now') - strtotime($dateTime);

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

                    $minutes = floor($seconds / 60);

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

                    }

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

                        return $prefix . self::pluralize($days, 'LBL_DAY') . $suffix;

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

                        return $prefix . self::pluralize($months, 'LBL_MONTH') . $suffix;

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

                 *

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

                    if ($seconds > 0) {

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

                    if ($minutes < 60) {

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

                        $month = $months % 12;

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

                        }

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

                        return \App\Language::translate('LBL_JUSTNOW');

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

                    if ($seconds < 60) {

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

                        $prefix = \App\Language::translate('LBL_DUE') . ' ';

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

                    if ($months > 11) {

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

                        $result = self::pluralize(floor($months / 12), 'LBL_YEAR') . ' ' . $monthAgo;

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

                 * @param <Date Time> $dateTime

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

                    if (0 === $seconds) {

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

                        return $prefix . self::pluralize($seconds, 'LBL_SECOND') . $suffix;

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

                        return $prefix . self::pluralize($hours, 'LBL_HOUR') . $suffix;

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

                    }

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

                    }

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

                {

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

                    [$dateInUserFormat, $timeInUserFormat] = explode(' ', $dateTimeInUserFormat);

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

                        if ($time) {

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

                        }

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

                    return str_replace(' ', '_', $string);

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

                 * Function decodes the utf-8 characters.

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

                 *

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

                public static function convertTimeIntoUsersDisplayFormat($time, $userObject = null)

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

                    }

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

                 */

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

                        $prefix = '';

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

                        $suffix = ' ' . \App\Language::translate('LBL_AGO');

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

                    $days = floor($hours / 24);

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

                 */

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

                    $dateTimeInUserFormat = App\Fields\DateTime::formatToDisplay($date . ' ' . $time);

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

                    $userDate = DateTimeField::__convertToUserFormat($date, $currentUser->get('date_format'));

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

                        if ($time) {

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

                        }

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

                 * Function to replace spaces with under scores.

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

                 * @param string $string

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

                 * @param <Time>               $time

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

                }

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

                {

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

                        $suffix = '';

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

                    }

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

                 *

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

                 * @param <Time> $time

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

                        $displayTime = Vtiger_Time_UIType::getTimeValueInAMorPM($displayTime);

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

                        $formatedDate = $userDate . " ($tomorrowInfo)";

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

                        $dayInfo = \App\Language::translate('LBL_' . date('D', $date));

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

                    date_default_timezone_set($default_timezone);

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

                    ];

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

                        ->andWhere(['or', ['deleted' => 1], ['status' => 'Inactive']])

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

                    if ($months < 12) {

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

                        $monthAgo = '';

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

                }

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

                    return $count . ' ' . ((1 === $count) ? \App\Language::translate("$text") : \App\Language::translate("{$text}S"));

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

                 *

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

                 *

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

                    $displayTime = $hours . ':' . $minutes;

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

                        if ($time) {

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

                    }

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

                /**

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

                 */

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

                    if ($userObject) {

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

                public static function isUserDeleted($userid)

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

                public static function formatDateDiffInStrings($dateTime)

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

                        $seconds = -($seconds);

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

                    }

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

                    $months = floor($days / 30);

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

                        return $prefix . self::pluralize($minutes, 'LBL_MINUTE') . $suffix;

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

                    }

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

                    if ($hours < 24) {

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

                    if ($days < 30) {

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

                public static function pluralize($count, $text)

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

                /**

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

                 *

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

                 *

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

                    date_default_timezone_set($adminTimeZone);

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

                }

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

                    if ('12' === $userModel->get('hour_format')) {

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

                }

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

                        if (0 !== $month) {

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

                        return $prefix . $result . $suffix;

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

                    }

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

                 * @param <Number> $count

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

                 *

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

                public static function toVtiger6SafeHTML($input)

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

                    if ('12' === $currentUser->get('hour_format')) {

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

                        $formatedDate = $userDate . " ($todayInfo)";

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

                            $dateInUserFormat = str_replace('-', '/', $dateInUserFormat);

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

                        $date = strtotime($dateInUserFormat);

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

                            $dayInfo .= ' ' . \App\Language::translate('LBL_AT') . ' ' . $displayTime;

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

                        $formatedDate = $userDate . " ($dayInfo)";

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

                public static function replaceSpaceWithUnderScores($string)

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

                        $userModel = Users_Privileges_Model::getCurrentUserModel();

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

                        ->where(['id' => $userid])

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

                /**

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

                 * @return string

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

                /**

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

                 *

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

                    $currentUser = Users_Record_Model::getCurrentUserModel();

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

                 * @return string

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

                /**

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

                 *

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

                {

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

                {

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

                    }

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

                        }

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

                /**

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

                 *

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

                 * Function to get the time value in user preferred hour format.

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

                        $userModel = Users_Privileges_Model::getInstanceFromUserObject($userObject);

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

                        $time = Vtiger_Time_UIType::getTimeValueInAMorPM($time);

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

                 * @return string

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

                    // http://www.php.net/manual/en/datetime.diff.php#101029

            Line exceeds 120 characters; contains 122 characters
            Open

                    return $count . ' ' . ((1 === $count) ? \App\Language::translate("$text") : \App\Language::translate("{$text}S"));

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

                 * @param string $input - html data

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

                 * Function to parses date into string format.

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

                    } else {

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

                public static function getBaseCurrency()

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

                public static function getDecodedValue($string)

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

                    $default_timezone = \App\Config::main('default_timezone');

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

                    $date = date('Y-m-d H:i:s');

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

                    return $date;

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

                }

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

                    return (new App\Db\Query())->from('vtiger_users')

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

                 * @param string   $text

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

                 */

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

                    $today = App\Fields\Date::formatToDisplay(date('Y-m-d H:i:s'));

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

                    if ($dateInUserFormat == $today) {

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

                            $todayInfo .= ' ' . \App\Language::translate('LBL_AT') . ' ' . $displayTime;

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

                        $tomorrowInfo = \App\Language::translate('LBL_TOMORROW');

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

                }

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

                 * @param string $string

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

                {

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

                 * @return string

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

                            $tomorrowInfo .= ' ' . \App\Language::translate('LBL_AT') . ' ' . $displayTime;

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

                 *

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

                    return html_entity_decode($string, ENT_COMPAT, 'UTF-8');

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

                 *

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

                 * @param <Vtiger_Users_Model> $userObject

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

                public static function getAllSkins()

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

                 * Function returns singular or plural text.

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

                }

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

                        if ('mm-dd-yyyy' === $currentUser->get('date_format')) {

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

                /**

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

                 *

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

                    } else {

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

                    return [

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

                {

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

                }

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

                 * Function that will strip all the tags while displaying.

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

                        }

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

                {

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

                 * @return string

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

                public static function getActiveAdminCurrentDateTime()

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

                {

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

                 * @return string time with hour format

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

                        'gray' => '#d1d1db',

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

                        ->exists();

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

                    $allowableTags = '<a><br />';

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

                public static function formatDateIntoStrings($date, $time = false)

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

                    [$hours, $minutes] = explode(':', $timeInUserFormat);

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

                    $tomorrow = App\Fields\Date::formatToDisplay(date('Y-m-d H:i:s', strtotime('tomorrow')));

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

                    return $formatedDate;

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

                }

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

                }

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

                 * @return array

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

                {

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

                    $admin = Users::getActiveAdminUser();

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

                        'blue' => '#0078d4',

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

                    return strip_tags($input, $allowableTags);

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

                 * @param <Date> $date

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

                        $todayInfo = \App\Language::translate('LBL_TODAY');

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

                 */

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

                 * Function gets the CRM's base Currency information.

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

                 */

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

                }

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

                    $adminTimeZone = $admin->time_zone;

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

                    return $time;

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

                {

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

                 */

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

                 * @return string vtiger6 displayable data

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

                    } elseif ($dateInUserFormat == $tomorrow) {

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

                    return (new \App\Db\Query())->from('vtiger_currency_info')->where(['<', 'defaultid', '0'])->one();

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

                 */

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

                {

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

                    }

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

                        'twilight' => '#404952',

            Class name "Vtiger_Util_Helper" is not in camel caps format
            Open

            class Vtiger_Util_Helper

            The variable $default_timezone is not named in camelCase.
            Open

                public static function getActiveAdminCurrentDateTime()
                {
                    $default_timezone = \App\Config::main('default_timezone');
                    $admin = Users::getActiveAdminUser();
                    $adminTimeZone = $admin->time_zone;
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.php by phpmd

            CamelCaseVariableName

            Since: 0.2

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

            Example

            class ClassName {
                public function doSomething() {
                    $data_module = new DataModule();
                }
            }

            Source

            The variable $default_timezone is not named in camelCase.
            Open

                public static function getActiveAdminCurrentDateTime()
                {
                    $default_timezone = \App\Config::main('default_timezone');
                    $admin = Users::getActiveAdminUser();
                    $adminTimeZone = $admin->time_zone;
            Severity: Minor
            Found in modules/Vtiger/helpers/Util.php by phpmd

            CamelCaseVariableName

            Since: 0.2

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

            Example

            class ClassName {
                public function doSomething() {
                    $data_module = new DataModule();
                }
            }

            Source

            There are no issues that match your filters.

            Category
            Status