picandocodigo/List-Category-Posts

View on GitHub
include/lcp-taxonomies.php

Summary

Maintainability
A
2 hrs
Test Coverage

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

  private function check_multiple_taxonomies( $params, &$tax_query ) {
    // Multiple taxonomies support in the form
    // taxonomies_or="tax1:{term1_1,term1_2};tax2:{term2_1,term2_2,term2_3}"
    // taxonomies_and="tax1:{term1_1,term1_2};tax2:{term2_1,term2_2,term2_3}"
    if ( !empty( $params[ 'taxonomies_or' ] ) ||
Severity: Minor
Found in include/lcp-taxonomies.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 check_current_terms has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  private function check_current_terms( $params, &$tax_query ) {
    $currentterms = $params[ 'currentterms' ];
    if ( $currentterms === 'yes' || $currentterms === 'all' ) {
      $terms = $this->get_current_terms( $params[ 'taxonomy' ] );

Severity: Minor
Found in include/lcp-taxonomies.php - About 55 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