Showing 1,940 of 1,940 total issues
test_case_current accesses the super-global variable $GLOBALS. Open
function &test_case_current()
{
$name = $GLOBALS["limonade"]["test_case_current"];
return $GLOBALS["limonade"]["test_cases"][$name];
}
- 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
test_run_assertion accesses the super-global variable $GLOBALS. Open
function test_run_assertion()
{
$name = $GLOBALS["limonade"]["test_case_current"];
$GLOBALS["limonade"]["test_cases"][$name]['assertions']++;
test_call_func(test_before_assert_func_name());
- 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
test_assert_failure accesses the super-global variable $GLOBALS. Open
function test_assert_failure($script, $line, $message)
{
// Using the stack trace, find the outermost assert*() call
$stacktrace = array_slice(debug_backtrace(), 1); // skip self
$assertion = reset($stacktrace);
- 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
test_case accesses the super-global variable $GLOBALS. Open
function test_case($name)
{
$name = strtolower($name); // TODO: normalize name
if(!array_key_exists($name, $GLOBALS["limonade"]["test_cases"]))
- 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
end_test_case accesses the super-global variable $GLOBALS. Open
function end_test_case()
{
$name = $GLOBALS["limonade"]["test_case_current"];
echo "## ".strtoupper($name)."\n";
- 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
Dojo_Create_add accesses the super-global variable $_POST. Open
function Dojo_Create_add()
{
if (!Validate_form($_POST) ) {
$resp = recaptcha_check_answer(
option('recaptcha_private_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
The function Validate_field() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. Open
function Validate_field($data, $type)
{
// This function checks fields and returns the number of errors found.
// Check if the parameters have been sent.
//if(!$data or !$type) { return 1;}
- 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
Dojo_Create_add accesses the super-global variable $_POST. Open
function Dojo_Create_add()
{
if (!Validate_form($_POST) ) {
$resp = recaptcha_check_answer(
option('recaptcha_private_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
Dojo_Create_add accesses the super-global variable $_SERVER. Open
function Dojo_Create_add()
{
if (!Validate_form($_POST) ) {
$resp = recaptcha_check_answer(
option('recaptcha_private_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
Dojo_Create_add accesses the super-global variable $_POST. Open
function Dojo_Create_add()
{
if (!Validate_form($_POST) ) {
$resp = recaptcha_check_answer(
option('recaptcha_private_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
Dojo_Create_add accesses the super-global variable $_POST. Open
function Dojo_Create_add()
{
if (!Validate_form($_POST) ) {
$resp = recaptcha_check_answer(
option('recaptcha_private_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
Dojo_Editform_end accesses the super-global variable $_POST. Open
function Dojo_Editform_end()
{
if (!Validate_form($_POST) ) {
$resp = recaptcha_check_answer(
option('recaptcha_private_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
test_case_current accesses the super-global variable $GLOBALS. Open
function &test_case_current()
{
$name = $GLOBALS["limonade"]["test_case_current"];
return $GLOBALS["limonade"]["test_cases"][$name];
}
- 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
Dojo_Delete_end accesses the super-global variable $_POST. Open
function Dojo_Delete_end()
{
if ($_POST["recaptcha_response_field"] ) {
$Dojo_Name = params('dojo');
Delete_dojo($Dojo_Name);
- 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
end_test_suite accesses the super-global variable $GLOBALS. Open
function end_test_suite()
{
$name = $GLOBALS["limonade"]["test_suites"];
$failures = 0;
$tests = 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
assert_trigger_error accesses the super-global variable $GLOBALS. Open
function assert_trigger_error($callable, $args = array(), $message = '<1> should trigger an error') {
test_run_assertion();
$trigger_errors = count($GLOBALS["limonade"]["test_errors"]);
set_error_handler("test_error_handler");
$result = call_user_func_array($callable, $args);
- 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
geoAddress accesses the super-global variable $_SERVER. Open
function geoAddress($address = null)
{
//Three parts to the querystring: q is address, output is the format (
$lat = null;
$lng = null;
- 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
test_case accesses the super-global variable $GLOBALS. Open
function test_case($name)
{
$name = strtolower($name); // TODO: normalize name
if(!array_key_exists($name, $GLOBALS["limonade"]["test_cases"]))
- 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
test_assert_failure accesses the super-global variable $GLOBALS. Open
function test_assert_failure($script, $line, $message)
{
// Using the stack trace, find the outermost assert*() call
$stacktrace = array_slice(debug_backtrace(), 1); // skip self
$assertion = reset($stacktrace);
- 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
test_case_all_func accesses the super-global variable $GLOBALS. Open
function test_case_all_func()
{
$functions = get_defined_functions();
$functions = $functions['user'];
$tests = array();
- 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'];
}
}