Function check_column
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) {
global $wpdb, $debug;
$diffs = 0;
$results = $wpdb->get_results("DESC $table_name");
- 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
Function maybe_add_column
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function maybe_add_column($table_name, $column_name, $create_ddl) {
global $wpdb, $debug;
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($debug) echo("checking $column == $column_name<br />");
- 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 check_column
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) {
global $wpdb, $debug;
$diffs = 0;
$results = $wpdb->get_results("DESC $table_name");
Function maybe_drop_column
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function maybe_drop_column($table_name, $column_name, $drop_ddl) {
global $wpdb;
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
//found it try to drop it.
- 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
Function maybe_create_table
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function maybe_create_table($table_name, $create_ddl) {
global $wpdb;
foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
if ($table == $table_name) {
return true;
- 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 check_column
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) {