APO-Epsilon/apo-website

View on GitHub

Showing 11,898 of 11,898 total issues

Similar blocks of code found in 6 locations. Consider refactoring.
Open

      if($start > 12){
        $startstr = substr($start, 0,2);
        $startstr -= 12;
        $start = $startstr.substr($start,2,-3)."pm";
      }else{
Severity: Major
Found in service_signup.php and 5 other locations - About 45 mins to fix
service_admin_week.php on lines 209..215
service_admin_week.php on lines 216..222
service_admin_week.php on lines 403..409
service_admin_week.php on lines 410..416
service_signup.php on lines 228..234

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

      if($end > 12){
        $endstr = substr($end, 0,2);
        $endstr -= 12;
        $end = $endstr.substr($end,2,-3)."pm";
      }else{
Severity: Major
Found in service_admin_week.php and 5 other locations - About 45 mins to fix
service_admin_week.php on lines 209..215
service_admin_week.php on lines 403..409
service_admin_week.php on lines 410..416
service_signup.php on lines 221..227
service_signup.php on lines 228..234

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

      if($end > 12){
        $endstr = substr($end, 0,2);
        $endstr -= 12;
        $end = $endstr.substr($end,2,-3)."pm";
      }else{
Severity: Major
Found in service_signup.php and 5 other locations - About 45 mins to fix
service_admin_week.php on lines 209..215
service_admin_week.php on lines 216..222
service_admin_week.php on lines 403..409
service_admin_week.php on lines 410..416
service_signup.php on lines 221..227

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Consider simplifying this complex logical expression.
Open

  if ($sessionID == 426 || $sessionID == 443 || $sessionID == 739 || $sessionID == 668 || $sessionID == 851 || $sessionID == 1012 ) {        //list users ids for webmaster committee here to allow access - current: 426-Justin 443-Kevin 739-Austin 668-Carnahan
    if (isset($_POST['action'])){
      process_form();
    }
    vars_form();
Severity: Major
Found in change_session_vars.php - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

        if ($firstname == NULL || $lastname == NULL || $username == NULL || $password == NULL || $email == NULL  ||  $regpass == NULL )
        {
          echo '<div class="entry"><strong>All of the required fields were not filled out.  Please try again.</strong></div>';
        } else if ($regpass == $current_reg_pass) {
            $insert = "INSERT INTO `contact_information` (firstname,
    Severity: Major
    Found in register_process.php - About 40 mins to fix

      Classes should not have a constructor method with the same name as the class
      Open

        function PasswordHash($iteration_count_log2, $portable_hashes)
        {
          $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
      
          if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
      Severity: Minor
      Found in PasswordHash.php by phpmd

      ConstructorWithNameAsEnclosingClass

      Since: 0.2

      A constructor method should not have the same name as the enclosing class, consider to use the PHP 5 __construct method.

      Example

      class MyClass {
           // this is bad because it is PHP 4 style
          public function MyClass() {}
          // this is good because it is a PHP 5 constructor
          public function __construct() {}
      }

      Source https://phpmd.org/rules/naming.html#constructorwithnameasenclosingclass

      Function init has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          init : function (scope, libraries, method, options, response) {
      Severity: Minor
      Found in r8conf2016/js/foundation/foundation.js - About 35 mins to fix

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

        function submitModifyEvent($start,$end,$max,$length,$detail_id){
        Severity: Minor
        Found in service_admin_functions.php - About 35 mins to fix

          Function process_form has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function process_form() {
            include ('mysql_access.php');
            $id = $_SESSION['sessionID'];
            $event = $_POST['event'];
            $month = $_POST['month'];
          Severity: Minor
          Found in check_hours.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 show_active has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function show_active() {
            if (isset($_SESSION['sessionIDOriginal'])) {
              $sessionID = $_SESSION['sessionIDOriginal'];
            } else {
              $sessionID = $_SESSION['sessionID'];
          Severity: Minor
          Found in change_session_vars.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 removeSubmoduleFiles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function removeSubmoduleFiles($submoduleArray) {
              //Indicate here any special files we don't want deleted in any repo
              $specialFiles = array(".gitignore", ".git");
          
              foreach ($submoduleArray as $submoduleKey => $submoduleValue) {
          Severity: Minor
          Found in includes/clean_up_submodules.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 show_active has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function show_active() {
              $id = $_SESSION['sessionID'];    
              
              include('retrieve_user.php');
              $position = id_to_position($id);
          Severity: Minor
          Found in update_semester.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 show_public has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function show_public() {
            include('mysql_access.php');
            //generate dot for viz.js
          ?>
            <script type='text/vnd.graphviz' id='family_tree_script'>
          Severity: Minor
          Found in family_tree.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

          Spaces must be used for alignment; tabs are not allowed
          Open

              //dropdown list of events
          Severity: Minor
          Found in rec_sec_attendance_tool.php by phpcodesniffer

          Spaces must be used for alignment; tabs are not allowed
          Open

              include('retrieve_user.php');
          Severity: Minor
          Found in rec_sec_attendance_tool.php by phpcodesniffer

          Spaces must be used for alignment; tabs are not allowed
          Open

              $user_id = $_SESSION['sessionID'];    
          Severity: Minor
          Found in rec_sec_attendance_tool.php by phpcodesniffer

          Spaces must be used for alignment; tabs are not allowed
          Open

              </table>
          Severity: Minor
          Found in rec_sec_attendance_tool.php by phpcodesniffer

          Spaces must be used for alignment; tabs are not allowed
          Open

                  if(isset($_POST['instance']))
          Severity: Minor
          Found in rec_sec_attendance_tool.php by phpcodesniffer

          TRUE, FALSE and NULL must be lowercase; expected "true" but found "True"
          Open

          $active_page = True;
          Severity: Minor
          Found in rec_sec_attendance_tool.php by phpcodesniffer

          Spaces must be used for alignment; tabs are not allowed
          Open

                  if($instance == "none")
          Severity: Minor
          Found in rec_sec_attendance_tool.php by phpcodesniffer
          Severity
          Category
          Status
          Source
          Language