peiche/cover

View on GitHub

Showing 11 of 17 total issues

Function exports has 345 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(grunt) {

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    hub: {
Severity: Major
Found in gruntfile.js - About 1 day to fix

Method cover_customize_register has 132 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function cover_customize_register( $wp_customize ) {
    $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
    $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';

  $wp_customize->add_setting(
Severity: Major
Found in inc/customizer.php - About 5 hrs to fix

File gruntfile.js has 347 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
* Cover Gruntfile
* http://eichefam.net/projects/cover
* @author Paul Eiche
*/
Severity: Minor
Found in gruntfile.js - About 4 hrs to fix

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

function cover_posted_on() {

    $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
    if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
        $time_string .= '<time class="updated" datetime="%3$s">%4$s</time>';
Severity: Minor
Found in inc/template-tags.php - About 1 hr to fix

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

function cover_customize_options() {
  $header_color  = esc_attr( get_theme_mod( 'cover_header_color', '#026ed2' ) );
  $link_color    = esc_attr( get_theme_mod( 'cover_link_color', '#026ed2' ) );
    $overlay_color = esc_attr( get_theme_mod( 'cover_overlay_color', 'overlay-dark' ) );
    $list_style    = esc_attr( get_theme_mod( 'cover_list_style', 'minimal' ) );
Severity: Minor
Found in inc/customizer.php - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

if ( ! ( is_single() || is_page() || is_archive() || is_author() || is_search() || is_404() || ( function_exists( 'cover_has_featured_posts' ) && cover_has_featured_posts() ) ) ) {
    $header_class = ' bg';
}
Severity: Critical
Found in header.php - About 1 hr to fix

Method cover_use_custom_colors has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function cover_use_custom_colors( $colors_css, $color, $contrast ) {
    // Reset colors.
    $colors_css = '';

    $post_id = get_the_ID();
Severity: Minor
Found in inc/color-posts.php - About 1 hr to fix

Method cover_post_nav has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function cover_post_nav() {
    // Don't print empty markup if there's nowhere to navigate.
    $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
    $next = get_adjacent_post( false, '', false );

Severity: Minor
Found in inc/template-tags.php - About 1 hr to fix

Function cover_post_nav has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function cover_post_nav() {
    // Don't print empty markup if there's nowhere to navigate.
    $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
    $next = get_adjacent_post( false, '', false );

Severity: Minor
Found in inc/template-tags.php - About 1 hr 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

Function cover_posted_on has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function cover_posted_on() {

    $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
    if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
        $time_string .= '<time class="updated" datetime="%3$s">%4$s</time>';
Severity: Minor
Found in inc/template-tags.php - About 55 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

Function cover_scripts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function cover_scripts() {

  wp_enqueue_style( 'GoogleFonts', '//fonts.googleapis.com/css?family=Source+Code+Pro|Montserrat|Open+Sans:400,600' );
    wp_enqueue_style( 'cover-style', get_stylesheet_uri() );

Severity: Minor
Found in functions.php - About 25 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

Severity
Category
Status
Source
Language