SilentComics/Strip

View on GitHub

Showing 13 of 18 total issues

File functions.php has 391 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Strip functions and definitions
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
Severity: Minor
Found in functions.php - About 5 hrs to fix

    Method comic_post_type has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function comic_post_type() {
    
        $labels = array(
            'name'                       => _x( 'Comics', 'Post Type General Name', 'strip' ),
            'singular_name'              => _x( 'Comic', 'Post Type Singular Name', 'strip' ),
    Severity: Major
    Found in functions.php - About 2 hrs to fix

      Method strip_widgets_init has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function strip_widgets_init() {
          register_sidebar(array(
              'name'          => __( 'Main Sidebar', 'strip' ),
              'id'            => 'sidebar',
              'description'   => __( 'The main body widget area', 'strip' ),
      Severity: Minor
      Found in functions.php - About 1 hr to fix

        Method strip_setup has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function strip_setup() {
                /**
        * Remove some default WordPress dashboard widgets
        * an example custom dashboard widget
        * adding custom login css
        Severity: Minor
        Found in functions.php - About 1 hr to fix

          Method comic_story_taxonomy has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function comic_story_taxonomy() {
              $labels = array(
                  'name'                       => _x( 'Comic Story', 'Taxonomy General Name', 'strip' ),
                  'singular_name'              => _x( 'Comic Story', 'Taxonomy Singular Name', 'strip' ),
                  'menu_name'                  => __( 'Comic Stories', 'strip' ),
          Severity: Minor
          Found in functions.php - About 1 hr to fix

            Method strip_manage_woocommerce_styles has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function strip_manage_woocommerce_styles() {
                    // remove generator meta tag.
                    remove_action( 'wp_head', array( 'woocommerce', 'generator' ) );
                    // first check that woo exists to prevent fatal errors.
                    if ( function_exists( 'strip_is_woocommerce_activated' ) ) {
            Severity: Minor
            Found in functions.php - About 1 hr to fix

              Method strip_rss_dashboard_widget has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function strip_rss_dashboard_widget() {
                  // Get RSS Feed(s)
                  include_once(ABSPATH . WPINC . '/feed.php');
              
                  // My feeds list (add your own RSS feeds urls)
              Severity: Minor
              Found in assets/admin.php - About 1 hr to fix

                Method get_comic_boundary_post has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function get_comic_boundary_post( $in_same_term, $start, $taxonomy ) {
                    global $post;
                    setup_postdata( $post );
                    if ( ! taxonomy_exists( $taxonomy ) ) {
                        return null;
                Severity: Minor
                Found in inc/template-tags.php - About 1 hr to fix

                  Function strip_rss_dashboard_widget has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function strip_rss_dashboard_widget() {
                      // Get RSS Feed(s)
                      include_once(ABSPATH . WPINC . '/feed.php');
                  
                      // My feeds list (add your own RSS feeds urls)
                  Severity: Minor
                  Found in assets/admin.php - About 35 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 strip_entry_meta has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function strip_entry_meta() {
                          if ( is_sticky() && is_home() ) {
                              printf(
                                  wp_kses( '<span class="featured-post"><a href="%1$s" title="%2$s" rel="bookmark">Sticky</a></span>', 'strip' ),
                                  esc_url( get_permalink() ),
                  Severity: Minor
                  Found in inc/template-tags.php - About 35 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 set_default_object_terms has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function set_default_object_terms( $post_id, $post ) {
                          if ( 'publish' === $post->post_status && 'comic' === $post->post_type ) {
                              $defaults = array(
                              'story' => array( 'draft' ),
                              );
                  Severity: Minor
                  Found in functions.php - About 35 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 strip_header_style has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function strip_header_style() {
                  
                      /* Header text color. */
                  $header_text_color = get_header_textcolor();
                  
                  
                  Severity: Minor
                  Found in inc/custom-header.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

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

                  function strip_scripts() {
                      // add custom font here if any.
                      wp_enqueue_style( 'fenix', get_template_directory_uri() . '/assets/fonts/fenix.css', array(), null );
                  
                      wp_enqueue_style( 'inconsolata', get_template_directory_uri() . '/assets/fonts/inconsolata.css', array(), null );
                  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