CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/class-wp-customize-control.php

Summary

Maintainability
D
2 days
Test Coverage

File class-wp-customize-control.php has 547 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Customize Control Class
 *
 * @package WordPress
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-control.php - About 1 day to fix

    Method render_content has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function render_content() {
            switch( $this->type ) {
                case 'text':
                    ?>
                    <label>
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-control.php - About 2 hrs to fix

      Method print_header_image_template has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function print_header_image_template() {
              ?>
              <script type="text/template" id="tmpl-header-choice">
                  <# if (data.random) { #>
                          <button type="button" class="button display-options random">
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-control.php - About 2 hrs to fix

        Method render_content has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function render_content() {
                $this->print_header_image_template();
                $visibility = $this->get_current_image_src() ? '' : ' style="display:none" ';
                $width = absint( get_theme_support( 'custom-header', 'width' ) );
                $height = absint( get_theme_support( 'custom-header', 'height' ) );
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-control.php - About 1 hr to fix

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

              public function render_content() {
                  $src = $this->value();
                  if ( isset( $this->get_url ) )
                      $src = call_user_func( $this->get_url, $src );
          
          
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-control.php - About 1 hr to fix

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

                protected function render_content() {
                    switch( $this->type ) {
                        case 'text':
                            ?>
                            <label>
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-control.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 __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                function __construct( $manager, $id, $args = array() ) {
                    $keys = array_keys( get_object_vars( $this ) );
                    foreach ( $keys as $key ) {
                        if ( isset( $args[ $key ] ) )
                            $this->$key = $args[ $key ];
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/class-wp-customize-control.php - About 45 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

            There are no issues that match your filters.

            Category
            Status