qcubed/framework

View on GitHub
includes/framework/QDbBackedSessionHandler.class.php

Summary

Maintainability
B
5 hrs
Test Coverage

Function SessionRead has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

        public static function SessionRead($strSessionId) {
            $objDatabase    = QApplication::$Database[self::$intDbIndex];
            $query            = '
                SELECT
                    ' . $objDatabase->EscapeIdentifier('data') . '
Severity: Minor
Found in includes/framework/QDbBackedSessionHandler.class.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 SessionRead has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public static function SessionRead($strSessionId) {
            $objDatabase    = QApplication::$Database[self::$intDbIndex];
            $query            = '
                SELECT
                    ' . $objDatabase->EscapeIdentifier('data') . '
Severity: Minor
Found in includes/framework/QDbBackedSessionHandler.class.php - About 1 hr to fix

    Method SessionWrite has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public static function SessionWrite($strSessionId, $strSessionData) {
                if (empty($strSessionData)) {
                    static::SessionDestroy($strSessionId);
                    return true;
                }
    Severity: Minor
    Found in includes/framework/QDbBackedSessionHandler.class.php - About 1 hr to fix

      Function SessionWrite has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

              public static function SessionWrite($strSessionId, $strSessionData) {
                  if (empty($strSessionData)) {
                      static::SessionDestroy($strSessionId);
                      return true;
                  }
      Severity: Minor
      Found in includes/framework/QDbBackedSessionHandler.class.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

      The method SessionRead() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
      Open

              public static function SessionRead($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      SELECT
                          ' . $objDatabase->EscapeIdentifier('data') . '

      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 SessionRead() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
      Open

              public static function SessionRead($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      SELECT
                          ' . $objDatabase->EscapeIdentifier('data') . '

      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

      Avoid using undefined variables such as '$Database' which will lead to PHP notices.
      Open

                  $objDatabase    = QApplication::$Database[self::$intDbIndex];

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Avoid using undefined variables such as '$Database' which will lead to PHP notices.
      Open

                  if (!isset(QApplication::$Database[self::$intDbIndex]) ) {

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Avoid using undefined variables such as '$Database' which will lead to PHP notices.
      Open

                  $objDatabase    = QApplication::$Database[self::$intDbIndex];

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Avoid using undefined variables such as '$Database' which will lead to PHP notices.
      Open

                  $objDatabase    = QApplication::$Database[self::$intDbIndex];

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Avoid using undefined variables such as '$Database' which will lead to PHP notices.
      Open

                  $objDatabase    = QApplication::$Database[self::$intDbIndex];

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Avoid using undefined variables such as '$Database' which will lead to PHP notices.
      Open

                  $objDatabase    = QApplication::$Database[self::$intDbIndex];

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Missing class import via use statement (line '162', column '16').
      Open

                          throw new QCallerException('pg_unescape_bytea method needed for DbBackedSessionHandler to operate on a PostgreSQL database. Please install the "pgsql" PHP extension.');

      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 '101', column '15').
      Open

                      throw new QCallerException("session_set_save_handler function failed");

      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 '181', column '19').
      Open

                          $crypt = new QCryptography(DB_BACKED_SESSION_HANDLER_ENCRYPTION_KEY, false, null, DB_BACKED_SESSION_HANDLER_HASH_KEY);

      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 '82', column '15').
      Open

                      throw new QCallerException('No database defined at DB_CONNECTION index ' . self::$intDbIndex . '. Correct your settings in configuration.inc.php.');

      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 '251', column '16').
      Open

                          throw new Exception ("Base64 Encoding Failed on " . $strSessionData);

      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 '174', column '16').
      Open

                          throw new Exception("Failed decoding formstate " . $strData);

      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 '241', column '20').
      Open

                          $crypt        = new QCryptography(DB_BACKED_SESSION_HANDLER_ENCRYPTION_KEY, false, null, DB_BACKED_SESSION_HANDLER_HASH_KEY);

      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 'QType' in method 'Initialize'.
      Open

                  self::$strTableName = QType::Cast($strTableName, QType::String);

      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 SessionWrite uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                      else {
                          $strEncoded = $encoded;
                      }

      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

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

                      } else {
                          throw new QCallerException('pg_unescape_bytea method needed for DbBackedSessionHandler to operate on a PostgreSQL database. Please install the "pgsql" PHP extension.');
                      }

      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 'QType' in method 'Initialize'.
      Open

                  self::$intDbIndex    = QType::Cast($intDbIndex, QType::Integer);

      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 empty try-catch blocks in SessionWrite.
      Open

                      catch(Exception $e) {
                      }

      EmptyCatchBlock

      Since: 2.7.0

      Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

      Example

      class Foo {
      
        public function bar()
        {
            try {
                // ...
            } catch (Exception $e) {} // empty catch block
        }
      }

      Source https://phpmd.org/rules/design.html#emptycatchblock

      Avoid unused parameters such as '$save_path'.
      Open

              public static function SessionOpen($save_path, $session_name) {

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

      Avoid using empty try-catch blocks in SessionRead.
      Open

                      catch(Exception $e) {
                      }

      EmptyCatchBlock

      Since: 2.7.0

      Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

      Example

      class Foo {
      
        public function bar()
        {
            try {
                // ...
            } catch (Exception $e) {} // empty catch block
        }
      }

      Source https://phpmd.org/rules/design.html#emptycatchblock

      Avoid excessively long variable names like $intMaxSessionLifetime. Keep variable name length under 20.
      Open

              public static function SessionGarbageCollect($intMaxSessionLifetime) {

      LongVariable

      Since: 0.2

      Detects when a field, formal or local variable is declared with a long name.

      Example

      class Something {
          protected $reallyLongIntName = -3; // VIOLATION - Field
          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
              $otherReallyLongName = -5; // VIOLATION - Local
              for ($interestingIntIndex = 0; // VIOLATION - For
                   $interestingIntIndex < 10;
                   $interestingIntIndex++ ) {
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#longvariable

      The parameter $save_path is not named in camelCase.
      Open

              public static function SessionOpen($save_path, $session_name) {
                  self::$strSessionName = $session_name;
                  // Nothing to do
                  return true;
              }

      CamelCaseParameterName

      Since: 0.2

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

      Example

      class ClassName {
          public function doSomething($user_name) {
          }
      }

      Source

      The parameter $session_name is not named in camelCase.
      Open

              public static function SessionOpen($save_path, $session_name) {
                  self::$strSessionName = $session_name;
                  // Nothing to do
                  return true;
              }

      CamelCaseParameterName

      Since: 0.2

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

      Example

      class ClassName {
          public function doSomething($user_name) {
          }
      }

      Source

      The variable $session_ok is not named in camelCase.
      Open

              public static function Initialize($intDbIndex = 1, $strTableName = "qc_session") {
                  self::$intDbIndex    = QType::Cast($intDbIndex, QType::Integer);
                  self::$strTableName = QType::Cast($strTableName, QType::String);
                  // If the database index exists
                  if (!isset(QApplication::$Database[self::$intDbIndex]) ) {

      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 $session_name is not named in camelCase.
      Open

              public static function SessionOpen($save_path, $session_name) {
                  self::$strSessionName = $session_name;
                  // Nothing to do
                  return true;
              }

      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 $result_row is not named in camelCase.
      Open

              public static function SessionRead($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      SELECT
                          ' . $objDatabase->EscapeIdentifier('data') . '

      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 $Database is not named in camelCase.
      Open

              public static function SessionExists($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      SELECT 1
                      FROM

      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 $Database is not named in camelCase.
      Open

              public static function SessionGarbageCollect($intMaxSessionLifetime) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $old            = time() - $intMaxSessionLifetime;
      
                  $query            = '

      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 $session_ok is not named in camelCase.
      Open

              public static function Initialize($intDbIndex = 1, $strTableName = "qc_session") {
                  self::$intDbIndex    = QType::Cast($intDbIndex, QType::Integer);
                  self::$strTableName = QType::Cast($strTableName, QType::String);
                  // If the database index exists
                  if (!isset(QApplication::$Database[self::$intDbIndex]) ) {

      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 $result_row is not named in camelCase.
      Open

              public static function SessionExists($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      SELECT 1
                      FROM

      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 $result_row is not named in camelCase.
      Open

              public static function SessionExists($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      SELECT 1
                      FROM

      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 $result_row is not named in camelCase.
      Open

              public static function SessionRead($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      SELECT
                          ' . $objDatabase->EscapeIdentifier('data') . '

      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 $Database is not named in camelCase.
      Open

              public static function SessionDestroy($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      DELETE FROM
                          ' . $objDatabase->EscapeIdentifier(self::$strTableName) . '

      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 $Database is not named in camelCase.
      Open

              public static function SessionWrite($strSessionId, $strSessionData) {
                  if (empty($strSessionData)) {
                      static::SessionDestroy($strSessionId);
                      return true;
                  }

      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 $session_ok is not named in camelCase.
      Open

              public static function Initialize($intDbIndex = 1, $strTableName = "qc_session") {
                  self::$intDbIndex    = QType::Cast($intDbIndex, QType::Integer);
                  self::$strTableName = QType::Cast($strTableName, QType::String);
                  // If the database index exists
                  if (!isset(QApplication::$Database[self::$intDbIndex]) ) {

      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 $result_row is not named in camelCase.
      Open

              public static function SessionRead($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      SELECT
                          ' . $objDatabase->EscapeIdentifier('data') . '

      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 $Database is not named in camelCase.
      Open

              public static function Initialize($intDbIndex = 1, $strTableName = "qc_session") {
                  self::$intDbIndex    = QType::Cast($intDbIndex, QType::Integer);
                  self::$strTableName = QType::Cast($strTableName, QType::String);
                  // If the database index exists
                  if (!isset(QApplication::$Database[self::$intDbIndex]) ) {

      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 $Database is not named in camelCase.
      Open

              public static function SessionRead($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      SELECT
                          ' . $objDatabase->EscapeIdentifier('data') . '

      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 method SessionExists is not named in camelCase.
      Open

              public static function SessionExists($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      SELECT 1
                      FROM

      CamelCaseMethodName

      Since: 0.2

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

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method SessionDestroy is not named in camelCase.
      Open

              public static function SessionDestroy($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      DELETE FROM
                          ' . $objDatabase->EscapeIdentifier(self::$strTableName) . '

      CamelCaseMethodName

      Since: 0.2

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

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method SessionGarbageCollect is not named in camelCase.
      Open

              public static function SessionGarbageCollect($intMaxSessionLifetime) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $old            = time() - $intMaxSessionLifetime;
      
                  $query            = '

      CamelCaseMethodName

      Since: 0.2

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

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method SessionClose is not named in camelCase.
      Open

              public static function SessionClose() {
                  // Nothing to do.
                  return true;
              }

      CamelCaseMethodName

      Since: 0.2

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

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method SessionWrite is not named in camelCase.
      Open

              public static function SessionWrite($strSessionId, $strSessionData) {
                  if (empty($strSessionData)) {
                      static::SessionDestroy($strSessionId);
                      return true;
                  }

      CamelCaseMethodName

      Since: 0.2

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

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method SessionOpen is not named in camelCase.
      Open

              public static function SessionOpen($save_path, $session_name) {
                  self::$strSessionName = $session_name;
                  // Nothing to do
                  return true;
              }

      CamelCaseMethodName

      Since: 0.2

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

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method SessionRead is not named in camelCase.
      Open

              public static function SessionRead($strSessionId) {
                  $objDatabase    = QApplication::$Database[self::$intDbIndex];
                  $query            = '
                      SELECT
                          ' . $objDatabase->EscapeIdentifier('data') . '

      CamelCaseMethodName

      Since: 0.2

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

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method Initialize is not named in camelCase.
      Open

              public static function Initialize($intDbIndex = 1, $strTableName = "qc_session") {
                  self::$intDbIndex    = QType::Cast($intDbIndex, QType::Integer);
                  self::$strTableName = QType::Cast($strTableName, QType::String);
                  // If the database index exists
                  if (!isset(QApplication::$Database[self::$intDbIndex]) ) {

      CamelCaseMethodName

      Since: 0.2

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

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method GetFullSessionId is not named in camelCase.
      Open

              private static function GetFullSessionId($strSessionId) {
                  return self::$strSessionName.'.'.$strSessionId;
              }

      CamelCaseMethodName

      Since: 0.2

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

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      There are no issues that match your filters.

      Category
      Status