Showing 149 of 149 total issues
get accesses the super-global variable $_COOKIE. Open
public static function get($cookieName = null)
{
if($cookieName == null)
{
return $_COOKIE;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
ADO accesses the super-global variable $_ENV. Open
public static function ADO()
{
$db = ADONewConnection($_ENV['DB_ADO_DRIVER']);
$db->connect($_ENV['DB_SERVER'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']);
return $db;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Crypto accesses the super-global variable $_ENV. Open
public static function Crypto($inData, $opt="D")
{
$outData="";
$iv = "r@nD0mKey#osekj%^876ghjkjb5dDdf8";
if($opt=='E')
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
ADO accesses the super-global variable $_ENV. Open
public static function ADO()
{
$db = ADONewConnection($_ENV['DB_ADO_DRIVER']);
$db->connect($_ENV['DB_SERVER'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']);
return $db;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
generateToken accesses the super-global variable $_SESSION. Open
public function generateToken()
{
if(function_exists('mcrypt_create_iv'))
{
$_SESSION['csrf_token'] = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM));
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
The method selectionQueryMaker() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10. Open
protected function selectionQueryMaker()
{
$this->query = 'SELECT '.$this->selects.' FROM '.$this->table;
$where="";
$flag = 0;
- Read upRead up
- Exclude checks
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
ErrorHandler accesses the super-global variable $_ENV. Open
function ErrorHandler($errno, $errstr, $errfile, $errline)
{
if (!(error_reporting() & $errno))
{
return;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
generateToken accesses the super-global variable $_SESSION. Open
public function generateToken()
{
if(function_exists('mcrypt_create_iv'))
{
$_SESSION['csrf_token'] = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM));
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
verifyToken accesses the super-global variable $_POST. Open
public function verifyToken()
{
if(isset($_POST['csrf_token']) && !empty($_POST['csrf_token']) && isset($_SESSION['csrf_token']))
{
if(hash_equals($_SESSION['csrf_token'], $_POST['csrf_token']))
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
verifyToken accesses the super-global variable $_POST. Open
public function verifyToken()
{
if(isset($_POST['csrf_token']) && !empty($_POST['csrf_token']) && isset($_SESSION['csrf_token']))
{
if(hash_equals($_SESSION['csrf_token'], $_POST['csrf_token']))
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
GiveError accesses the super-global variable $_ENV. Open
public static function GiveError($errorCode, $errorMessage)
{
if($errorCode==400)
{
header("HTTP/1.0 400 Bad Request");
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
delete accesses the super-global variable $_SERVER. Open
public static function delete($cookieName = null)
{
if($cookieName == null)
{
if (isset($_SERVER['HTTP_COOKIE']))
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
ADO accesses the super-global variable $_ENV. Open
public static function ADO()
{
$db = ADONewConnection($_ENV['DB_ADO_DRIVER']);
$db->connect($_ENV['DB_SERVER'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']);
return $db;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
__construct accesses the super-global variable $_ENV. Open
protected function __construct()
{
$this->dsn=$_ENV['DB_TYPE'].':dbname='.$_ENV['DB_NAME'].';host='.$_ENV['DB_SERVER'].';port='.$_ENV['DB_PORT'].';charset='.$_ENV['DB_CHARSET'];
try
{
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
generateToken accesses the super-global variable $_SESSION. Open
public function generateToken()
{
if(function_exists('mcrypt_create_iv'))
{
$_SESSION['csrf_token'] = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM));
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
view accesses the super-global variable $_ENV. Open
public static function view($view, $arrayParams = [], $exit = false)
{
$loader = new Twig_Loader_Filesystem(__DIR__.'/../../Views');
$cache = __DIR__.'/../../Storage/Cache/Views';
if(!$_ENV['cache_template'])
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
get accesses the super-global variable $_COOKIE. Open
public static function get($cookieName = null)
{
if($cookieName == null)
{
return $_COOKIE;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
ADO accesses the super-global variable $_ENV. Open
public static function ADO()
{
$db = ADONewConnection($_ENV['DB_ADO_DRIVER']);
$db->connect($_ENV['DB_SERVER'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']);
return $db;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
init accesses the super-global variable $_ENV. Open
private static function init()
{
$session_factory = new SessionFactory;
$session = $session_factory->newInstance($_COOKIE);
$session->setCookieParams(array('lifetime' => $_ENV['session_life']));
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
GenerateAPIKey accesses the super-global variable $_ENV. Open
public static function GenerateAPIKey($digestString)
{
$digestString.='|'.$_ENV['app_key'].'|'.microtime(true);
$hash = hash_hmac('sha1', $digestString, microtime(true), false);
return $hash;
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}