Code Analysis: Klarna for WooCommerce 3.8.3

Function Rating Maintainability Complexity Lines of code
KP_Assets::express_button_placement()
B
40 16 56
KP_AJAX::kp_wc_place_order()
A
40 14 60
WC_Gateway_Klarna_Payments::upsell_available()
A
48 14 32
KP_Order_Data::get_klarna_order_line_object()
A
43 13 45
KP_Session::get_session()
A
50 13 26
KP_Callbacks::kp_wc_authorization()
A
42 11 50
KP_Order_Data::get_klarna_order_lines_array()
A
46 11 38
KP_Settings_Page::credentials_html()
A
47 11 35
KP_AJAX::kp_wc_auth_failed()
A
48 11 29
WC_Gateway_Klarna_Payments::country_currency_check()
A
47 10 32
WC_Gateway_Klarna_Payments::process_checkout_order()
A
43 9 46
KP_Callbacks::process_hpp_redirect()
A
45 9 41
KP_Form_Fields::get_form_fields()
A
48 9 34
KP_Order_Data::get_klarna_customer_object()
A
44 8 46
KP_Settings_Saved::process_test_response()
A
49 9 29
KP_Settings_Saved::check_api_credentials()
A
47 8 36
KP_Klarna_Express_Checkout::finalize_callback()
A
45 7 44
WC_Gateway_Klarna_Payments::process_blocks_order()
A
47 7 34
kp_get_client_id()
S
57 8 15
kp_is_country_available()
S
52 7 23
WC_Gateway_Klarna_Payments::is_available()
S
55 7 20
KP_Form_Fields::get_credential_section_fields()
S
38 3 80
KP_Assets::express_button_script_tag()
S
55 7 17
KP_Assets::enqueue_express_button()
S
56 7 16
KP_Requests::set_credentials()
S
58 7 13
KP_Email::add_klarna_data_to_mail()
S
50 6 28
KP_Assets::get_checkout_params()
S
45 5 41
KP_Form_Fields::available_countries()
S
43 4 50
KP_Session::set_session_data()
S
55 6 18
KP_Form_Fields::get_kp_section_fields()
S
37 1 92
kp_get_klarna_country()
S
57 6 17
KP_Settings_Page::credentials_fields_html()
S
49 5 30
kp_print_error_message()
S
60 6 13
KP_Logger::log()
S
59 6 13
WC_Gateway_Klarna_Payments::get_icon()
S
52 5 23
WC_Gateway_Klarna_Payments::set_payment_method_title()
S
55 5 21
kp_save_order_meta_data()
S
54 5 18
kp_get_client_id_by_currency()
S
57 5 17
KP_Session::maybe_get_order()
S
58 5 16
KP_AJAX::kp_wc_express_button()
S
48 4 31
WC_Klarna_Payments::init()
S
49 4 30
WC_Klarna_Payments::init_composer()
S
60 5 14
KP_Logger::handle_wp_hook()
S
57 5 14
WC_Gateway_Klarna_Payments::override_kp_payment_option()
S
60 5 13
WC_Klarna_Payments::order_management_check()
S
62 5 12
KP_Assets::enqueue_admin_script()
S
55 4 22
KP_Subscription::process_scheduled_payment()
S
53 4 22
KP_Assets::enqueue_checkout_script()
S
54 4 21
KP_Settings_Page::section_end_html()
S
56 4 20
KP_Subscription::get_recurring_tokens()
S
59 4 15
KP_Subscription::cart_has_subscription()
S
69 5 6
KP_Settings_Page::preload_fonts()
S
64 5 9
KP_Session::process_result()
S
61 4 12
KP_AJAX::kp_wc_log_js()
S
61 4 11
KP_Requests::get_error_message()
S
61 4 11
KP_Subscription::set_subscription_as_captured()
S
62 4 11
WC_Klarna_Payments::check_permalinks()
S
53 3 25
KP_Settings_Page::section_start_html()
S
53 3 25
KP_Subscription::handle_redirect_from_change_payment_method()
S
54 3 22
WC_Klarna_Payments::missing_autoloader()
S
58 3 19
KP_Order_Data::get_klarna_order_object()
S
55 3 18
KP_IFrame::init()
S
63 4 10
KP_Subscription::cancel_scheduled_payment()
S
58 3 15
KP_Api::check_for_api_error()
S
64 4 9
WC_Gateway_Klarna_Payments::process_payment()
S
64 4 10
KP_AJAX::add_ajax_events()
S
59 3 15
KP_Logger::get_name_of_hook_function()
S
65 4 9
KP_Settings_Saved::maybe_show_errors()
S
62 3 14
WC_Gateway_Klarna_Payments::get_settings_page_args()
S
60 3 13
KP_Subscription::set_subscription_to_free()
S
60 3 13
KP_Requests_Post::get_order_data()
S
61 3 12
KP_Subscription::set_tokenize_intent()
S
61 3 12
KP_Order_Data::get_order_data()
S
61 3 12
KP_Subscription::show_recurring_token()
S
54 2 26
KP_Upsell_Order::get_body()
S
61 3 11
get_klarna_customer()
S
62 3 11
KP_Subscription::set_subscription_order_redirect_urls()
S
53 2 24
WC_Gateway_Klarna_Payments::__construct()
S
46 1 38
WC_Klarna_Payments::include_files()
S
48 1 37
KP_Assets::enqueue_express_button_scripts()
S
55 2 20
customize_php_scoper_config()
S
49 1 34
KP_Form_Fields::get_credential_fields()
S
51 1 34
KP_Requests::__construct()
S
54 2 19
KP_Settings_Page::header_html()
S
57 2 19
KP_Create_Customer_Token::get_body()
S
55 2 19
KP_GDPR::privacy_declarations()
S
59 2 16
KP_Logger::get_caller_string()
S
57 2 16
kp_is_checkout_page()
S
78 3 3
kp_process_accepted()
S
58 2 15
KP_IFrame::__construct()
S
65 3 9
KP_Form_Fields::get_eu_country_fields()
S
63 3 9
KP_Subscription::order_has_subscription()
S
69 3 6
KP_Klarna_Express_Checkout::maybe_add_pay_button_support()
S
68 3 7
WC_Klarna_Payments::get_setting_link()
S
70 3 5
KP_Api::get_session()
S
61 2 13
WC_Gateway_Klarna_Payments::admin_options()
S
61 2 13
KlarnaPayments\Blocks\Payments\KlarnaPayments::enqueue_style()
S
63 2 12
KP_Assets::enqueue_express_button_styles()
S
63 2 12
KP_Checkout::add_token_fragment()
S
62 2 12
kp_get_locale()
S
63 2 11
WC_Gateway_Klarna_Payments::upsell()
S
62 2 11
KP_Create_HPP::get_body()
S
54 1 22
KP_Test_Credentials::get_body()
S
57 1 17
KP_Logger::format_log()
S
58 1 16
KP_Checkout::html_client_token()
S
67 2 9
KP_Session::get_klarna_client_token()
S
79 2 3
WC_Klarna_Payments::filter_payment_method_id()
S
70 2 6
WC_Klarna_Payments::register_payment_block()
S
71 2 6
KP_Session::session_needs_update()
S
68 2 7
WC_Gateway_Klarna_Payments::address_notice()
S
74 2 5
KP_Session::clear_session_data_in_wc()
S
68 2 8
KP_Logger::log_to_db()
S
63 2 10
KP_Logger::format_data()
S
68 2 7
KP_Subscription::save_recurring_token()
S
64 2 9
kp_unset_session_values()
S
72 2 6
KP_Klarna_Express_Checkout::add_to_useragent()
S
70 2 6
KP_Session::update_session_data_in_wc()
S
67 2 8
KP_Session::get_klarna_payment_method_categories()
S
79 2 3
KP_Session::get_klarna_session_id()
S
79 2 3
KP_Order_Data::__construct()
S
66 2 8
KP_Requests::maybe_allow_product_urls()
S
70 2 6
KP_IFrame::add_hash_to_color()
S
68 2 7
KP_Requests::get_base_url()
S
64 2 8
KP_Settings_Saved::maybe_handle_error()
S
69 2 7
KP_Create_Recurring::get_body()
S
58 1 15
KP_Order_Data::remove_null()
S
77 2 3
WC_Klarna_Payments::get_instance()
S
71 2 6
WC_Klarna_Payments::declare_wc_compatibility()
S
71 2 5
KP_Callbacks::authorization_cb()
S
67 2 7
WC_Klarna_Payments::admin_notices()
S
67 2 7
kp_is_wc_blocks_order()
S
80 2 3
KP_Order_Data::maybe_allow_order_line_url()
S
68 2 7
KP_Subscription::get_parent_order()
S
67 2 8
KP_Logger::get_stack()
S
65 2 9
KP_IFrame::get_color_option()
S
71 2 6
KP_Session::get_session_cart_hash()
S
60 1 14
KP_Subscription::__construct()
S
58 1 14
KP_Logger::process_debug_line()
S
59 1 14
KP_Api::place_order()
S
61 1 13
KP_Requests_Post::get_request_args()
S
61 1 13
KP_Requests_Patch::get_request_args()
S
61 1 13
KP_Settings_Page::text_info_html()
S
64 1 12
KP_Api::update_session()
S
62 1 12
KP_Klarna_Express_Checkout::get_payload()
S
62 1 12
KP_Settings_Page::__construct()
S
61 1 11
KP_Api::create_customer_token()
S
63 1 11
KP_Requests_Get::get_request_args()
S
63 1 11
KP_Api::create_hpp()
S
63 1 11
KP_Api::upsell_klarna_order()
S
63 1 11
KP_Api::create_session()
S
63 1 11
KP_Api::create_recurring_order()
S
63 1 11
kp_process_pending()
S
62 1 11
KP_IFrame::get_kp_settings()
S
82 1 3
KP_Email::__construct()
S
78 1 3
WC_Klarna_Payments::__construct()
S
62 1 10
KP_Get_Order::__construct()
S
68 1 7
KP_Settings_Page::credentials()
S
74 1 5
kp_is_available()
S
76 1 4
KP_Subscription::is_change_payment_method()
S
79 1 3
KP_Requests_Patch::__construct()
S
76 1 4
KP_Update_Session::__construct()
S
68 1 7
WC_Gateway_Klarna_Payments::init_form_fields()
S
80 1 3
KP_Status::add_status_page_box()
S
80 1 3
KP_Cancel_Recurring::__construct()
S
69 1 6
WC_Gateway_Klarna_Payments::process_refund()
S
78 1 3
kp_is_order_pay_page()
S
81 1 3
KP_Requests_Post::__construct()
S
76 1 4
KP_Klarna_Express_Checkout::is_enabled()
S
81 1 3
KlarnaPayments\Blocks\Payments\KlarnaPayments::is_active()
S
78 1 3
KP_Place_Order::get_body()
S
66 1 8
KP_Create_Customer_Token::__construct()
S
69 1 6
KP_Create_Recurring::__construct()
S
69 1 6
KP_Session::__construct()
S
78 1 3
KP_Api::cancel_recurring_order()
S
65 1 10
KlarnaPayments\Blocks\Payments\KlarnaPayments::get_payment_method_script_handles()
S
66 1 8
KP_Session::get_klarna_session_data()
S
82 1 3
KP_Settings_Page::text_info()
S
74 1 5
kp_is_checkout_blocks_page()
S
73 1 5
WC_Klarna_Payments::__clone()
S
91 1 2
kp_extract_error_message()
S
69 1 6
WC_Klarna_Payments::wc_unavailable_warning()
S
69 1 9
add_kp_gateway()
S
77 1 4
KP_Callbacks::__construct()
S
71 1 5
KP_Place_Order::__construct()
S
67 1 7
KP_Create_HPP::__construct()
S
70 1 6
KP_Requests_Patch::get_body()
S
100 1 0
KlarnaPayments\Blocks\Payments\KlarnaPayments::get_payment_method_data()
S
68 1 7
KP_GDPR::__construct()
S
79 1 3
WC_Klarna_Payments::__wakeup()
S
91 1 2
WC_Gateway_Klarna_Payments::settings_page_content()
S
73 1 5
KP_Upsell_Order::__construct()
S
68 1 7
KP_Test_Credentials::__construct()
S
70 1 6
KP_Settings_Page::section_end()
S
74 1 5
KP_AJAX::init()
S
80 1 3
KP_Settings_Saved::__construct()
S
78 1 3
KP_Requests_Get::__construct()
S
76 1 4
KP_Requests::calculate_auth()
S
76 1 3
KP_Session::get_klarna_session_country()
S
79 1 3
WC_Gateway_Klarna_Payments::notification_listener()
S
81 1 3
KP_WC()
S
82 1 3
KP_Assets::__construct()
S
66 1 8
KP_Api::get_klarna_om_order()
S
65 1 10
WC_Gateway_Klarna_Payments::process_subscription()
S
80 1 3
KP_IFrame::has_value()
S
80 1 3
KP_Requests_Post::get_body()
S
64 1 9
KP_Create_Session::__construct()
S
70 1 6
kp_process_rejected()
S
64 1 10
KP_Test_Credentials::set_credentials()
S
76 1 4
KP_Klarna_Express_Checkout::get_order_data_helper()
S
70 1 6
KP_Status::__construct()
S
79 1 3
KP_IFrame::get_kp_color_options()
S
82 1 3
WC_Gateway_Klarna_Payments::payment_fields()
S
78 1 3
KP_Session::get_session_order_hash()
S
68 1 7
KP_Checkout::__construct()
S
72 1 5
KP_Get_Session::__construct()
S
68 1 7
KP_Settings_Page::section_start()
S
74 1 5
KP_Subscription::extend_allowed_domains_list()
S
74 1 5
KlarnaPayments\Blocks\Payments\KlarnaPayments::initialize()
S
79 1 3
KP_Cancel_Recurring::get_body()
S
74 1 5
KP_Klarna_Express_Checkout::__construct()
S
69 1 6
WC_Klarna_Payments::plugin_action_links()
S
63 1 10
KlarnaPayments\Blocks\Payments\KlarnaPayments::register()
S
67 1 9