Function customer_tokens_exporter
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function customer_tokens_exporter( $email_address, $page ) {
$data = array();
$user = get_user_by( 'email', $email_address );
- 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 remove_order_personal_data
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function remove_order_personal_data( $order ) {
$order = wc_get_order( $order );
// ensure we have a full order object and it belongs to the plugin's gateway
- 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 add_export_customer_data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function add_export_customer_data( $data, $customer ) {
if ( $customer instanceof \WC_Customer ) {
foreach ( $this->get_plugin()->get_gateways() as $gateway ) {
- 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 customer_tokens_eraser
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function customer_tokens_eraser( $email_address, $page ) {
$removed = false;
$messages = array();
- 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 customer_tokens_exporter
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function customer_tokens_exporter( $email_address, $page ) {
$data = array();
$user = get_user_by( 'email', $email_address );
Function add_export_order_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function add_export_order_data( $data, $order ) {
$order = wc_get_order( $order );
// ensure we have a full order object and it belongs to the plugin's gateway
- 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 remove_customer_personal_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function remove_customer_personal_data( $response, $customer ) {
if ( $customer instanceof \WC_Customer ) {
foreach ( $this->get_plugin()->get_gateways() as $gateway ) {
- 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"