Coding Insights to Reduce Future Technical Debt
Program Summary of DELIVER_handler.spsrc
(Compiled On: 2025-03-17 at 08:05:55)
Summary Notes
Most Complex Routine: do_main_logic --
Complexity: 53)
Suggestions:
- Reduce nesting in complex routines.
- Replace literals with named constants where reasonable.
- Modularize large routines for better readability.
Routine: do_main_logic
Filename: DELIVER_handler.spsrc
Line#: 109
Metric | Value | Status |
Complexity |
53 | moderate |
Lines of Code (Adjusted) |
130 | critical |
Literals |
99 | critical |
Suggestions | Simplify logic and decompose into smaller local routines. |
Routine: do_signup
Filename: DELIVER_handler.spsrc
Line#: 774
Metric | Value | Status |
Complexity |
35 | moderate |
Lines of Code (Adjusted) |
69 | moderate |
Literals |
67 | critical |
Suggestions | Simplify logic and decompose into smaller local routines. |
Filename: DELIVER_handler.spsrc
Line#: 670
Metric | Value | Status |
Complexity |
24 | good |
Lines of Code (Adjusted) |
54 | moderate |
Literals |
55 | critical |
Suggestions | Simplify logic and decompose into smaller local routines. |
Routine: display_one_product
Filename: DELIVER_handler.spsrc
Line#: 1747
Metric | Value | Status |
Complexity |
21 | good |
Lines of Code (Adjusted) |
29 | good |
Literals |
59 | critical |
Suggestions | Simplify logic and decompose into smaller local routines. |
Routine: ajax_validate_user
Filename: ajax_routines.spinc
Line#: 84
Metric | Value | Status |
Complexity |
18 | good |
Lines of Code (Adjusted) |
19 | good |
Literals |
18 | moderate |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_gift_selection
Filename: hx-routines.spinc
Line#: 65
Metric | Value | Status |
Complexity |
15 | good |
Lines of Code (Adjusted) |
38 | moderate |
Literals |
31 | critical |
Suggestions | Where possible, replace literals with named constants. |
Routine: do_genlink
Filename: DELIVER_handler.spsrc
Line#: 927
Metric | Value | Status |
Complexity |
14 | good |
Lines of Code (Adjusted) |
17 | good |
Literals |
21 | moderate |
Suggestions | Where possible, replace literals with named constants. |
Routine: do_reset_one_password
Filename: DELIVER_handler.spsrc
Line#: 1030
Metric | Value | Status |
Complexity |
12 | good |
Lines of Code (Adjusted) |
24 | good |
Literals |
22 | moderate |
Suggestions | Where possible, replace literals with named constants. |
Routine: handle_ajax_request
Filename: ajax_routines.spinc
Line#: 21
Metric | Value | Status |
Complexity |
11 | good |
Lines of Code (Adjusted) |
16 | good |
Literals |
14 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: find_subvalue
Filename: DELIVER_handler.spsrc
Line#: 1263
Metric | Value | Status |
Complexity |
11 | good |
Lines of Code (Adjusted) |
125 | critical |
Literals |
74 | critical |
Suggestions | Where possible, replace literals with named constants. |
Routine: handle_login
Filename: handler_routines.spinc
Line#: 347
Metric | Value | Status |
Complexity |
9 | good |
Lines of Code (Adjusted) |
56 | moderate |
Literals |
58 | critical |
Suggestions | Where possible, replace literals with named constants. |
Routine: do_registry_products
Filename: DELIVER_handler.spsrc
Line#: 1611
Metric | Value | Status |
Complexity |
9 | good |
Lines of Code (Adjusted) |
35 | moderate |
Literals |
15 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: handle_pw_recovery
Filename: DELIVER_handler.spsrc
Line#: 606
Metric | Value | Status |
Complexity |
9 | good |
Lines of Code (Adjusted) |
28 | good |
Literals |
18 | moderate |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: generate_status_html
Filename: DELIVER_handler.spsrc
Line#: 2665
Metric | Value | Status |
Complexity |
8 | good |
Lines of Code (Adjusted) |
22 | good |
Literals |
15 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: process_webpage_template
Filename: handler_routines.spinc
Line#: 693
Metric | Value | Status |
Complexity |
6 | good |
Lines of Code (Adjusted) |
21 | good |
Literals |
11 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: store_session_record
Filename: handler_routines.spinc
Line#: 473
Metric | Value | Status |
Complexity |
6 | good |
Lines of Code (Adjusted) |
21 | good |
Literals |
12 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: make_spoken_time
Filename: DELIVER_handler.spsrc
Line#: 2275
Metric | Value | Status |
Complexity |
6 | good |
Lines of Code (Adjusted) |
15 | good |
Literals |
17 | moderate |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: setup_product
Filename: common.spinc
Line#: 26
Metric | Value | Status |
Complexity |
6 | good |
Lines of Code (Adjusted) |
10 | good |
Literals |
6 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: check_timeout
Filename: handler_routines.spinc
Line#: 276
Metric | Value | Status |
Complexity |
6 | good |
Lines of Code (Adjusted) |
13 | good |
Literals |
4 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: check_new_code
Filename: DELIVER_handler.spsrc
Line#: 1217
Metric | Value | Status |
Complexity |
5 | good |
Lines of Code (Adjusted) |
18 | good |
Literals |
7 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_hx
Filename: hx-routines.spinc
Line#: 24
Metric | Value | Status |
Complexity |
5 | good |
Lines of Code (Adjusted) |
7 | good |
Literals |
3 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: make_friendly_datetime
Filename: DELIVER_handler.spsrc
Line#: 2221
Metric | Value | Status |
Complexity |
5 | good |
Lines of Code (Adjusted) |
20 | good |
Literals |
22 | moderate |
Suggestions | Where possible, replace literals with named constants. |
Routine: output_webpage
Filename: handler_routines.spinc
Line#: 658
Metric | Value | Status |
Complexity |
3 | good |
Lines of Code (Adjusted) |
11 | good |
Literals |
4 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_heartbeat
Filename: DELIVER_handler.spsrc
Line#: 2500
Metric | Value | Status |
Complexity |
3 | good |
Lines of Code (Adjusted) |
50 | moderate |
Literals |
22 | moderate |
Suggestions | Where possible, replace literals with named constants. |
Routine: check_safename
Filename: DELIVER_handler.spsrc
Line#: 2376
Metric | Value | Status |
Complexity |
3 | good |
Lines of Code (Adjusted) |
8 | good |
Literals |
2 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: load_product_data
Filename: DELIVER_handler.spsrc
Line#: 2409
Metric | Value | Status |
Complexity |
3 | good |
Lines of Code (Adjusted) |
28 | good |
Literals |
14 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: init_handler
Filename: handler_routines.spinc
Line#: 36
Metric | Value | Status |
Complexity |
3 | good |
Lines of Code (Adjusted) |
42 | moderate |
Literals |
21 | moderate |
Suggestions | Where possible, replace literals with named constants. |
Routine: do_process_rec_safename
Filename: DELIVER_handler.spsrc
Line#: 530
Metric | Value | Status |
Complexity |
3 | good |
Lines of Code (Adjusted) |
21 | good |
Literals |
12 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: check_for_shutdown
Filename: DELIVER_handler.spsrc
Line#: 577
Metric | Value | Status |
Complexity |
3 | good |
Lines of Code (Adjusted) |
3 | good |
Literals |
5 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_heartbeat_update
Filename: DELIVER_handler.spsrc
Line#: 2575
Metric | Value | Status |
Complexity |
3 | good |
Lines of Code (Adjusted) |
29 | good |
Literals |
16 | moderate |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: validate_cookie_contents
Filename: handler_routines.spinc
Line#: 234
Metric | Value | Status |
Complexity |
3 | good |
Lines of Code (Adjusted) |
16 | good |
Literals |
7 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: output_pw_reset_page
Filename: DELIVER_handler.spsrc
Line#: 990
Metric | Value | Status |
Complexity |
3 | good |
Lines of Code (Adjusted) |
10 | good |
Literals |
6 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: get_window_updates
Filename: DELIVER_handler.spsrc
Line#: 2464
Metric | Value | Status |
Complexity |
3 | good |
Lines of Code (Adjusted) |
8 | good |
Literals |
4 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: display_login_webpage
Filename: handler_routines.spinc
Line#: 313
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
4 | good |
Literals |
1 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: get_env_variables
Filename: handler_routines.spinc
Line#: 441
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
7 | good |
Literals |
4 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: send_signup_email
Filename: DELIVER_handler.spsrc
Line#: 1098
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
13 | good |
Literals |
5 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: write_user_audit
Filename: DELIVER_handler.spsrc
Line#: 1137
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
16 | good |
Literals |
12 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_confirmation
Filename: DELIVER_handler.spsrc
Line#: 499
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
9 | good |
Literals |
8 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_update_preferences
Filename: DELIVER_handler.spsrc
Line#: 442
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
31 | moderate |
Literals |
12 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: parse_cookie
Filename: handler_routines.spinc
Line#: 192
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
12 | good |
Literals |
11 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_maybe_allow_address_updates
Filename: DELIVER_handler.spsrc
Line#: 1419
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
32 | moderate |
Literals |
25 | moderate |
Suggestions | Where possible, replace literals with named constants. |
Routine: do_maybe_preferences
Filename: DELIVER_handler.spsrc
Line#: 1472
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
89 | moderate |
Literals |
101 | critical |
Suggestions | Where possible, replace literals with named constants. |
Routine: do_featured_products
Filename: DELIVER_handler.spsrc
Line#: 1583
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
5 | good |
Literals |
1 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: validate_cookie
Filename: handler_routines.spinc
Line#: 159
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
5 | good |
Literals |
0 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_recent_products
Filename: DELIVER_handler.spsrc
Line#: 1683
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
4 | good |
Literals |
1 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_products
Filename: DELIVER_handler.spsrc
Line#: 1708
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
17 | good |
Literals |
2 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: check_login
Filename: handler_routines.spinc
Line#: 108
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
29 | good |
Literals |
9 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_checkout_products
Filename: DELIVER_handler.spsrc
Line#: 1828
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
103 | critical |
Literals |
88 | critical |
Suggestions | Where possible, replace literals with named constants. |
Routine: do_confirmed_products
Filename: DELIVER_handler.spsrc
Line#: 1952
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
103 | critical |
Literals |
88 | critical |
Suggestions | Where possible, replace literals with named constants. |
Routine: generate_pw_reset_link
Filename: DELIVER_handler.spsrc
Line#: 2079
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
9 | good |
Literals |
5 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: write_genlink
Filename: DELIVER_handler.spsrc
Line#: 2180
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
18 | good |
Literals |
12 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_update_address
Filename: DELIVER_handler.spsrc
Line#: 383
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
38 | moderate |
Literals |
24 | moderate |
Suggestions | Where possible, replace literals with named constants. |
Routine: store_session_cookie
Filename: handler_routines.spinc
Line#: 524
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
39 | moderate |
Literals |
22 | moderate |
Suggestions | Where possible, replace literals with named constants. |
Routine: send_email
Filename: DELIVER_handler.spsrc
Line#: 2329
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
26 | good |
Literals |
11 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Filename: handler_routines.spinc
Line#: 586
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
9 | good |
Literals |
4 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Filename: ajax_routines.spinc
Line#: 149
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
4 | good |
Literals |
3 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: write_cgi_content_type
Filename: handler_routines.spinc
Line#: 622
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
16 | good |
Literals |
13 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: handle_error
Filename: handler_routines.spinc
Line#: 800
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
24 | good |
Literals |
19 | moderate |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: do_substitutions
Filename: handler_routines.spinc
Line#: 752
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
24 | good |
Literals |
17 | moderate |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: append_selected_list
Filename: DELIVER_handler.spsrc
Line#: 2630
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
11 | good |
Literals |
3 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Routine: write_error
Filename: DELIVER_handler.spsrc
Line#: 1177
Metric | Value | Status |
Complexity |
0 | good |
Lines of Code (Adjusted) |
11 | good |
Literals |
7 | good |
Suggestions | Routine is well-optimized. No changes needed. |
Top Significant Include Files
Name |
`@ajax_routines.spinc`
|
`@common.spinc`
|
`@handler_routines.spinc`
|
`@hx-routines.spinc`
|
Top Significant Unused Variables
Name |
utc_offset_secs |
do_heartbeat$init_done? |
log_msg$ |
make_friendly_datetime$friendly |
Top Significant Unused Routines
Name |
do_maybe_allow_address_updates |
make_friendly_datetime |
do_confirmed_products |
do_checkout_products |
do_featured_products |
do_maybe_preferences |
do_recent_products |
Top Significant Tables
Name |
cgi_content_type |
receiver_login |
daemon_work |
error_audit |
user_audit |
user_login |
productdb |
genlink |
session |
trans |
Top Significant Clusters
Top Significant Arrays
Top Significant Pass Statements
Name |
noreturn: this_program$
|
Top Significant Library Statements
Top Significant External Calls