Showing 271 of 271 total issues
Consider simplifying this complex logical expression. Open
if ($wants_to_drive && ! $has_license_car && ! $has_license_3_5t_transporter && ! $has_license_7_5t_truck && ! $has_license_12_5t_truck && ! $has_license_forklift) {
$ok = false;
error(_("Please select at least one driving license."));
}
Consider simplifying this complex logical expression. Open
if ($ownshift['start'] >= $shift['start'] && $ownshift['start'] < $shift['end'] || $ownshift['end'] > $shift['start'] && $ownshift['end'] <= $shift['end'] || $ownshift['start'] < $shift['start'] && $ownshift['end'] > $shift['end']) {
$collides = true;
break;
}
Consider simplifying this complex logical expression. Open
if ($shift['shifttype_id'] != $tmp['shifttype_id'] || $shift['title'] != $tmp['title'] || $shift['start'] != $tmp['start'] || $shift['end'] != $tmp['end'] || $shift['RID'] != $tmp['RID'] || $shift['URL'] != $tmp['URL'])
$shifts_updated[] = $shift;
Method form_checkbox
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function form_checkbox($name, $label, $selected, $value = 'checked', $div = true) {
Method form_multi_checkboxes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function form_multi_checkboxes($names, $label, $items, $selected, $disabled = array()) {
Method ShiftType_edit_view
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function ShiftType_edit_view($name, $angeltype_id, $angeltypes, $description, $shifttype_id) {
Method AngelType_edit_view
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function AngelType_edit_view($name, $restricted, $description, $coordinator_mode, $requires_driver_license) {
Method progress_bar
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function progress_bar($valuemin, $valuemax, $valuenow, $class = '', $content = '') {
Method bargraph
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function bargraph($id, $key, $row_names, $colors, $data) {
Method AngelType_update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function AngelType_update($angeltype_id, $name, $restricted, $description, $requires_driver_license) {
Method News_update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function News_update($eBetreff, $eText, $eTreffen, $id, $user) {
Method Room_create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function Room_create($name, $from_frab, $public, $number, $event_id) {
Function table_body
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function table_body($array) {
$html = "";
foreach ($array as $line) {
$html .= "<tr>";
if (is_array($line)) {
- Read upRead up
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
Function Other_languages_render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function Other_languages_render($user_source) {
$other_langs = explode(",", $user_source['other_languages']);
$xml = simplexml_load_file("https://www.facebook.com/translations/FacebookLocales.xml");
$list = "";
foreach($xml->xpath("/locales/locale") as $item)
- Read upRead up
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
Function template_render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function template_render($file, $data) {
if (file_exists($file)) {
$template = file_get_contents($file);
if (is_array($data))
foreach ($data as $name => $content) {
- Read upRead up
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
Function user_angeltypes_delete_all_controller
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function user_angeltypes_delete_all_controller() {
global $user, $privileges;
if (! isset($_REQUEST['angeltype_id'])) {
error(_("Angeltype doesn't exist."));
- Read upRead up
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
Function user_atom
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function user_atom() {
global $ical_shifts, $user, $DISPLAY_NEWS;
if (isset ($_REQUEST['key']) && preg_match("/^[0-9a-f]{32}$/", $_REQUEST['key']))
$key = $_REQUEST['key'];
- Read upRead up
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
Function angeltype_controller
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function angeltype_controller() {
global $privileges, $user;
if (! in_array('angeltypes', $privileges))
redirect('?');
- Read upRead up
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
Function make_navigation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function make_navigation() {
global $p, $privileges;
$menu = array();
$pages = array(
- Read upRead up
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
Function Shift_collides
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function Shift_collides($shift, $shifts) {
foreach ($shifts as $other_shift)
if ($shift['SID'] != $other_shift['SID'])
if (! ($shift['start'] >= $other_shift['end'] || $shift['end'] <= $other_shift['start']))
return true;
- Read upRead up
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"