Function process_itineraries
has a Cognitive Complexity of 121 (exceeds 25 allowed). Consider refactoring. Open
public function process_itineraries( $data, $id, $importable_content ) {
$day_counter = 1;
$leg_counter = 0;
// Change this to check for a parameter
- 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 process_ajax_search
has a Cognitive Complexity of 109 (exceeds 25 allowed). Consider refactoring. Open
public function process_ajax_search() {
$return = false;
check_ajax_referer( 'lsx_wetu_ajax_action', 'security' );
if ( isset( $_POST['action'] ) && 'lsx_tour_importer' === $_POST['action'] && isset( $_POST['type'] ) && $_POST['type'] === $this->tab_slug ) {
- 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 attach_destination_images
has a Cognitive Complexity of 47 (exceeds 25 allowed). Consider refactoring. Open
public function attach_destination_images( $importable_content = array() ) {
if ( false !== $this->destination_images ) {
$this->shuffle_assoc( $this->destination_images );
foreach ( $this->destination_images as $tour => $destinations ) {
shuffle( $destinations );
- 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
LSX_WETU_Importer_Tours
has 35 functions (exceeds 25 allowed). Consider refactoring. Open
class LSX_WETU_Importer_Tours extends LSX_WETU_Importer {
/**
* The url to list items from WETU
*
Function set_destination
has a Cognitive Complexity of 41 (exceeds 25 allowed). Consider refactoring. Open
public function set_destination( $day, $id, $leg_counter ) {
$dest_id = false;
$country_id = false;
$this->current_destinations = $this->find_current_destinations();
- 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"