classes/class-alerts-list.php
Method column_data
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function column_data( $column_name, $post_id ) {
$alert = $this->plugin->alerts->get_alert( $post_id );
if ( false === $alert ) {
return;
Function column_data
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
public function column_data( $column_name, $post_id ) {
$alert = $this->plugin->alerts->get_alert( $post_id );
if ( false === $alert ) {
return;
- Read upRead up
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
Open
<?php
/**
* Listing of Alerts in the WP Admin.
*
* @package WP_Stream
Method save_alert_inline_edit
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function save_alert_inline_edit( $data, $postarr ) {
if ( did_action( 'customize_preview_init' ) || empty( $postarr['ID'] ) ) {
return $data;
}
Method display_custom_quick_edit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function display_custom_quick_edit() {
static $fired = false;
if ( false !== $fired ) {
return;
}
Avoid too many return
statements within this method. Open
Open
return $data;