mambax7/smartfaq

View on GitHub
admin/myblocksadmin.php

Summary

Maintainability
D
2 days
Test Coverage

Function list_blocks has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
Open

function list_blocks(): void
{
    global $query4redirect, $block_arr;

    // cachetime options
Severity: Minor
Found in admin/myblocksadmin.php - About 7 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 list_blocks has 194 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function list_blocks(): void
{
    global $query4redirect, $block_arr;

    // cachetime options
Severity: Major
Found in admin/myblocksadmin.php - About 7 hrs to fix

    File myblocksadmin.php has 304 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php declare(strict_types=1);
    
    /**
     * Module: SmartFAQ
     * Author: The SmartFactory <www.smartfactory.ca>
    Severity: Minor
    Found in admin/myblocksadmin.php - About 3 hrs to fix

      There are no issues that match your filters.

      Category
      Status