Showing 6 of 6 total issues
Method add_help_tab
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function add_help_tab() {
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview', 'pubsubhubbub' ),
Consider simplifying this complex logical expression. Open
if (
( is_feed( $supported_feed_types ) && ! is_date() && ! is_post_type_archive() && ! is_singular() ) ||
( is_feed( $supported_comment_feed_types ) && is_singular() ) ||
( is_home() && current_theme_supports( 'microformats2' ) )
) {
Method publish_update
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function publish_update( $topic_urls, $hub_url ) {
if ( ! isset( $hub_url ) ) {
return new WP_Error( 'missing_hub_url', __( 'Please specify a hub url', 'pubsubhubbub' ) );
}
Function publish_update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function publish_update( $topic_urls, $hub_url ) {
if ( ! isset( $hub_url ) ) {
return new WP_Error( 'missing_hub_url', __( 'Please specify a hub url', 'pubsubhubbub' ) );
}
- 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 pubsubhubbub_show_discovery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function pubsubhubbub_show_discovery() {
$show_discovery = false;
$supported_feed_types = apply_filters( 'pubsubhubbub_show_discovery_for_feed_types', pubsubhubbub_get_supported_feed_types() );
$supported_comment_feed_types = apply_filters( 'pubsubhubbub_show_discovery_for_comment_feed_types', pubsubhubbub_get_supported_comment_feed_types() );
- 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 get_feed_urls_by_post_id
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function get_feed_urls_by_post_id( $post_id ) {
$post = get_post( $post_id );
$feed_types = pubsubhubbub_get_supported_feed_types();
- 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"