Function modify_index
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function modify_index($iname)
{
global $dbhandle, $indices, $fb_error, $lsql;
// alter the active/inactive status if the change was selected
- Read upRead up
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 index_definition
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function index_definition($indexname, $title)
{
global $indices, $acc_strings;
if ($indexname != null && !isset($_POST['acc_modind_doit'])) {
Method modify_index
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function modify_index($iname)
{
global $dbhandle, $indices, $fb_error, $lsql;
// alter the active/inactive status if the change was selected
Method get_index_table
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_index_table($indices, $order, $dir)
{
global $acc_strings;
$name_url = url_session($_SERVER['PHP_SELF'].'?idxorder=1&order=name');
Method create_index
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create_index()
{
global $dbhandle, $indices, $fb_error, $lsql;
$lsql = 'CREATE ';
Method get_indices
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_indices($order, $dir)
{
global $dbhandle;
$order_field = ($order == 'name') ? 'I.RDB$INDEX_NAME' : 'I.RDB$RELATION_NAME';
Function create_index
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function create_index()
{
global $dbhandle, $indices, $fb_error, $lsql;
$lsql = 'CREATE ';
- Read upRead up
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
Consider simplifying this complex logical expression. Open
if ($indices[$iname]['table'] != $_POST['def_index_table']
|| $iname != $_POST['def_index_name']
|| $indices[$iname]['dir'] != $_POST['def_index_dir']
|| $indices[$iname]['uniq'] != $uniq_flag
|| $indices[$iname]['active'] != $acti_flag
Function index_definition
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function index_definition($indexname, $title)
{
global $indices, $acc_strings;
if ($indexname != null && !isset($_POST['acc_modind_doit'])) {
- Read upRead up
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
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;