diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/maint/practracker/exceptions.txt | 43 | ||||
-rwxr-xr-x | scripts/maint/practracker/practracker.py | 9 | ||||
-rw-r--r-- | scripts/maint/practracker/util.py | 3 |
3 files changed, 32 insertions, 23 deletions
diff --git a/scripts/maint/practracker/exceptions.txt b/scripts/maint/practracker/exceptions.txt index fee22ec7fc..baccbef255 100644 --- a/scripts/maint/practracker/exceptions.txt +++ b/scripts/maint/practracker/exceptions.txt @@ -59,13 +59,13 @@ problem function-size /src/core/or/relay.c:connection_edge_process_relay_cell_no problem function-size /src/core/or/relay.c:connection_edge_process_relay_cell() 520 problem function-size /src/core/or/relay.c:connection_edge_package_raw_inbuf() 130 problem function-size /src/core/or/relay.c:circuit_resume_edge_reading_helper() 148 -problem file-size /src/core/mainloop/mainloop.c 3050 -problem include-count /src/core/mainloop/mainloop.c 65 +problem file-size /src/core/mainloop/mainloop.c 3051 +problem include-count /src/core/mainloop/mainloop.c 66 problem function-size /src/core/mainloop/mainloop.c:conn_close_if_marked() 108 problem function-size /src/core/mainloop/mainloop.c:run_connection_housekeeping() 123 problem function-size /src/core/mainloop/mainloop.c:CALLBACK() 116 -problem file-size /src/core/mainloop/connection.c 5547 -problem include-count /src/core/mainloop/connection.c 60 +problem file-size /src/core/mainloop/connection.c 5548 +problem include-count /src/core/mainloop/connection.c 61 problem function-size /src/core/mainloop/connection.c:connection_free_minimal() 184 problem function-size /src/core/mainloop/connection.c:connection_listener_new() 328 problem function-size /src/core/mainloop/connection.c:connection_handle_listener_read() 161 @@ -79,8 +79,8 @@ problem function-size /src/core/mainloop/connection.c:connection_handle_write_im problem function-size /src/core/mainloop/connection.c:assert_connection_ok() 143 problem function-size /src/app/config/confparse.c:config_assign_value() 205 problem function-size /src/app/config/confparse.c:config_get_assigned_option() 129 -problem file-size /src/app/config/config.c 8488 -problem include-count /src/app/config/config.c 84 +problem file-size /src/app/config/config.c 8490 +problem include-count /src/app/config/config.c 86 problem function-size /src/app/config/config.c:options_act_reversible() 296 problem function-size /src/app/config/config.c:options_act() 588 problem function-size /src/app/config/config.c:resolve_my_address() 192 @@ -96,7 +96,7 @@ problem function-size /src/app/config/config.c:parse_port_config() 452 problem function-size /src/app/config/config.c:parse_ports() 170 problem function-size /src/app/config/config.c:getinfo_helper_config() 116 problem function-size /src/app/main/ntmain.c:nt_service_install() 125 -problem include-count /src/app/main/main.c 83 +problem include-count /src/app/main/main.c 85 problem function-size /src/app/main/main.c:dumpstats() 102 problem function-size /src/app/main/main.c:tor_init() 136 problem function-size /src/app/main/main.c:sandbox_init_filter() 291 @@ -109,20 +109,20 @@ problem function-size /src/tools/tor-gencert.c:parse_commandline() 111 problem function-size /src/feature/keymgt/loadkey.c:ed_key_init_from_file() 333 problem function-size /src/feature/dircommon/consdiff.c:gen_ed_diff() 204 problem function-size /src/feature/dircommon/consdiff.c:apply_ed_diff() 159 -problem file-size /src/feature/control/control.c 7592 -problem include-count /src/feature/control/control.c 83 -problem function-size /src/feature/control/control.c:handle_control_authenticate() 188 -problem function-size /src/feature/control/control.c:getinfo_helper_misc() 109 -problem function-size /src/feature/control/control.c:getinfo_helper_dir() 304 -problem function-size /src/feature/control/control.c:getinfo_helper_events() 236 -problem function-size /src/feature/control/control.c:handle_control_extendcircuit() 151 -problem function-size /src/feature/control/control.c:handle_control_authchallenge() 115 -problem function-size /src/feature/control/control.c:handle_control_hsfetch() 114 -problem function-size /src/feature/control/control.c:handle_control_hspost() 117 -problem function-size /src/feature/control/control.c:handle_control_add_onion() 293 -problem function-size /src/feature/control/control.c:add_onion_helper_keyarg() 125 +problem function-size /src/feature/control/control_auth.c:handle_control_authenticate() 188 +problem function-size /src/feature/control/control_auth.c:handle_control_authchallenge() 115 +problem function-size /src/feature/control/control_getinfo.c:getinfo_helper_misc() 109 +problem function-size /src/feature/control/control_getinfo.c:getinfo_helper_dir() 304 +problem function-size /src/feature/control/control_getinfo.c:getinfo_helper_events() 236 +problem function-size /src/feature/control/control_cmd.c:handle_control_command() 104 +problem function-size /src/feature/control/control_cmd.c:handle_control_extendcircuit() 151 +problem function-size /src/feature/control/control_cmd.c:handle_control_hsfetch() 114 +problem function-size /src/feature/control/control_cmd.c:handle_control_hspost() 117 +problem function-size /src/feature/control/control_cmd.c:handle_control_add_onion() 293 +problem function-size /src/feature/control/control_cmd.c:add_onion_helper_keyarg() 125 problem function-size /src/feature/control/control.c:connection_control_process_inbuf() 239 -problem function-size /src/feature/control/control.c:control_event_stream_status() 119 +problem function-size /src/feature/control/control_events.c:control_event_stream_status() 119 +problem include-count /src/feature/control/control_getinfo.c 52 problem function-size /src/feature/stats/rephist.c:rep_hist_load_mtbf_data() 185 problem function-size /src/feature/stats/rephist.c:rep_hist_format_exit_stats() 148 problem function-size /src/feature/dircache/consdiffmgr.c:consdiffmgr_cleanup() 115 @@ -132,11 +132,12 @@ problem function-size /src/feature/dircache/dircache.c:handle_get_current_consen problem function-size /src/feature/dircache/dircache.c:directory_handle_command_post() 120 problem function-size /src/feature/hibernate/hibernate.c:accounting_parse_options() 109 problem function-size /src/feature/relay/routerkeys.c:load_ed_keys() 294 -problem file-size /src/feature/relay/router.c 3221 +problem file-size /src/feature/relay/router.c 3412 problem include-count /src/feature/relay/router.c 56 problem function-size /src/feature/relay/router.c:init_keys() 252 problem function-size /src/feature/relay/router.c:get_my_declared_family() 114 problem function-size /src/feature/relay/router.c:router_build_fresh_descriptor() 190 +problem function-size /src/feature/relay/router.c:router_build_fresh_unsigned_routerinfo() 140 problem function-size /src/feature/relay/router.c:router_dump_router_to_string() 375 problem function-size /src/feature/relay/router.c:extrainfo_dump_to_string() 208 problem function-size /src/feature/relay/dns.c:dns_resolve_impl() 134 diff --git a/scripts/maint/practracker/practracker.py b/scripts/maint/practracker/practracker.py index c2efa61f2c..22cb46c749 100755 --- a/scripts/maint/practracker/practracker.py +++ b/scripts/maint/practracker/practracker.py @@ -46,6 +46,13 @@ TOR_TOPDIR = None ####################################################### +if sys.version_info[0] <= 2: + def open_file(fname): + return open(fname, 'r') +else: + def open_file(fname): + return open(fname, 'r', encoding='utf-8') + def consider_file_size(fname, f): """Consider file size issues for 'f' and return True if a new issue was found""" file_size = metrics.get_file_len(f) @@ -85,7 +92,7 @@ def consider_all_metrics(files_list): """Consider metrics for all files, and return True if new issues were found""" found_new_issues = False for fname in files_list: - with open(fname, 'r') as f: + with open_file(fname) as f: found_new_issues |= consider_metrics_for_file(fname, f) return found_new_issues diff --git a/scripts/maint/practracker/util.py b/scripts/maint/practracker/util.py index 63de72d5a3..b0ca73b997 100644 --- a/scripts/maint/practracker/util.py +++ b/scripts/maint/practracker/util.py @@ -11,6 +11,8 @@ def get_tor_c_files(tor_topdir): files_list = [] for root, directories, filenames in os.walk(tor_topdir): + directories.sort() + filenames.sort() for filename in filenames: # We only care about .c files if not filename.endswith(".c"): @@ -24,4 +26,3 @@ def get_tor_c_files(tor_topdir): files_list.append(full_path) return files_list - |