theblackwidower/CICE-Scheduler

View on GitHub

Showing 62 of 105 total issues

File wordlist.php has 3913 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/*
English worldlist sourced from http://wordlist.aspell.net/ file: english-words.10
Removed one and two-letter words, as well as words with apostrophies.
Severity: Major
Found in Website/modules/functions/wordlist.php - About 1 wk to fix

    Function display_search_results has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
    Open

    function display_search_results($id, $results, $extra_info = null)
    {
        echo '<div class="search_results">';
        if (sizeof($results) > 0)
        {
    Severity: Minor
    Found in Website/modules/functions/lists.php - About 2 days 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 form_ajax_search has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
    Open

    function form_ajax_search($id)
    {
        echo '
        <form id="ajax_search" onsubmit="return false;">
            <label for="search_box">Search</label>
    Severity: Minor
    Found in Website/modules/functions/forms.php - About 1 day 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

    File help.php has 722 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    require_once "../modules/constants.php";
    $restrictionCode = PUBLIC_ACCESS;
    require_once "../modules/init.php";
    
    
    Severity: Major
    Found in Website/ajax/help.php - About 1 day to fix

      Function auto_complete_keyboard_controls has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
      Open

      function auto_complete_keyboard_controls(event)
      {
          var autoCompleteBox = event.currentTarget.parentNode.getElementsByClassName('auto_complete_box')[0];
          var selected = document.getElementById('auto_complete_selected');
          if (event.key === "Tab" || event.keyCode === 9 ||
      Severity: Minor
      Found in Website/scripts/ajax-autocomplete.js - About 6 hrs 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 build_timetable has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

      function build_timetable($contents, $include_link = TT_LINK_NONE,
              $start_schedule = START_SCHEDULE, $end_schedule = END_SCHEDULE)
      {
          $table = array();
          $days = get_all_days();
      Severity: Minor
      Found in Website/modules/functions/build.php - About 4 hrs 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

      File lists.php has 305 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*
      display_search_results:
      id: type of results to display
      results: results of search
      Severity: Minor
      Found in Website/modules/functions/lists.php - About 3 hrs to fix

        File forms.php has 292 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*
        form_ajax_search:
        id: type of records to search for.
        Builds AJAX search field and search results box.
        Severity: Minor
        Found in Website/modules/functions/forms.php - About 3 hrs to fix

          Function search_page has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          function search_page(pageNumber, resultsBox)
          {
              resultsBox.classList.remove('view_all');
          
              var currentPage = resultsBox.getElementsByClassName('page_' + pageNumber)[0];
          Severity: Minor
          Found in Website/scripts/ajax-search.js - About 2 hrs 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

          Method display_search_results has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function display_search_results($id, $results, $extra_info = null)
          {
              echo '<div class="search_results">';
              if (sizeof($results) > 0)
              {
          Severity: Major
          Found in Website/modules/functions/lists.php - About 2 hrs to fix

            Function build_sidebar has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            function build_sidebar($sidebar_data, $source)
            {
                $result = '';
                $has_current = false;
                foreach ($sidebar_data as $name => $address)
            Severity: Minor
            Found in Website/modules/functions/build.php - About 2 hrs 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 auto_complete_keyboard_controls has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function auto_complete_keyboard_controls(event)
            {
                var autoCompleteBox = event.currentTarget.parentNode.getElementsByClassName('auto_complete_box')[0];
                var selected = document.getElementById('auto_complete_selected');
                if (event.key === "Tab" || event.keyCode === 9 ||
            Severity: Major
            Found in Website/scripts/ajax-autocomplete.js - About 2 hrs to fix

              Function reset_form has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

              function reset_form(form)
              {
                  var casings;
              
                  casings = form.getElementsByClassName('text_box_casing');
              Severity: Minor
              Found in Website/scripts/main.js - About 2 hrs 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 ajax_submit has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

              function ajax_submit(form)
              {
                  var ajaxRequest;
                  if (window.XMLHttpRequest)
                      ajaxRequest = new XMLHttpRequest();
              Severity: Minor
              Found in Website/scripts/ajax-popup.js - About 2 hrs 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 format_timetable_cell has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              function format_timetable_cell($class, $include_link)
              {
                  $output = '';
                  if (isset($class['course_code']))
                      $output .= '<span class="course_code">'.$class['course_code'].'</span>';
              Severity: Minor
              Found in Website/modules/functions/build.php - About 2 hrs 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 reset_form has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function reset_form(form)
              {
                  var casings;
              
                  casings = form.getElementsByClassName('text_box_casing');
              Severity: Major
              Found in Website/scripts/main.js - About 2 hrs to fix

                Method build_timetable has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function build_timetable($contents, $include_link = TT_LINK_NONE,
                        $start_schedule = START_SCHEDULE, $end_schedule = END_SCHEDULE)
                {
                    $table = array();
                    $days = get_all_days();
                Severity: Minor
                Found in Website/modules/functions/build.php - About 1 hr to fix

                  Function login has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function login($email, $password)
                  {
                      global $conn;
                      $stmt = $conn->prepare('SELECT password, role_id, force_new_password FROM tbl_users WHERE :email = email');
                      $stmt->bindValue(':email', $email);
                  Severity: Minor
                  Found in Website/modules/db/security.php - About 1 hr 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 parse_course_code has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function parse_course_code($course_code)
                  {
                      $course_code_1 = "";
                      $course_code_2 = "";
                  
                  
                  Severity: Minor
                  Found in Website/modules/functions/main.php - About 1 hr 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 ajax_submit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function ajax_submit(form)
                  {
                      var ajaxRequest;
                      if (window.XMLHttpRequest)
                          ajaxRequest = new XMLHttpRequest();
                  Severity: Minor
                  Found in Website/scripts/ajax-popup.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language