Showing 699 of 699 total issues
The function iso_field_formatter_view() has a Cyclomatic Complexity of 37. The configured cyclomatic complexity threshold is 10. Open
function iso_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$element = array();
$settings = $display['settings'];
switch ($display['type']) {
- 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 deims_data_explorer_get_query_from_data_source() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
function deims_data_explorer_get_query_from_data_source($node, array $columns = array(), array $filters = array()) {
if ($node->type == 'data_source' && $connection = field_get_items('node', $node, DEIMS_DATA_EXPLORER_FIELD)) {
if (!empty($connection[0]['connection']) && !empty($connection[0]['table'])) {
try {
// Database::getConnection() could throw an exception so catch it and
- 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
template_preprocess_eml accesses the super-global variable $GLOBALS. Open
function template_preprocess_eml(&$variables, $hook) {
$variables['entity'] = $variables['elements']['#entity'];
$entity = $variables['entity'];
$entity_type = $variables['elements']['#entity_type'];
$bundle = $variables['elements']['#bundle'];
- 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 bdp_field_formatter_view() has a Cyclomatic Complexity of 48. The configured cyclomatic complexity threshold is 10. Open
function bdp_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$element = array();
$settings = $display['settings'];
switch ($display['type']) {
- 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 deims_data_explorer_filters_apply() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
function deims_data_explorer_filters_apply(QueryAlterableInterface $query, array $filters) {
foreach ($filters as $key => $filter) {
switch ($filter['variable']['type']) {
case '';
if (drupal_strlen($filter['value'])) {
- 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
deims_data_explorer_download accesses the super-global variable $_GET. Open
function deims_data_explorer_download($node, $file) {
if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], $_GET['q'])) {
return MENU_ACCESS_DENIED;
}
- 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
deims_variable_search_autocomplete accesses the super-global variable $GLOBALS. Open
function deims_variable_search_autocomplete($field_name, $entity_type) {
$term = $_GET['term'];
$limit = 10;
$matches = array();
$field = field_info_field($field_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
deims_data_explorer_download accesses the super-global variable $_GET. Open
function deims_data_explorer_download($node, $file) {
if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], $_GET['q'])) {
return MENU_ACCESS_DENIED;
}
- 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
deims_variable_remove_js accesses the super-global variable $_POST. Open
function deims_variable_remove_js() {
require_once DRUPAL_ROOT . '/includes/form.inc';
// drupal_html_id() very helpfully ensures that all html IDS are unique
// on a page. Unfortunately what it doesn't realize is that the IDs
- 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 eml_field_formatter_view() has a Cyclomatic Complexity of 39. The configured cyclomatic complexity threshold is 10. Open
function eml_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$element = array();
$settings = $display['settings'];
switch ($display['type']) {
- 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
Spaces must be used to indent lines; tabs are not allowed Open
</gmd:otherConstraints>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
</gmd:MD_LegalConstraints>
- Exclude checks
Whitespace found at end of line Open
),
- Exclude checks
Whitespace found at end of line Open
* @param array $options
- Exclude checks
Whitespace found at end of line Open
$query->range($context['sandbox']['progress'], 5);
- Exclude checks
Whitespace found at end of line Open
* @param array $context
- Exclude checks
Whitespace found at end of line Open
return $value['name']; },
- Exclude checks
Whitespace found at end of line Open
$handler->display->display_options['cache']['output_lifespan_custom'] = '0';
- Exclude checks
Whitespace found at end of line Open
* @return array
- Exclude checks
Whitespace found at end of line Open
$attribute['gfc:FC_FeatureAttribute'] = array();
- Exclude checks