Showing 19 of 326 total issues
Function sweep
has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring. Open
public function sweep( $name ) {
global $wpdb;
$message = '';
- 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-wpsweep.php
has 632 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WP-Sweep class-wpsweep.php
*
* @package wp-sweep
File admin.php
has 554 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WP-Sweep admin.php
*
* @package wp-sweep
Method sweep
has 224 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sweep( $name ) {
global $wpdb;
$message = '';
Function details
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function details( $name ) {
global $wpdb;
$details = array();
- 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
Function count
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function count( $name ) {
global $wpdb;
$count = 0;
- 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
Method details
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function details( $name ) {
global $wpdb;
$details = array();
Method count
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function count( $name ) {
global $wpdb;
$count = 0;
Method ajax_sweep
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ajax_sweep() {
// Verify referer and check permissions.
if (
empty( $_GET['sweep_name'] )
|| empty( $_GET['sweep_type'] )
WPSweep
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class WPSweep {
/**
* Limit the number of items to show for sweep details
*
* @since 1.0.3
Method __construct
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
add_action(
'rest_api_init', function() {
register_rest_route(
$this->namespace, 'count/(?P<name>\w+)', array(
Method total_count
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function total_count( $name ) {
global $wpdb;
$count = 0;
Function total_count
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function total_count( $name ) {
global $wpdb;
$count = 0;
- 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
Method __invoke
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __invoke( $args, $assoc_args ) {
$items = array();
$default_items = array(
Function get_default_taxonomy_termids
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function get_default_taxonomy_termids() {
$taxonomies = get_taxonomies();
$default_term_ids = array();
if ( $taxonomies ) {
$tax = array_keys( $taxonomies );
- 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
Function ajax_sweep
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function ajax_sweep() {
// Verify referer and check permissions.
if (
empty( $_GET['sweep_name'] )
|| empty( $_GET['sweep_type'] )
- 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
Function plugin_activation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function plugin_activation( $network_wide ) {
if ( is_multisite() && $network_wide ) {
$ms_sites = (array) get_sites();
if ( 0 < count( $ms_sites ) ) {
- 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
Function plugin_deactivation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function plugin_deactivation( $network_wide ) {
if ( is_multisite() && $network_wide ) {
$ms_sites = (array) get_sites();
if ( 0 < count( $ms_sites ) ) {
- 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
Function __invoke
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __invoke( $args, $assoc_args ) {
$items = array();
$default_items = array(
- 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"