skyverge/wc-plugin-framework

View on GitHub
woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php

Summary

Maintainability
D
1 day
Test Coverage

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 );

Severity: Minor
Found in woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php - About 5 hrs to fix

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
Severity: Minor
Found in woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php - About 2 hrs to fix

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 ) {
Severity: Minor
Found in woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php - About 1 hr to fix

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();

Severity: Minor
Found in woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php - About 1 hr to fix

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 );

Severity: Minor
Found in woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php - About 1 hr to fix

    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
    Severity: Minor
    Found in woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php - About 1 hr to fix

    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 ) {
    Severity: Minor
    Found in woocommerce/payment-gateway/class-sv-wc-payment-gateway-privacy.php - About 1 hr to fix

    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

    There are no issues that match your filters.

    Category
    Status