Function upgrade_legacy_form_meta
has a Cognitive Complexity of 118 (exceeds 5 allowed). Consider refactoring. Open
public function upgrade_legacy_form_meta( $form_id ) {
global $wpdb;
$prefix = $this->get_prefix();
- 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
File legacy-upgrades.php
has 473 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Legacy upgrades class
*
* @package TorroForms
Method upgrade_legacy_form_meta
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upgrade_legacy_form_meta( $form_id ) {
global $wpdb;
$prefix = $this->get_prefix();
Function upgrade_legacy_settings
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public function upgrade_legacy_settings() {
$prefix = $this->get_prefix();
$general_mappings = array(
'modules' => array( $prefix . 'settings_general_modules', 'modules' ),
- 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 upgrade_legacy_settings
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upgrade_legacy_settings() {
$prefix = $this->get_prefix();
$general_mappings = array(
'modules' => array( $prefix . 'settings_general_modules', 'modules' ),
Method upgrade_to_1_0_10
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function upgrade_to_1_0_10() {
global $wpdb;
$containers = $this->get_full_table_name( 'containers' );
$elements = $this->get_full_table_name( 'elements' );
Method upgrade
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upgrade( $legacy_db_version ) {
$last_legacy_db_version = '1.0.10';
if ( $legacy_db_version === $last_legacy_db_version ) {
return;
Method maybe_upgrade_legacy_form_attachment_statuses
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function maybe_upgrade_legacy_form_attachment_statuses() {
global $wpdb;
if ( get_option( $this->get_prefix() . 'legacy_attachments_need_migration' ) !== 'true' ) {
return false;
Function upgrade
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function upgrade( $legacy_db_version ) {
$last_legacy_db_version = '1.0.10';
if ( $legacy_db_version === $last_legacy_db_version ) {
return;
- 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_upgrade_legacy_form_attachment_statuses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function maybe_upgrade_legacy_form_attachment_statuses() {
global $wpdb;
if ( get_option( $this->get_prefix() . 'legacy_attachments_need_migration' ) !== 'true' ) {
return false;
- 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"