felixarntz/theme-boilerplate

View on GitHub

Showing 153 of 194 total issues

Method print_base_color_style_button has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function print_base_color_style_button() {
        $button_text_color                     = $this->get( 'button_text_color' );
        $button_background_color               = $this->get( 'button_background_color' );
        $button_background_focus_color         = $this->util()->darken_color( $button_background_color, 25 );
        $button_primary_text_color             = $this->get( 'button_primary_text_color' );
Severity: Major
Found in inc/library/colors/class-colors.php - About 2 hrs to fix

    Function handler has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function handler(event) {
            var orgEvent   = event || window.event,
                args       = slice.call(arguments, 1),
                delta      = 0,
                deltaX     = 0,
    Severity: Major
    Found in assets/vendor/selectWoo/dist/js/selectWoo.full.js - About 2 hrs to fix

      Method print_color_style_css has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function print_color_style_css() {
      
              /**
               * Fires when the custom color styles are printed inside a style tag.
               *
      Severity: Major
      Found in inc/library/colors/class-colors.php - About 2 hrs to fix

        Function fromElement has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          Options.prototype.fromElement = function ($e) {
            var excludedData = ['select2'];
        
            if (this.options.multiple == null) {
              this.options.multiple = $e.prop('multiple');
        Severity: Major
        Found in assets/vendor/selectWoo/dist/js/selectWoo.full.js - About 2 hrs to fix

          Function normalize has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function normalize(name, baseName) {
                  var nameParts, nameSegment, mapValue, foundMap, lastIndex,
                      foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
                      baseParts = baseName && baseName.split("/"),
                      map = config.map,
          Severity: Major
          Found in assets/vendor/selectWoo/dist/js/selectWoo.full.js - About 2 hrs to fix

            File class-widget.php has 275 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Super_Awesome_Theme_Widget class
             *
             * @package Super_Awesome_Theme
            Severity: Minor
            Found in inc/library/widgets/class-widget.php - About 2 hrs to fix

              Function register_customize_partials has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function register_customize_partials( $customizer ) {
                      $customizer->add_panel( 'content_types', array(
                          Super_Awesome_Theme_Customize_Panel::PROP_TITLE    => __( 'Content Types', 'super-awesome-theme' ),
                          Super_Awesome_Theme_Customize_Panel::PROP_PRIORITY => 140,
                      ) );
              Severity: Minor
              Found in inc/library/content-types/class-content-types.php - About 2 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 render_form_field has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function render_form_field( $id, $args, $value ) {
                      $control_id     = $this->get_field_id( $id );
                      $control_name   = $this->get_field_name( $id );
                      $type           = $args[ self::FIELD_ARG_TYPE ];
                      $title          = $args[ self::FIELD_ARG_TITLE ];
              Severity: Minor
              Found in inc/library/widgets/class-widget.php - About 2 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 fetch_families has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function fetch_families() {
                      $filename = get_theme_file_path( 'assets/resources/google-webfonts.json' );
                      if ( ! file_exists( $filename ) ) {
                          return array();
                      }
              Severity: Minor
              Found in inc/library/fonts/class-google-webfont-api.php - About 2 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 calculate_content_image_sizes has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function calculate_content_image_sizes( $sizes, $size ) {
                      $settings = $this->get_dependency( 'settings' );
                      $sidebar  = $this->get_dependency( 'sidebar' );
              
                      $rem         = 16;
              Severity: Major
              Found in inc/library/image-sizes/class-image-sizes.php - About 2 hrs to fix

                Super_Awesome_Theme_Colors has 22 functions (exceeds 20 allowed). Consider refactoring.
                Open

                final class Super_Awesome_Theme_Colors extends Super_Awesome_Theme_Theme_Component_Base {
                
                    /**
                     * Utility methods instance.
                     *
                Severity: Minor
                Found in inc/library/colors/class-colors.php - About 2 hrs to fix

                  Method super_awesome_theme_wpsi_render_styles has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function super_awesome_theme_wpsi_render_styles( $id, $colors ) {
                      ?>
                      <style id="<?php echo esc_attr( $id ); ?>" type="text/css">
                          <?php if ( ! empty( $colors['primary'] ) ) : ?>
                              a,
                  Severity: Major
                  Found in inc/plugin-compat/wp-site-identity.php - About 2 hrs to fix

                    Function reset has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      Defaults.prototype.reset = function () {
                        function stripDiacritics (text) {
                          // Used 'uni range + named function' from http://jsperf.com/diacritics/18
                          function match(a) {
                            return DIACRITICS[a] || a;
                    Severity: Major
                    Found in assets/vendor/selectWoo/dist/js/selectWoo.full.js - About 2 hrs to fix

                      Function ensure_inline_widgets_whitelist has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function ensure_inline_widgets_whitelist( $sidebars_widgets ) {
                              foreach ( $this->inline_widget_areas as $widget_area_id ) {
                                  if ( empty( $sidebars_widgets[ $widget_area_id ] ) ) {
                                      continue;
                                  }
                      Severity: Minor
                      Found in inc/library/widgets/class-widgets.php - About 2 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 get_fonts_url has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function get_fonts_url( array $fonts ) {
                              $font_families = array();
                      
                              foreach ( $fonts as $font ) {
                                  if ( ! $font['family'] instanceof Super_Awesome_Theme_Webfont_Family ) {
                      Severity: Minor
                      Found in inc/library/fonts/class-google-webfont-api.php - About 2 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 register_customize_controls_js has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function register_customize_controls_js( $assets ) {
                              $data = array(
                                  'groups'           => array(),
                                  'fonts'            => array(),
                                  'fontFamilyGroups' => array(),
                      Severity: Major
                      Found in inc/library/fonts/class-fonts.php - About 2 hrs to fix

                        Method handle_ajax_comment has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function handle_ajax_comment( $id, $status ) {
                                if ( empty( $_GET['is_ajax'] ) || 'true' !== $_GET['is_ajax'] ) {
                                    return;
                                }
                        
                        
                        Severity: Major
                        Found in inc/library/comments/class-comments.php - About 2 hrs to fix

                          Function option has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            Results.prototype.option = function (data) {
                              var option = document.createElement('li');
                              option.className = 'select2-results__option';
                          
                              var attrs = {
                          Severity: Major
                          Found in assets/vendor/selectWoo/dist/js/selectWoo.full.js - About 2 hrs to fix

                            Method get_for_post has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function get_for_post( $post = null ) {
                                    $post = get_post( $post );
                                    if ( ! $post ) {
                                        return false;
                                    }
                            Severity: Major
                            Found in inc/library/content-types/class-attachment-metadata.php - About 2 hrs to fix

                              Method register_customize_partial has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function register_customize_partial( $customizer ) {
                                      $partial_fonts     = array();
                                      $has_default_group = false;
                                      foreach ( $this->fonts as $id => $font ) {
                                          if ( $font->get_prop( Super_Awesome_Theme_Font::PROP_LIVE_PREVIEW ) ) {
                              Severity: Major
                              Found in inc/library/fonts/class-fonts.php - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language