APO-Epsilon/apo-website

View on GitHub
change_session_vars.php

Summary

Maintainability
B
5 hrs
Test Coverage

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_POST.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

show_active accesses the super-global variable $_SESSION.
Open

function show_active() {
  if (isset($_SESSION['sessionIDOriginal'])) {
    $sessionID = $_SESSION['sessionIDOriginal'];
  } else {
    $sessionID = $_SESSION['sessionID'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_POST.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_POST.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

vars_form accesses the super-global variable $_SESSION.
Open

function vars_form() {
  include ('mysql_access.php');
?>
  <div class="small-12 columns">
    <h1>Change Session Vars</h1>
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

vars_form accesses the super-global variable $_SESSION.
Open

function vars_form() {
  include ('mysql_access.php');
?>
  <div class="small-12 columns">
    <h1>Change Session Vars</h1>
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_POST.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_POST.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

show_active accesses the super-global variable $_SESSION.
Open

function show_active() {
  if (isset($_SESSION['sessionIDOriginal'])) {
    $sessionID = $_SESSION['sessionIDOriginal'];
  } else {
    $sessionID = $_SESSION['sessionID'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

show_active accesses the super-global variable $_SESSION.
Open

function show_active() {
  if (isset($_SESSION['sessionIDOriginal'])) {
    $sessionID = $_SESSION['sessionIDOriginal'];
  } else {
    $sessionID = $_SESSION['sessionID'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

show_active accesses the super-global variable $_POST.
Open

function show_active() {
  if (isset($_SESSION['sessionIDOriginal'])) {
    $sessionID = $_SESSION['sessionIDOriginal'];
  } else {
    $sessionID = $_SESSION['sessionID'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

process_form accesses the super-global variable $_SESSION.
Open

function process_form() {
  include ('mysql_access.php');
  if ($_POST['action'] == "Reset Vars") {
    if (isset($_SESSION['sessionIDOriginal'])) {
      $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

vars_form accesses the super-global variable $_SERVER.
Open

function vars_form() {
  include ('mysql_access.php');
?>
  <div class="small-12 columns">
    <h1>Change Session Vars</h1>
Severity: Minor
Found in change_session_vars.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Method vars_form has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function vars_form() {
  include ('mysql_access.php');
?>
  <div class="small-12 columns">
    <h1>Change Session Vars</h1>
Severity: Major
Found in change_session_vars.php - About 2 hrs to fix

    Method process_form has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function process_form() {
      include ('mysql_access.php');
      if ($_POST['action'] == "Reset Vars") {
        if (isset($_SESSION['sessionIDOriginal'])) {
          $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
    Severity: Minor
    Found in change_session_vars.php - About 1 hr to fix

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

      function process_form() {
        include ('mysql_access.php');
        if ($_POST['action'] == "Reset Vars") {
          if (isset($_SESSION['sessionIDOriginal'])) {
            $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
      Severity: Minor
      Found in change_session_vars.php - About 55 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

      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

        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

        Avoid using undefined variables such as '$db' which will lead to PHP notices.
        Open

                    $result = $db->query($sql);
        Severity: Minor
        Found in change_session_vars.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$db' which will lead to PHP notices.
        Open

                    $result = $db->query($sql);
        Severity: Minor
        Found in change_session_vars.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$db' which will lead to PHP notices.
        Open

              $query = $db->query($sql);
        Severity: Minor
        Found in change_session_vars.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$db' which will lead to PHP notices.
        Open

            $query = $db->query($sql);
        Severity: Minor
        Found in change_session_vars.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        The method show_active uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

          } else {
            $sessionID = $_SESSION['sessionID'];
          }
        Severity: Minor
        Found in change_session_vars.php by phpmd

        ElseExpression

        Since: 1.4.0

        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

        Example

        class Foo
        {
            public function bar($flag)
            {
                if ($flag) {
                    // one branch
                } else {
                    // another branch
                }
            }
        }

        Source https://phpmd.org/rules/cleancode.html#elseexpression

        The method process_form uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

            } else {
              $_SESSION['sessionexec'] = "1";
              $_SESSION['sessionposition'] = $_POST['exec'];
            }
        Severity: Minor
        Found in change_session_vars.php by phpmd

        ElseExpression

        Since: 1.4.0

        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

        Example

        class Foo
        {
            public function bar($flag)
            {
                if ($flag) {
                    // one branch
                } else {
                    // another branch
                }
            }
        }

        Source https://phpmd.org/rules/cleancode.html#elseexpression

        The method show_active uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

          } else {
            echo "<p>You need to be a member of the webmaster committee to see this section.</p>";
          }
        Severity: Minor
        Found in change_session_vars.php by phpmd

        ElseExpression

        Since: 1.4.0

        An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

        Example

        class Foo
        {
            public function bar($flag)
            {
                if ($flag) {
                    // one branch
                } else {
                    // another branch
                }
            }
        }

        Source https://phpmd.org/rules/cleancode.html#elseexpression

        A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 21 and the first side effect is on line 2.
        Open

        <?php
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        TRUE, FALSE and NULL must be lowercase; expected "false" but found "False"
        Open

        $exec_page = False;
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Expected 0 spaces before closing bracket; 1 found
        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
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        TRUE, FALSE and NULL must be lowercase; expected "false" but found "False"
        Open

        $public_page = False;
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

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

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

        Line exceeds 120 characters; contains 128 characters
        Open

              $sql = "SELECT id, firstname, lastname, username, exec, position FROM contact_information WHERE id = $sessionIDOriginal;";
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Space before opening parenthesis of function call prohibited
        Open

          include ('mysql_access.php');
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Opening brace should be on a new line
        Open

        function process_form() {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Space before opening parenthesis of function call prohibited
        Open

          include ('mysql_access.php');
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $_SESSION['sessionLastname'] = $result['lastname'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

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

        Line indented incorrectly; expected 4 spaces, found 2
        Open

          if (isset($_SESSION['sessionIDOriginal'])) {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 8 spaces, found 4
        Open

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

        Line indented incorrectly; expected at least 8 spaces, found 4
        Open

            $result = mysqli_fetch_array($query);
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 8 spaces, found 4
        Open

            $_SESSION['sessionID'] = $result['id'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 4 spaces, found 2
        Open

          }
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 8 spaces, found 4
        Open

            echo "<p>You need to be a member of the webmaster committee to see this section.</p>";
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 4 spaces, found 2
        Open

          include ('mysql_access.php');
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 12 spaces, found 14
        Open

                      while ($row = mysqli_fetch_array($result)) {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $_SESSION['sessionposition'] = $result['position'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 8 spaces, found 4
        Open

            if (!isset($_SESSION['sessionIDOriginal'])) {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 8 spaces, found 4
        Open

            } else {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Space before opening parenthesis of function call prohibited
        Open

        require_once ('session.php');
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Opening brace should be on a new line
        Open

        function vars_form() {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 12 spaces, found 10
        Open

                  <?php
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $_SESSION['sessionID'] = $result['id'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $_SESSION['sessionexec'] = "0";
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 12 spaces, found 10
        Open

                  ?>
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 4 spaces, found 2
        Open

          if ($_POST['action'] == "Reset Vars") {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              unset($_SESSION['sessionIDOriginal']);
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 8 spaces, found 4
        Open

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

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              process_form();
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 8 spaces, found 4
        Open

            }
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 12 spaces, found 14
        Open

                      while ($row = mysqli_fetch_array($result)) {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 12 spaces, found 10
        Open

                  ?>
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $query = $db->query($sql);
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $_SESSION['sessionUsername'] = $result['username'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 8 spaces, found 4
        Open

            $sql = "SELECT id, firstname, lastname, username FROM contact_information WHERE id = {$_POST['member']};";
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $_SESSION['sessionposition'] = $_POST['exec'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Opening brace should be on a new line
        Open

        function show_active() {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 4 spaces, found 2
        Open

          } else {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 12 spaces, found 14
        Open

                      }
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 8 spaces, found 4
        Open

            }
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 8 spaces, found 4
        Open

            vars_form();
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $result = mysqli_fetch_array($query);
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 4 spaces, found 2
        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
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 4 spaces, found 2
        Open

          }
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 8 spaces, found 4
        Open

            }
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 4 spaces, found 2
        Open

          } else {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 8 spaces, found 4
        Open

            $_SESSION['sessionUsername'] = $result['username'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Expected 1 space after closing parenthesis; found 0
        Open

            if (isset($_POST['action'])){
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 4 spaces, found 2
        Open

          }
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 8 spaces, found 4
        Open

            if (isset($_SESSION['sessionIDOriginal'])) {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 4 spaces, found 2
        Open

          }
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 12 spaces, found 14
        Open

                      }
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 12 spaces, found 10
        Open

                  <?php
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $sql = "SELECT id, firstname, lastname, username, exec, position FROM contact_information WHERE id = $sessionIDOriginal;";
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 8 spaces, found 4
        Open

            $query = $db->query($sql);
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 8 spaces, found 4
        Open

            $_SESSION['sessionFirstname'] = $result['firstname'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 8 spaces, found 4
        Open

            }
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 4 spaces, found 2
        Open

          include ('mysql_access.php');
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 8 spaces, found 4
        Open

            if ($_POST['exec'] == "") {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $_SESSION['sessionposition'] = "";
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 8 spaces, found 4
        Open

            if (isset($_POST['action'])){
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $_SESSION['sessionFirstname'] = $result['firstname'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $_SESSION['sessionexec'] = $result['exec'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected 4 spaces, found 2
        Open

          if ($_POST['action'] == "Submit") {
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 8 spaces, found 4
        Open

            $_SESSION['sessionLastname'] = $result['lastname'];
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        Line indented incorrectly; expected at least 12 spaces, found 6
        Open

              $_SESSION['sessionexec'] = "1";
        Severity: Minor
        Found in change_session_vars.php by phpcodesniffer

        There are no issues that match your filters.

        Category
        Status