CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-admin/includes/class-wp-terms-list-table.php

Summary

Maintainability
D
1 day
Test Coverage

Function _rows has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {

        $end = $start + $per_page;

        foreach ( $terms as $key => $term ) {

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

File class-wp-terms-list-table.php has 275 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Terms List Table class.
 *
 * @package WordPress

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

        function inline_edit() {
            $tax = get_taxonomy( $this->screen->taxonomy );
    
            if ( ! current_user_can( $tax->cap->edit_terms ) )
                return;

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

          function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {
      
              $end = $start + $per_page;
      
              foreach ( $terms as $key => $term ) {

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

            function display_rows_or_placeholder() {
                $taxonomy = $this->screen->taxonomy;
        
                $args = wp_parse_args( $this->callback_args, array(
                    'page' => 1,

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

              function display_rows_or_placeholder() {
                  $taxonomy = $this->screen->taxonomy;
          
                  $args = wp_parse_args( $this->callback_args, array(
                      'page' => 1,

          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 _rows has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {

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

                function inline_edit() {
                    $tax = get_taxonomy( $this->screen->taxonomy );
            
                    if ( ! current_user_can( $tax->cap->edit_terms ) )
                        return;
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-terms-list-table.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

            There are no issues that match your filters.

            Category
            Status