Showing 1,940 of 1,940 total issues
The function render() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. Open
function render($content_or_func, $layout = '', $locals = array())
{
$args = func_get_args();
$content_or_func = array_shift($args);
$layout = count($args) > 0 ? array_shift($args) : layout();
- 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
flash_sweep accesses the super-global variable $_SESSION. Open
function flash_sweep()
{
if(defined('SID'))
{
$fkey = LIM_SESSION_FLASH_KEY;
- 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
flash_now accesses the super-global variable $_SESSION. Open
function flash_now($name = null, $value = null)
{
static $messages = null;
if(is_null($messages))
{
- 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
env accesses the super-global variable $_FILES. Open
function env($reset = null)
{
static $env = array();
if(func_num_args() > 0)
{
- 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
env accesses the super-global variable $_ENV. Open
function env($reset = null)
{
static $env = array();
if(func_num_args() > 0)
{
- 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
env accesses the super-global variable $GLOBALS. Open
function env($reset = null)
{
static $env = array();
if(func_num_args() > 0)
{
- 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
env accesses the super-global variable $_SERVER. Open
function env($reset = null)
{
static $env = array();
if(func_num_args() > 0)
{
- 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
env accesses the super-global variable $GLOBALS. Open
function env($reset = null)
{
static $env = array();
if(func_num_args() > 0)
{
- 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
env accesses the super-global variable $GLOBALS. Open
function env($reset = null)
{
static $env = array();
if(func_num_args() > 0)
{
- 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 function route_build() has a Cyclomatic Complexity of 18. The configured cyclomatic complexity threshold is 10. Open
function route_build($method, $path_or_array, $callback, $options = array())
{
$method = strtoupper($method);
if(!in_array($method, request_methods()))
trigger_error("'$method' request method is unkown or unavailable.", E_USER_WARNING);
- 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
The function recaptcha_check_answer() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
function recaptcha_check_answer($privkey, $remoteip, $challenge, $response, $extra_params = array())
{
if ($privkey == null || $privkey == '') {
die("To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>");
}
- 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
env accesses the super-global variable $_POST. Open
function env($reset = null)
{
static $env = array();
if(func_num_args() > 0)
{
- 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
env accesses the super-global variable $GLOBALS. Open
function env($reset = null)
{
static $env = array();
if(func_num_args() > 0)
{
- 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
Heading (h2) has already been defined. Open
h1,h2,h3,h4,h5,h6 {
- Exclude checks
Rule is empty. Open
blockquote { }
- Exclude checks
Values of 0 shouldn't have units specified. Open
padding: 0px 0px 0px 5px;
- Exclude checks
Don't use IDs in selectors. Open
#sidebar ul {
- Exclude checks
Heading (h3) has already been defined. Open
h1,h2,h3,h4,h5,h6 {
- Exclude checks
Element (li.alt) is overqualified, just use .alt without element name. Open
.list1 li.alt img {
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
#menu a {
- Exclude checks