classes/class-alerts-list.php

Summary

Maintainability
D
1 day
Test Coverage
F
37%

Method column_data has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function column_data( $column_name, $post_id ) {

        $alert = $this->plugin->alerts->get_alert( $post_id );
        if ( false === $alert ) {
            return;
Severity: Major
Found in classes/class-alerts-list.php - About 4 hrs to fix

    Function column_data has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function column_data( $column_name, $post_id ) {
    
            $alert = $this->plugin->alerts->get_alert( $post_id );
            if ( false === $alert ) {
                return;
    Severity: Minor
    Found in classes/class-alerts-list.php - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    File class-alerts-list.php has 283 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Listing of Alerts in the WP Admin.
     *
     * @package WP_Stream
    Severity: Minor
    Found in classes/class-alerts-list.php - About 2 hrs to fix

      Method save_alert_inline_edit has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function save_alert_inline_edit( $data, $postarr ) {
              if ( did_action( 'customize_preview_init' ) || empty( $postarr['ID'] ) ) {
                  return $data;
              }
      
      
      Severity: Minor
      Found in classes/class-alerts-list.php - About 1 hr to fix

        Method display_custom_quick_edit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function display_custom_quick_edit() {
                static $fired = false;
                if ( false !== $fired ) {
                    return;
                }
        Severity: Minor
        Found in classes/class-alerts-list.php - About 1 hr to fix

          Avoid too many return statements within this method.
          Open

                  return $data;
          Severity: Major
          Found in classes/class-alerts-list.php - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status