fossasia/engelsystem

View on GitHub

Showing 198 of 271 total issues

Method bargraph has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function bargraph($id, $key, $row_names, $colors, $data) {
Severity: Minor
Found in includes/helper/graph_helper.php - About 35 mins to fix

    Method AngelType_update has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function AngelType_update($angeltype_id, $name, $restricted, $description, $requires_driver_license) {
    Severity: Minor
    Found in includes/model/AngelType_model.php - About 35 mins to fix

      Method News_update has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function News_update($eBetreff, $eText, $eTreffen, $id, $user) {
      Severity: Minor
      Found in includes/model/News_model.php - About 35 mins to fix

        Method Room_create has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function Room_create($name, $from_frab, $public, $number, $event_id) {
        Severity: Minor
        Found in includes/model/Room_model.php - About 35 mins to fix

          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)) {
          Severity: Minor
          Found in includes/sys_template.php - About 35 mins to fix

          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)
          Severity: Minor
          Found in includes/view/User_view.php - About 35 mins to fix

          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) {
          Severity: Minor
          Found in includes/sys_template.php - About 35 mins to fix

          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."));
          Severity: Minor
          Found in includes/controller/user_angeltypes_controller.php - About 35 mins to fix

          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'];
          Severity: Minor
          Found in includes/controller/user_atom_controller.php - About 35 mins to fix

          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('?');
          Severity: Minor
          Found in includes/controller/angeltypes_controller.php - About 35 mins to fix

          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(
          Severity: Minor
          Found in includes/sys_menu.php - About 35 mins to fix

          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;
          Severity: Minor
          Found in includes/model/Shifts_model.php - About 35 mins to fix

          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 success has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function success($msg, $immediatly = false) {
            if ($immediatly) {
              if ($msg == "")
                return "";
              return '<div class="alert alert-success">' . $msg . '</div>';
          Severity: Minor
          Found in includes/helper/message_helper.php - About 35 mins to fix

          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 error has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function error($msg, $immediatly = false) {
            if ($immediatly) {
              if ($msg == "")
                return "";
              return '<div class="alert alert-danger">' . $msg . '</div>';
          Severity: Minor
          Found in includes/helper/message_helper.php - About 35 mins to fix

          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 ShiftEntry_edit_view has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function ShiftEntry_edit_view($angel, $date, $location, $title, $type, $comment, $freeloaded, $freeload_comment, $user_admin_shifts = false) {
            if ($user_admin_shifts) {
              $freeload_form = array(
                  form_checkbox('freeloaded', _("Freeloaded"), $freeloaded),
                  form_textarea('freeload_comment', _("Freeload comment (Only for shift coordination):"), $freeload_comment) 
          Severity: Minor
          Found in includes/view/ShiftEntry_view.php - About 35 mins to fix

          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 NeededAngelTypes_by_shift has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function NeededAngelTypes_by_shift($shiftId) {
            $needed_angeltypes_source = sql_select("
                  SELECT `NeededAngelTypes`.*, `AngelTypes`.`name`, `AngelTypes`.`restricted`
                  FROM `NeededAngelTypes`
                  JOIN `AngelTypes` ON `AngelTypes`.`id` = `NeededAngelTypes`.`angel_type_id`
          Severity: Minor
          Found in includes/model/NeededAngelTypes_model.php - About 35 mins to fix

          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 info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function info($msg, $immediatly = false) {
            if ($immediatly) {
              if ($msg == "")
                return "";
              return '<div class="alert alert-info">' . $msg . '</div>';
          Severity: Minor
          Found in includes/helper/message_helper.php - About 35 mins to fix

          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 too many return statements within this method.
          Open

                    return error(_("Transmitting was terminated with an Error."), true);
          Severity: Major
          Found in includes/controller/user_messages_controller.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                      return error("No question found.", true);
            Severity: Major
            Found in includes/controller/admin_questions_controller.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return error(_("Wrong action."), true);
              Severity: Major
              Found in includes/controller/user_messages_controller.php - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language