Code Analysis: Klarna Checkout for WooCommerce 2.11.6

Function Rating Maintainability Complexity Lines of code
KCO_Fields::fields()
C
20
6 346
KCO_Request_Cart::process_coupons()
C
30 21 121
Klarna_For_WooCommerce_Addons::change_klarna_addon_status()
B
34 21 90
KCO_Templates::override_template()
B
43 19 47
KCO_AJAX::kco_wc_iframe_shipping_address_change()
B
40 17 59
KCO_Gateway::enqueue_scripts()
B
36 16 70
KCO_Request_Create::get_shipping_address_from_order()
A
43 16 45
WC_Klarna_Banners::klarna_banner()
A
38 13 89
kco_get_country_codes()
A
21
1 255
KCO_Request_Create::get_body()
A
39 14 58
KCO_Templates::check_that_kco_template_has_loaded()
A
49 16 25
KCO_Request_Create::get_shipping_address_from_customer()
A
44 14 48
KCO_Gateway::upsell_available()
A
48 14 31
Klarna_For_WooCommerce_Addons::options_page()
A
43 12 53
KCO_Request_Cart::process_cart()
A
42 12 49
KCO_Subscription::set_recurring()
A
41 11 55
KCO_Request_Create::get_billing_address_from_customer()
A
46 12 38
KCO_Request_Create::get_billing_address_from_order()
A
47 12 38
KCO_Templates::add_body_class()
A
49 12 28
KCO_Subscription::set_recurring_token_for_order()
A
46 11 34
KCO_Request_Shipping_Options::get_shipping_options()
A
45 10 39
KCO_Subscription::create_extra_merchant_data()
A
44 9 46
KCO_Subscription::trigger_scheduled_payment()
A
46 9 39
KCO_Settings_Saved::check_if_test_credentials_exists()
A
55 10 19
KCO_Request_Options::get_iframe_colors()
A
51 9 28
KCO_Request_Update::get_body()
A
40 7 56
KCO_Checkout::update_klarna_order()
A
53 9 22
KCO_API_Callbacks::push_cb()
A
46 8 37
KCO_Settings_Saved::check_api_credentials()
A
48 8 34
KCO::add_quantity_field()
A
49 8 30
KCO_Checkout::maybe_register_shipping_error()
A
50 8 29
KCO_Confirmation::run_kepm()
A
50 8 28
KCO_Gateway::process_embedded_payment_handler()
A
45 7 42
kco_confirm_klarna_order()
A
46 7 38
KCO_Request_Order::get_item_reference()
A
52 8 23
KCO_Gateway::add_body_class()
A
55 8 19
Klarna_For_WooCommerce_Addons::get_addon_action_button()
A
47 7 32
KCO_Gateway::is_available()
S
57 8 15
kco_maybe_save_reference()
S
58 8 14
KCO_AJAX::kco_wc_update_cart()
S
50 7 28
KCO_Gateway::admin_enqueue_scripts()
S
50 7 28
KCO_Subscription::handle_push_cb_for_payment_method_change()
S
51 7 24
kco_update_wc_shipping()
S
53 7 22
KCO_Checkout::update_shipping_method()
S
54 7 21
KCO_Gateway::save_metadata_to_order()
S
52 7 21
KCO_Gateway::show_thank_you_snippet()
S
55 7 19
KCO_Request_Cart::get_shipping_name()
S
55 7 18
KCO_Request_Cart::get_shipping_reference()
S
55 7 18
KCO_Request_Order::get_order_line_items()
S
49 6 30
KCO_Email::add_klarna_data_to_mail()
S
50 6 29
KCO_AJAX::kco_wc_get_klarna_order()
S
51 6 27
kco_wc_prefill_allowed()
S
60 7 12
KCO_AJAX::kco_wc_change_payment_method()
S
51 6 26
KCO_Request_Options::get_options()
S
51 6 25
KCO_Request_Cart::process_fees()
S
46 5 40
KCO_Settings_Saved::process_test_response()
S
54 6 21
KCO_Request_Options::get_allowed_customer_types()
S
55 6 19
KCO_Logger::get_stack()
S
55 6 18
KCO_Subscription::show_recurring_token()
S
50 5 32
KCO_Request::process_response()
S
56 6 17
kco_wc_prefill_consent()
S
49 5 32
KCO_Admin_Notices::check_optimize()
S
57 6 15
KCO_Subscription::update_subscription_address()
S
49 5 29
Klarna_For_WooCommerce_Addons::install_plugin()
S
51 5 28
KCO_Logger::log()
S
59 6 13
KCO_Logger::format_log()
S
51 5 27
kco_create_or_update_order_pay_for_order()
S
52 5 27
kco_create_or_update_order()
S
54 5 24
KCO_Gateway::process_payment()
S
53 5 24
KCO::init_gateways()
S
43 3 52
kco_convert_region()
S
54 5 21
KCO_Request_Cart::get_item_tax_rate()
S
56 5 19
KCO_Credentials::get_credentials_from_session()
S
55 5 19
KCO_Request_Cart::process_shipping()
S
55 5 18
Klarna_For_WooCommerce_Addons::get_addons()
S
57 5 16
kco_maybe_save_org_nr()
S
62 6 10
KCO_Confirmation::confirm_order()
S
58 5 15
KCO_Request_Order::get_order_line_tax_rate()
S
59 5 14
KCO_Admin_Notices::check_terms()
S
58 5 13
KCO_Request_Cart::get_order_tax_amount()
S
60 5 13
KCO_Request::get_purchase_country()
S
61 5 11
KCO_Gateway::check_if_eu()
S
43 2 55
kco_get_order_by_klarna_id()
S
53 4 23
KCO_Admin_Notices::check_permalinks()
S
56 4 16
KCO_API_Callbacks::notification_cb()
S
57 4 16
KCO_API::update_klarna_order()
S
57 4 16
KCO_Templates::kco_wc_unrequire_wc_shipping_state_field()
S
64 5 9
KCO_Templates::kco_wc_unrequire_wc_billing_state_field()
S
64 5 9
KCO_Admin_Notices::version_warning_message()
S
57 4 15
KCO_Admin_Notices::check_hide_action()
S
62 5 10
WC_Klarna_Banners::get_go_live_url()
S
57 4 15
kco_wc_show_another_gateway_button()
S
59 4 14
KCO_Admin_Notices::check_autoptimize()
S
58 4 14
KCO_Admin_Notices::check_klarna_upstream()
S
57 4 14
KCO_Request_Cart::get_shipping_tax_rate()
S
59 4 14
KCO_Request_Order::get_order_lines()
S
59 4 14
KCO_Request_Update::request()
S
57 4 14
KCO_Admin_Notices::check_https()
S
59 4 13
KCO_AJAX::kco_wc_log_js()
S
60 4 12
kco_wc_get_selected_payment_method()
S
62 4 11
kco_maybe_save_surcharge()
S
62 4 11
KCO_Request_Cart::get_order_amount()
S
62 4 11
KCO_Gateway::__construct()
S
43 1 50
Klarna_For_WooCommerce_Addons::get_addon_status()
S
56 3 19
KCO_AJAX::add_ajax_events()
S
56 3 18
KCO_Subscription::change_return_url_for_recurring_change_payment_method()
S
57 3 17
KCO_Gateway::add_shipping_reference()
S
60 3 15
KCO_Subscription::check_if_subscription()
S
70 4 6
KCO_Request_Options::show_subtotal_detail()
S
68 4 6
is_kco_confirmation()
S
70 4 6
KCO_Request_Test_Credentials::process_response()
S
63 4 10
KCO_Gateway::add_billing_org_nr()
S
60 3 15
KCO_Gateway::add_billing_reference()
S
60 3 15
KCO_Request_Cart::get_order_lines_total_amount()
S
63 4 10
KCO_GDPR::maybe_add_privacy_policy_text()
S
64 4 9
KCO_Settings_Saved::maybe_show_errors()
S
62 3 14
KCO_Request_Cart::get_item_discount_amount()
S
60 3 14
KCO_Request_Order::get_fee_total_amount()
S
59 3 13
KCO_Request_Order::get_item_total_amount()
S
59 3 13
Klarna_For_WooCommerce_Addons::enqueue_css()
S
60 3 12
KCO_Request_Order::get_shipping_total_tax_amount()
S
60 3 12
KCO_Request_Order::get_fee_total_tax_amount()
S
60 3 12
KCO_Request_Options::additional_checkboxes()
S
61 3 12
kco_wc_show_snippet()
S
63 3 11
WC_Klarna_Banners::settings_sidebar()
S
54 1 40
KCO_Gateway::process_redirect_handler()
S
53 2 22
KCO_Merchant_URLs::get_confirmation_url()
S
56 2 21
KCO_Request_Cart::adjust_order_lines()
S
55 2 19
KCO_Templates::add_wc_form()
S
58 2 18
KCO_Request_Cart::process_sales_tax()
S
57 2 17
KCO_GDPR::privacy_declarations()
S
59 2 16
KCO_Gateway::admin_footer_text()
S
67 3 7
KCO_Request::get_api_url_base()
S
68 3 6
KCO_Gateway::prefill_consent()
S
66 3 8
KCO_Gateway::maybe_remove_kco_epm()
S
70 3 6
KCO_Subscription::is_kco_subs_change_payment_method()
S
66 3 8
KCO_Request_Options::get_nin_validation_mandatory()
S
74 3 4
KCO_Request_Options::check_option_field()
S
70 3 6
KCO_Subscription::save_kco_recurring_token_update()
S
65 3 8
KCO_Subscription::display_thankyou_message_for_payment_method_change()
S
67 3 7
KCO_Merchant_URLs::get_session_id()
S
65 3 8
KCO_Request_Order::get_order_line_fees()
S
57 2 15
KCO_Request_Order::get_upsell_order_lines()
S
64 3 9
KCO_Request_Cart::__construct()
S
64 3 10
KCO_Request_Options::get_purchase_country()
S
66 3 8
KCO_Gateway::maybe_change_needs_payment()
S
66 3 9
KCO_Request_Test_Credentials::get_test_endpoint()
S
71 3 5
KCO_Checkout::add_shipping_data_input()
S
59 2 14
KCO_Request_Order::get_order_line_shipping()
S
59 2 13
KCO_Admin_Notices::check_settings()
S
61 2 13
KCO_Request_Order::get_item_total_tax_amount()
S
62 2 11
KCO::init()
S
63 2 11
KCO_Request_Create_Recurring::request()
S
60 2 11
KCO_Request_Create::request()
S
60 2 11
KCO_Request_Update_Confirmation::get_body()
S
52 1 26
KCO_Request_Create_HPP::get_body()
S
55 1 21
KCO_Request_Test_Credentials::get_body()
S
55 1 21
KCO_Request_Order::get_item_unit_price()
S
65 2 8
KCO_Templates::get_instance()
S
71 2 6
KCO_Request_Options::get_dob_mandatory()
S
74 2 4
KCO_Request_Cart::get_item_price()
S
67 2 8
KCO_Logger::format_data()
S
69 2 6
kco_print_error_message()
S
70 2 7
KCO::get_instance()
S
71 2 6
kco_wc_show_order_notes()
S
67 2 8
KCO_Settings_Saved::maybe_handle_error()
S
69 2 7
KCO_GDPR::kco_wc_display_privacy_policy_text()
S
74 2 5
KCO_Request_Options::get_title_mandatory()
S
74 2 4
KCO_Request_Options::get_allow_separate_shipping_address()
S
74 2 4
KCO_Request_Options::add_hash_to_color()
S
68 2 7
KCO_API::check_for_api_error()
S
70 2 7
KCO_Subscription::maybe_confirm_change_payment_method()
S
66 2 8
KCO_API::get_snippet()
S
69 2 7
KCO_Request_Merchant_Data::get_merchant_data()
S
66 2 8
KCO_Request_Order::get_fee_unit_price()
S
64 2 9
KCO_Request_Order::get_shipping_total_amount()
S
65 2 8
KCO_Confirmation::check_if_external_payment()
S
66 2 8
KCO_Request_Upsell_Order::process_response()
S
70 2 6
Klarna_Skin::set_upgrader()
S
74 2 5
Klarna_Skin::error()
S
70 2 6
KCO_Request_Cart::get_shipping_tax_amount()
S
63 2 10
Klarna_For_WooCommerce_Addons::get_instance()
S
71 2 6
KCO_API_Callbacks::get_instance()
S
71 2 6
KCO_Gateway::address_notice()
S
69 2 7
KCO_Gateway::upsell()
S
66 2 8
KCO_Admin_Notices::__construct()
S
67 2 7
KCO_Subscription::set_recurring_token_for_subscription()
S
66 2 8
KCO_Request_Cart::get_shipping_amount()
S
67 2 8
KCO_Request_Options::get_shipping_details()
S
71 2 6
KCO_Request_Cart::get_item_tax_amount()
S
63 2 10
KCO_Request_Cart::get_item_total_amount()
S
68 2 8
KCO_Request_Cart::get_item_image_url()
S
67 2 8
KCO_Checkout::maybe_throw_shipping_error()
S
68 2 7
KCO_Confirmation::get_instance()
S
71 2 6
KCO_Logger::log_to_db()
S
63 2 10
KCO_Request::__construct()
S
65 2 9
KCO_Admin_Notices::get_instance()
S
71 2 6
KCO_Request_Cart::get_item_reference()
S
67 2 8
KCO::declare_wc_compatibility()
S
71 2 5
KCO_Subscription::__construct()
S
59 1 13
KCO_Request_Create_Recurring::get_body()
S
60 1 13
KCO_Templates::__construct()
S
60 1 12
KCO_Request_Test_Credentials::get_request_args()
S
61 1 12
KCO_Merchant_URLs::get_checkout_url()
S
75 1 4
KCO_Gateway::admin_options()
S
68 1 8
Klarna_Skin::set_result()
S
81 1 3
KCO_Request_Test_Credentials::request()
S
62 1 10
KCO_Request_Countries::get_shipping_countries()
S
75 1 4
KCO_API_Callbacks::address_update_cb()
S
91 1 2
Klarna_Skin::__construct()
S
81 1 3
KCO_API_Callbacks::kco_wc_punted_notification_cb()
S
79 1 3
WC_Klarna_Banners::hide_klarna_banner()
S
75 1 4
KCO_Request_Order::get_total_tax()
S
80 1 3
KCO_API::get_klarna_om_order()
S
73 1 5
KCO_API::update_klarna_confirmation()
S
72 1 5
KCO_Request_Get_Order::get_request_args()
S
67 1 8
KCO_Status::add_status_page_box()
S
80 1 3
kco_unset_sessions()
S
74 1 5
KCO_Gateway::init_form_fields()
S
80 1 3
KCO_Request_Retrieve::request()
S
62 1 10
WC_Klarna_Banners::load_admin_css()
S
69 1 8
KCO_Settings_Saved::__construct()
S
75 1 4
KCO_Request_Cart::get_item_quantity()
S
79 1 3
kco_add_inline_script()
S
69 1 6
KCO::__clone()
S
79 1 3
KCO_API::create_klarna_hpp_url()
S
72 1 5
KCO_Request_Countries::get_billing_countries()
S
75 1 4
KCO_Merchant_URLs::get_terms_url()
S
75 1 4
KCO_API::request_pre_create_order()
S
70 1 6
KCO_API::create_recurring_order()
S
72 1 5
kco_wc_country_code_converter()
S
75 1 4
KCO_Merchant_URLs::get_address_update_url()
S
72 1 5
Klarna_For_WooCommerce_Addons::add_menu()
S
77 1 3
KCO_Status::__construct()
S
79 1 3
KCO_Gateway::get_icon()
S
72 1 5
KCO_Request_Cart::process_data()
S
67 1 9
KCO_Request_Create_HPP::get_request_args()
S
64 1 9
KCO_Request_Upsell_Order::request()
S
62 1 10
KCO_Request_Acknowledge_Order::request()
S
62 1 10
KCO_Request_Acknowledge_Order::get_request_args()
S
67 1 8
KCO_Request_Update::get_request_args()
S
65 1 9
Klarna_For_WooCommerce_Addons::__construct()
S
72 1 5
KCO_Request_Options::__construct()
S
80 1 3
KCO_WC()
S
82 1 3
KCO_API::set_merchant_reference()
S
72 1 5
KCO_Request_Cart::get_item_discount_rate()
S
73 1 4
KCO_Request_Upsell_Order::get_body()
S
66 1 8
KCO_Request_Cart::format_number()
S
77 1 3
KCO_Confirmation::__construct()
S
75 1 4
KCO_API::upsell_klarna_order()
S
68 1 7
KCO_Request_Create::get_request_args()
S
64 1 9
KCO_Request_Set_Merchant_Reference::request()
S
62 1 10
KCO_Subscription::extend_allowed_domains_list()
S
74 1 5
KCO_Templates::add_review_order_before_submit()
S
81 1 3
KCO_Email::__construct()
S
78 1 3
KCO_API::create_klarna_order()
S
72 1 5
KCO_Credentials::__construct()
S
80 1 3
Klarna_Skin::header()
S
98 1 1
KCO_Request_Get_Order::request()
S
62 1 10
KCO::add_gateways()
S
77 1 4
WC_Klarna_Banners::get_playground_credentials_url()
S
81 1 3
KCO::__construct()
S
71 1 5
KCO_Gateway::process_refund()
S
78 1 3
KCO_API_Callbacks::__construct()
S
69 1 6
KCO_Merchant_URLs::get_push_url()
S
65 1 10
KCO::plugin_action_links()
S
66 1 8
KCO_API::request_pre_get_order()
S
70 1 6
KCO_API::get_klarna_order()
S
73 1 5
KCO_GDPR::__construct()
S
75 1 4
KCO_Request_Update_Confirmation::get_request_args()
S
64 1 9
kco_wc_add_extra_checkout_fields()
S
71 1 8
kco_extract_script()
S
67 1 9
KCO_Request_Retrieve::get_request_args()
S
67 1 8
KCO_Request_Cart::get_item_product_url()
S
81 1 3
Klarna_Skin::feedback()
S
91 1 2
KCO_Request::get_merchant_id()
S
76 1 4
KCO_AJAX::init()
S
80 1 3
KCO_Merchant_URLs::get_urls()
S
64 1 10
KCO_Merchant_URLs::get_notification_url()
S
75 1 4
KCO_Request_Cart::get_order_lines()
S
80 1 3
KCO_API::request_pre_update_order()
S
70 1 6
KCO_Request_Create_Recurring::get_request_args()
S
65 1 9
KCO_Request::get_request_headers()
S
70 1 6
KCO_API::acknowledge_klarna_order()
S
73 1 5
WC_Klarna_Banners::__construct()
S
70 1 6
KCO_Request_Upsell_Order::get_request_args()
S
65 1 9
KCO_API::get_order()
S
69 1 6
KCO_Request_Update_Confirmation::request()
S
62 1 10
KCO::get_setting_link()
S
64 1 10
KCO_Request_Cart::get_item_name()
S
74 1 4
KCO_Request::get_shared_secret()
S
76 1 4
KCO_Request_Create_HPP::request()
S
62 1 10
KCO_Checkout::__construct()
S
67 1 7
KCO_Request_Set_Merchant_Reference::get_body()
S
69 1 7
KCO_Request_Set_Merchant_Reference::get_request_args()
S
65 1 9
Klarna_For_WooCommerce_Addons::get_dynamic_content()
S
70 1 6
KCO_Request_Order::get_order_amount()
S
75 1 4
KCO_Request::get_user_agent()
S
69 1 6
KCO_Merchant_URLs::get_shipping_option_update_url()
S
72 1 5
KCO_Merchant_URLs::get_country_change_url()
S
72 1 5
KCO_API::request_post_get_order()
S
70 1 6
Klarna_Skin::footer()
S
98 1 1
KCO::__wakeup()
S
79 1 3