Showing 198 of 271 total issues
Method admin_log
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function admin_log() {
global $user;
$timezone_identifiers = DateTimeZone::listIdentifiers();
$timezone = $user['timezone'];
date_default_timezone_set ("$timezone_identifiers[$timezone]");
Method user_angeltypes_delete_all_controller
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function user_angeltypes_delete_all_controller() {
global $user, $privileges;
if (! isset($_REQUEST['angeltype_id'])) {
error(_("Angeltype doesn't exist."));
Function user_controller
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function user_controller() {
global $privileges, $user;
if (isset($_REQUEST['user_id'])) {
$user_source = User($_REQUEST['user_id']);
- 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_meetings
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function user_meetings() {
global $DISPLAY_NEWS, $privileges, $user;
$html = '<div class="col-md-12"><h1>' . meetings_title() . '</h1>' . msg();
- 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_news_comments
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function user_news_comments() {
global $user;
$html = '<div class="col-md-12"><h1>' . user_news_comments_title() . '</h1>';
if (isset($_REQUEST["nid"]) && preg_match("/^[0-9]{1,}$/", $_REQUEST['nid']) && count_news_by_id($_REQUEST['nid']) > 0) {
- 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_confirm_all_controller
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function user_angeltypes_confirm_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
Method User_insert
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function User_insert($nick, $prename, $lastname, $age, $tel, $dect, $mobile, $mail, $email_shiftinfo, $jabber, $tshirt_size, $password_hash, $comment, $hometown, $twitter, $facebook, $github, $organization, $organization_web, $timezone, $planned_arrival_date) {
return sql_query("
INSERT INTO `User` SET
`Nick`='" . sql_escape($nick) . "',
`Vorname`='" . sql_escape($prename) . "',
Method Users_view
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function Users_view($users, $order_by, $arrived_count, $active_count, $force_active_count, $freeloads_count, $tshirts_count, $voucher_count) {
Method AngelType_view
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function AngelType_view($angeltype, $members, $user_angeltype, $admin_user_angeltypes, $admin_angeltypes, $coordinator, $user_driver_license, $user) {
Method event_create
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function event_create($name, $description, $organizer, $start_date, $start_time, $end_date, $end_time, $venue) {
Method UserDriverLicense_edit_view
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function UserDriverLicense_edit_view($user_source, $wants_to_drive, $has_car, $has_license_car, $has_license_3_5t_transporter, $has_license_7_5t_truck, $has_license_12_5t_truck, $has_license_forklift) {
Function mail_shift_change
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function mail_shift_change($old_shift, $new_shift) {
$users = ShiftEntries_by_shift($old_shift["SID"]);
$old_room = Room($old_shift["RID"]);
$new_room = Room($new_shift["RID"]);
- 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
Method User_view
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function User_view($user_source, $admin_user_privilege, $freeloader, $user_angeltypes, $user_groups, $shifts, $its_me) {
Method UserDriverLicenses_create
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function UserDriverLicenses_create($user_id, $has_car, $has_license_car, $has_license_3_5t_transporter, $has_license_7_5t_truck, $has_license_12_5t_truck, $has_license_forklift) {
Method UserDriverLicenses_update
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function UserDriverLicenses_update($user_id, $has_car, $has_license_car, $has_license_3_5t_transporter, $has_license_7_5t_truck, $has_license_12_5t_truck, $has_license_forklift) {
Function form_multi_checkboxes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function form_multi_checkboxes($names, $label, $items, $selected, $disabled = array()) {
$html = "<table><thead><tr>";
foreach ($names as $title)
$html .= "<th>$title</th>";
$html .= "</tr></thead><tbody>";
- 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
Avoid deeply nested control flow statements. Open
if ($angeltype === false)
engelsystem_error("Unable to load angeltype.");
Avoid deeply nested control flow statements. Open
if ($id === false)
engelsystem_error("Unable to create room.");
Avoid deeply nested control flow statements. Open
if ($entry['freeloaded']) {
$freeloader ++;
$style = " text-decoration: line-through;";
}
Avoid deeply nested control flow statements. Open
if (in_array('user_shifts_admin', $privileges))
$shifts_row .= ' ' . button(page_link_to('user_shifts') . '&shift_id=' . $shift['SID'] . '&type_id=' . $angeltype['id'], _("Add more angels"), 'btn-xs');