Sorry, data for that comparison is no longer available.

presscodes/maera

View on GitHub

Showing 39 of 43 total issues

Function array_column has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    function array_column($input = null, $columnKey = null, $indexKey = null)
    {
        // Using func_get_args() in order to check for proper number of
        // parameters and trigger errors exactly as the built-in array_column()
        // does in PHP 5.5.
Severity: Minor
Found in includes/utils.php - About 5 hrs 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

Method form has 122 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function form( $instance ) {

        $defaults = array(
            'title'           => 'Latest Articles',
            'post_type'       => 'post',

    Function maera_templates_sidebar has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

    function maera_templates_sidebar() {
    
        global $wp_query;
        $templates = array();
    
    
    Severity: Minor
    Found in includes/template-hierarchy.php - About 3 hrs 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 modify_edd_download_shortcode has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        function modify_edd_download_shortcode( $display, $atts, $buy_button, $columns, $column_width, $downloads, $excerpt, $full_content, $price, $thumbnails, $query ) {
    
            $button_defaults = apply_filters( 'edd_purchase_link_defaults', array() );
            $button_defaults_class = $button_defaults['class'];
    
    
    Severity: Minor
    Found in includes/class-maera-edd-shortcodes.php - About 3 hrs 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

    Method maera_templates_hierarchy has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function maera_templates_hierarchy( $templates = array() ) {
    
        if ( ! isset( $templates ) ) {
            $templates = array();
        }
    Severity: Major
    Found in includes/template-hierarchy.php - About 3 hrs to fix

      Function maera_templates_hierarchy has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      function maera_templates_hierarchy( $templates = array() ) {
      
          if ( ! isset( $templates ) ) {
              $templates = array();
          }
      Severity: Minor
      Found in includes/template-hierarchy.php - About 3 hrs 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 fitVids has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        $.fn.fitVids = function( options ) {
          var settings = {
            customSelector: null
          };
      
      
      Severity: Major
      Found in assets/js/jquery.fitvids.js - About 3 hrs to fix

        Method modify_edd_download_shortcode has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function modify_edd_download_shortcode( $display, $atts, $buy_button, $columns, $column_width, $downloads, $excerpt, $full_content, $price, $thumbnails, $query ) {
        
                $button_defaults = apply_filters( 'edd_purchase_link_defaults', array() );
                $button_defaults_class = $button_defaults['class'];
        
        
        Severity: Major
        Found in includes/class-maera-edd-shortcodes.php - About 3 hrs to fix

          Method array_column has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function array_column($input = null, $columnKey = null, $indexKey = null)
              {
                  // Using func_get_args() in order to check for proper number of
                  // parameters and trigger errors exactly as the built-in array_column()
                  // does in PHP 5.5.
          Severity: Major
          Found in includes/utils.php - About 2 hrs to fix

            Method replacements has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function replacements() {
            
                    $replacements = array(
                        'maera_grid_container_open',
                        'maera_grid_container_close',
            Severity: Major
            Found in includes/class-maera-shell.php - About 2 hrs to fix

              Method create_settings has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function create_settings( $controls ) {
              
                      global $edd_options;
              
                      $controls[] = array(
              Severity: Major
              Found in includes/class-maera-edd-customizer.php - About 2 hrs to fix

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

                    function widget( $args, $instance ) {
                
                        extract( $args );
                
                        if ( isset( $instance['term'] ) && 'any' != $instance['term'] ) {

                  Method add_controls has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function add_controls( $wp_customize ) {
                  
                          // Get the available shells and format the array properly
                          $available_shells = apply_filters( 'maera/shells/available', array() );
                          $shells = array();
                  Severity: Minor
                  Found in includes/class-maera-core-customizer.php - About 1 hr to fix

                    Method modify_edd_download_shortcode has 11 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        function modify_edd_download_shortcode( $display, $atts, $buy_button, $columns, $column_width, $downloads, $excerpt, $full_content, $price, $thumbnails, $query ) {
                    Severity: Major
                    Found in includes/class-maera-edd-shortcodes.php - About 1 hr to fix

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

                      function maera_templates_sidebar() {
                      
                          global $wp_query;
                          $templates = array();
                      
                      
                      Severity: Minor
                      Found in includes/template-hierarchy.php - About 1 hr to fix

                        Method admin_notice has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function admin_notice() {
                        
                                global $current_user ;
                                $user_id = $current_user->ID;
                        
                        
                        Severity: Minor
                        Found in includes/class-maera-admin.php - About 1 hr to fix

                          Method colors has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function colors() {
                          
                                  $thumb_id  = get_post_thumbnail_id( $this->post_id );
                                  $thumb_url = wp_get_attachment_image_src( $thumb_id );
                                  $thumb_url = $thumb_url[0];
                          Severity: Minor
                          Found in includes/class-maera-edd-tonesque.php - About 1 hr to fix

                            Method grab_points has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function grab_points( $type = 'index' ) {
                                    $img = $this->image_obj;
                                    if ( ! $img )
                                        return false;
                            
                            
                            Severity: Minor
                            Found in includes/class-tonesque.php - About 1 hr to fix

                              Method add_settings has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function add_settings( $wp_customize ) {
                              
                                      $wp_customize->add_setting( 'maera_admin_options[shell]', array(
                                          'default'        => 'core',
                                          'type'           => 'option',
                              Severity: Minor
                              Found in includes/class-maera-core-customizer.php - About 1 hr to fix

                                Method colorposts_build_css has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function colorposts_build_css( $styles ) {
                                
                                        $src = $this->custom_header_url();
                                
                                        if ( $src && get_template_directory_uri() . '/core-shell/assets/images/grid-back.png' != $src ) {
                                Severity: Minor
                                Found in core-shell/class-Maera_Shell_Core.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language