phplib/Persistence.php

Summary

Maintainability
F
3 days
Test Coverage

Function save_event has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    static function save_event($postmortem, $conn = null) {
        $values = array("title");

        try {
            if (isset($postmortem["id"])) {
Severity: Minor
Found in phplib/Persistence.php - 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

Method save_event has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static function save_event($postmortem, $conn = null) {
        $values = array("title");

        try {
            if (isset($postmortem["id"])) {
Severity: Major
Found in phplib/Persistence.php - About 3 hrs to fix

    File Persistence.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    require_once "Configuration.php";
    
    /**
    Severity: Minor
    Found in phplib/Persistence.php - About 3 hrs to fix

      Function get_array has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          static function get_array($columns, $where = array(), $table_name, $conn = null) {
              if (!$where) {
                  $where = array();
              }
      
      
      Severity: Minor
      Found in phplib/Persistence.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

      Method get_array has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          static function get_array($columns, $where = array(), $table_name, $conn = null) {
              if (!$where) {
                  $where = array();
              }
      
      
      Severity: Major
      Found in phplib/Persistence.php - About 2 hrs to fix

        Method range_query has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            static function range_query($columns, $table_name, $where = array(), $conn = null) {
                $get_sql = 'SELECT ' . implode(',', $columns) . ' FROM ' . $table_name;
        
                $placeholders = array();
                $placeholder_values = array();
        Severity: Minor
        Found in phplib/Persistence.php - About 1 hr to fix

          Function store_array has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              static function store_array($table_name, $assoc_column, $values, $postmortem_id, $conn) {
                  try {
                      foreach ($values as $value) {
                          $select_sql = 'SELECT postmortem_id, id, deleted ' .
                                        ' FROM ' . $table_name .
          Severity: Minor
          Found in phplib/Persistence.php - About 45 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

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

              static function store_array($table_name, $assoc_column, $values, $postmortem_id, $conn) {
          Severity: Minor
          Found in phplib/Persistence.php - About 35 mins to fix

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

                    try {
                        $ret = array();
                        $stmt = $conn->prepare($get_sql);
                        $stmt->execute($placeholder_values);
                        while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
            Severity: Major
            Found in phplib/Persistence.php and 1 other location - About 1 hr to fix
            phplib/Persistence.php on lines 280..291

            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 118.

            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 2 locations. Consider refactoring.
            Open

                    try {
                        $ret = array();
                        $stmt = $conn->prepare($get_sql);
                        $stmt->execute($where);
                        while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
            Severity: Major
            Found in phplib/Persistence.php and 1 other location - About 1 hr to fix
            phplib/Persistence.php on lines 343..354

            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 118.

            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 2 locations. Consider refactoring.
            Open

                static function flag_as_undeleted($table_name, $pk_column, $pk, $conn) {
                    try {
                        $sql = "UPDATE $table_name SET deleted=0 WHERE $pk_column = :id";
                        $stmt = $conn->prepare($sql);
                        $stmt->execute(array('id' => $pk));
            Severity: Major
            Found in phplib/Persistence.php and 1 other location - About 1 hr to fix
            phplib/Persistence.php on lines 435..444

            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 103.

            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 2 locations. Consider refactoring.
            Open

                static function flag_as_deleted($table_name, $pk_column, $pk, $conn) {
                    try {
                        $sql = "UPDATE $table_name SET deleted=1 WHERE $pk_column = :id";
                        $stmt = $conn->prepare($sql);
                        $stmt->execute(array('id' => $pk));
            Severity: Major
            Found in phplib/Persistence.php and 1 other location - About 1 hr to fix
            phplib/Persistence.php on lines 456..465

            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 103.

            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

            Each class must be in a namespace of at least one level (a top-level vendor name)
            Open

            class Persistence {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Method name "Persistence::save_event" is not in camel caps format
            Open

                static function save_event($postmortem, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Visibility must be declared on method "save_forum"
            Open

                static function save_forum($forum, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Opening brace of a class must be on the line after the definition
            Open

            class Persistence {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if( isset($postmortem['gcal']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Method name "Persistence::store_array" is not in camel caps format
            Open

                static function store_array($table_name, $assoc_column, $values, $postmortem_id, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['owner_team'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Visibility must be declared on method "flag_as_deleted"
            Open

                static function flag_as_deleted($table_name, $pk_column, $pk, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Method name "Persistence::flag_as_undeleted" is not in camel caps format
            Open

                static function flag_as_undeleted($table_name, $pk_column, $pk, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Visibility must be declared on method "save_event"
            Open

                static function save_event($postmortem, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['problem_type'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['incident_cause'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            The closing brace for the class must go on the next line after the body
            Open

            }
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if( isset($postmortem['detecttime']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Visibility must be declared on method "get_association_by_id"
            Open

                static function get_association_by_id($columns, $table_name, $pk, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Method name "Persistence::flag_as_deleted" is not in camel caps format
            Open

                static function flag_as_deleted($table_name, $pk_column, $pk, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after FUNCTION keyword; 0 found
            Open

                            array_walk($where, function($value, $column) use (&$placeholders) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if( isset($postmortem['tldr']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Method name "Persistence::save_forum" is not in camel caps format
            Open

                static function save_forum($forum, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Visibility must be declared on method "get_array"
            Open

                static function get_array($columns, $where = array(), $table_name, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Visibility must be declared on method "flag_as_undeleted"
            Open

                static function flag_as_undeleted($table_name, $pk_column, $pk, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['facilitator'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['impact_type'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after FUNCTION keyword; 0 found
            Open

                    array_walk($where, function($value, $col) use (&$placeholders, &$placeholder_values) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Terminating statement must be indented to the same level as the CASE body
            Open

                                break;
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Blank line found at end of control structure
            Open

            
            
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Method name "Persistence::get_array" is not in camel caps format
            Open

                static function get_array($columns, $where = array(), $table_name, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if( isset($postmortem['why_surprised']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if( isset($postmortem['severity']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['statustime'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Method name "Persistence::range_query" is not in camel caps format
            Open

                static function range_query($columns, $table_name, $where = array(), $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Visibility must be declared on method "range_query"
            Open

                static function range_query($columns, $table_name, $where = array(), $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if( isset($postmortem['starttime']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['subsystem'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Blank line found at end of control structure
            Open

            
            
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Terminating statement must be indented to the same level as the CASE body
            Open

                                break;
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Method name "Persistence::get_association_by_id" is not in camel caps format
            Open

                static function get_association_by_id($columns, $table_name, $pk, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Blank line found at end of control structure
            Open

            
            
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Visibility must be declared on method "get_database_object"
            Open

                static function get_database_object() {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['created'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Terminating statement must be indented to the same level as the CASE body
            Open

                                break;
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if( isset($postmortem['summary']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Method name "Persistence::get_database_object" is not in camel caps format
            Open

                static function get_database_object() {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['meeting_notes_link'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if( isset($postmortem['endtime']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset($postmortem['contact']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Blank line found at end of control structure
            Open

            
            
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Method name "Persistence::get_postmortem" is not in camel caps format
            Open

                static function get_postmortem($postmortem_id, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Visibility must be declared on method "get_postmortem"
            Open

                static function get_postmortem($postmortem_id, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Visibility must be declared on method "store_array"
            Open

                static function store_array($table_name, $assoc_column, $values, $postmortem_id, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Arguments with default values must be at the end of the argument list
            Open

                static function get_array($columns, $where = array(), $table_name, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Opening brace should be on a new line
            Open

                static function save_event($postmortem, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after IF keyword; 0 found
            Open

                            if( isset($postmortem['summary']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            No space found after comma in function call
            Open

                                array_push($values,"summary");
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if( isset($postmortem['tldr']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if ( isset( $postmortem['statustime'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if ( isset( $postmortem['facilitator'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Closing brace indented incorrectly; expected 11 spaces, found 12
            Open

                        }
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected 20 spaces, found 16
            Open

                            case "=":  // not actually a range query
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected 20 spaces, found 16
            Open

                            case "BETWEEN":
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after CATCH keyword; 0 found
            Open

                    } catch(PDOException $e) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Space after opening parenthesis of function call prohibited
            Open

                            if ( isset( $postmortem['problem_type'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after closing parenthesis; found 0
            Open

                            if ( isset( $postmortem['subsystem'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after closing parenthesis; found 0
            Open

                            if ( isset( $postmortem['impact_type'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected 20 spaces, found 16
            Open

                            case "!=": // not actually a range query but not supported by get_array
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected 20 spaces, found 16
            Open

                            case ">=":
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected at least 24 spaces, found 20
            Open

                                $placeholder_values[$max_ph] = $value->max_value;
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            No space found after comma in function call
            Open

                                array_push($values,"detecttime");
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            No space found after comma in function call
            Open

                                array_push($values,"contact");
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['subsystem'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected at least 24 spaces, found 20
            Open

                                $placeholders[] = sprintf('%s = :%s', $col, $col);
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after CATCH keyword; 0 found
            Open

                    } catch(PDOException $e) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after IF keyword; 0 found
            Open

                            if( isset($postmortem['why_surprised']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            No space found after comma in function call
            Open

                                array_push($values,"severity");
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Opening brace should be on a new line
            Open

                static function flag_as_undeleted($table_name, $pk_column, $pk, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if( isset($postmortem['summary']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            No space found after comma in function call
            Open

                                array_push($values,"why_surprised");
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['created'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Opening brace should be on a new line
            Open

                static function get_postmortem($postmortem_id, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Opening brace should be on a new line
            Open

                static function get_array($columns, $where = array(), $table_name, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected 20 spaces, found 16
            Open

                            case "<":
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Space after opening parenthesis of function call prohibited
            Open

                            if ( isset( $postmortem['meeting_notes_link'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if( isset($postmortem['starttime']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            No space found after comma in function call
            Open

                                array_push($values,"starttime");
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['facilitator'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if ( isset( $postmortem['owner_team'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after IF keyword; 0 found
            Open

                            if( isset($postmortem['detecttime']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            No space found after comma in function call
            Open

                                array_push($values,"gcal");
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if ( isset($postmortem['contact']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Space after opening parenthesis of function call prohibited
            Open

                            if ( isset( $postmortem['subsystem'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Space after opening parenthesis of function call prohibited
            Open

                            if ( isset( $postmortem['incident_cause'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after closing parenthesis; found 0
            Open

                            if ( isset( $postmortem['incident_cause'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after CATCH keyword; 0 found
            Open

                    } catch(PDOException $e) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected at least 24 spaces, found 20
            Open

                                $placeholder_values[$min_ph] = $value->min_value;
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected 20 spaces, found 16
            Open

                            default:
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Opening brace should be on a new line
            Open

                static function get_association_by_id($columns, $table_name, $pk, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after IF keyword; 0 found
            Open

                            if( isset($postmortem['tldr']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['incident_cause'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Whitespace found at end of line
            Open

                       && array_key_exists('client_cert', $config['database']) 
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after closing parenthesis; found 0
            Open

                            if ( isset( $postmortem['meeting_notes_link'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Space after opening parenthesis of function call prohibited
            Open

                            if ( isset( $postmortem['facilitator'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected 12 spaces, found 11
            Open

                       if (!array_key_exists("id", $postmortem)) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected at least 24 spaces, found 20
            Open

                                $min_ph = 'min_' . $col;
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if( isset($postmortem['gcal']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after closing parenthesis; found 0
            Open

                            if ( isset( $postmortem['statustime'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Space after opening parenthesis of function call prohibited
            Open

                            if ( isset( $postmortem['created'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if ( isset( $postmortem['incident_cause'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Whitespace found at end of line
            Open

                    if(array_key_exists('client_key', $config['database']) 
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after IF keyword; 0 found
            Open

                            if( isset($postmortem['endtime']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if ( isset( $postmortem['problem_type'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Opening brace should be on a new line
            Open

                static function save_forum($forum, $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected at least 24 spaces, found 20
            Open

                                $max_ph = 'max_' . $col;
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Opening brace should be on a new line
            Open

                static function flag_as_deleted($table_name, $pk_column, $pk, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after CATCH keyword; 0 found
            Open

                    } catch(PDOException $e) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if( isset($postmortem['why_surprised']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['meeting_notes_link'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after IF keyword; 0 found
            Open

                            if( isset($postmortem['starttime']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            No space found after comma in function call
            Open

                                array_push($values,"endtime");
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after IF keyword; 0 found
            Open

                            if( isset($postmortem['gcal']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['statustime'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected 20 spaces, found 16
            Open

                            case ">":
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected at least 24 spaces, found 20
            Open

                                $placeholder_values[$col] = $value->value;
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 newline at end of file; 0 found
            Open

            }
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            No space found after comma in function call
            Open

                                array_push($values,"tldr");
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if ( isset( $postmortem['meeting_notes_link'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if( isset($postmortem['detecttime']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after IF keyword; 0 found
            Open

                            if( isset($postmortem['severity']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if( isset($postmortem['severity']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after closing parenthesis; found 0
            Open

                            if ( isset( $postmortem['problem_type'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Space after opening parenthesis of function call prohibited
            Open

                            if ( isset( $postmortem['impact_type'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['impact_type'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after CATCH keyword; 0 found
            Open

                    } catch(PDOException $e) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after CATCH keyword; 0 found
            Open

                    } catch(PDOException $e) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Opening brace should be on a new line
            Open

                static function range_query($columns, $table_name, $where = array(), $conn = null) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after CATCH keyword; 0 found
            Open

                    } catch(PDOException $e) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Opening brace should be on a new line
            Open

                static function get_database_object() {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Space after opening parenthesis of function call prohibited
            Open

                            if ( isset( $postmortem['statustime'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected 20 spaces, found 16
            Open

                            case "<=":
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Line indented incorrectly; expected at least 24 spaces, found 20
            Open

                                $placeholders[] = sprintf('%s BETWEEN :%s AND :%s', $col, $min_ph, $max_ph);
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            No space found after comma in function call
            Open

                                array_push($values,"statustime");
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after closing parenthesis; found 0
            Open

                            if ( isset( $postmortem['owner_team'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after CATCH keyword; 0 found
            Open

                    } catch(PDOException $e) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after CATCH keyword; 0 found
            Open

                    } catch(PDOException $e) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after IF keyword; 0 found
            Open

                    if(array_key_exists('client_key', $config['database']) 
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if( isset($postmortem['endtime']) ) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if ( isset( $postmortem['created'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after closing parenthesis; found 0
            Open

                            if ( isset( $postmortem['created'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after closing parenthesis; found 0
            Open

                            if ( isset( $postmortem['facilitator'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['problem_type'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if ( isset( $postmortem['subsystem'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Space after opening parenthesis of function call prohibited
            Open

                            if ( isset( $postmortem['owner_team'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces before closing bracket; 1 found
            Open

                            if ( isset( $postmortem['owner_team'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 0 spaces after opening bracket; 1 found
            Open

                            if ( isset( $postmortem['impact_type'] ) ){
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Opening brace should be on a new line
            Open

                static function store_array($table_name, $assoc_column, $values, $postmortem_id, $conn) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            Expected 1 space after CATCH keyword; 0 found
            Open

                    } catch(PDOException $e) {
            Severity: Minor
            Found in phplib/Persistence.php by phpcodesniffer

            There are no issues that match your filters.

            Category
            Status