Repository Analysis

StevenBlack/hosts

🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.

1.5 Likely human-written View on GitHub
1.5
Adjusted Score
1.5
Raw Score
100%
Time Factor
2026-05-28
Last Push
30,457
Stars
Python
Language
29,463
Lines of Code
123
Files
43
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 0MEDIUM 3LOW 40

Pattern Findings

43 matches across 5 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers30 hits · 28 pts
SeverityFileLineSnippet
LOWtestUpdateHostsFile.py1621 def test_multiple_space_as_separator(self):
LOWtestUpdateHostsFile.py1631 def test_multiple_tabs_as_separator(self):
LOWtestUpdateHostsFile.py1641 def test_line_with_comment_at_the_end(self):
LOWtestUpdateHostsFile.py221 def test_no_freshen_no_new_file(self):
LOWtestUpdateHostsFile.py267 def test_no_freshen_fail_new_file(self, mock_open):
LOWtestUpdateHostsFile.py512 def test_only_common_exclusions(self, mock_gather, mock_exclude, _):
LOWtestUpdateHostsFile.py534 def test_mixture_gatherexclusions(self, mock_gather, mock_exclude, _):
LOWtestUpdateHostsFile.py573 def test_invalid_exclude_domain(self):
LOWtestUpdateHostsFile.py584 def test_valid_exclude_domain(self):
LOWtestUpdateHostsFile.py721 def test_update_only_extensions(self, mock_join_robust, *_):
LOWtestUpdateHostsFile.py745 def test_update_both_pathways(self, mock_join_robust, *_):
LOWtestUpdateHostsFile.py815 def test_sources_fail_succeed(self, mock_get, mock_write, *_):
LOWtestUpdateHostsFile.py1006 def test_strip_raw_with_comment(self):
LOWtestUpdateHostsFile.py1066 def test_basic_include_static_hosts(self):
LOWtestUpdateHostsFile.py1093 def test_basic_include_static_hosts_linux(self):
LOWtestUpdateHostsFile.py1334 def test_set_no_unified_hosts(self):
LOWtestUpdateHostsFile.py1402 def test_move_hosts_posix_fail(self, *_):
LOWtestUpdateHostsFile.py1501 def test_flush_posix_fail_then_succeed(self, *_):
LOWtestUpdateHostsFile.py1538 def test_remove_hosts_file_exists(self):
LOWtestUpdateHostsFile.py1554 def test_remove_hosts_file_backup(self, _):
LOWtestUpdateHostsFile.py1742 def test_connect_unknown_domain(self):
LOWtestUpdateHostsFile.py2088 def test_print_success_no_support(self, _):
LOWtestUpdateHostsFile.py2097 def test_print_success_support(self, _):
LOWtestUpdateHostsFile.py2112 def test_print_failure_no_support(self, _):
LOWtestUpdateHostsFile.py2121 def test_print_failure_support(self, _):
LOWupdateHostsFile.py433def prompt_for_flush_dns_cache(flushcache, promptflush):
LOWupdateHostsFile.py524def display_exclusion_options(commonexclusions, exclusionpattern, exclusionregexes):
LOWupdateHostsFile.py1406def move_hosts_file_into_place(finalfile):
LOWupdateHostsFile.py1802def is_valid_user_provided_domain_format(domain):
LOWmakeHosts.py56def recursively_loop_extensions(extension, extensions, current_extensions):
Excessive Try-Catch Wrapping6 hits · 6 pts
SeverityFileLineSnippet
LOWupdateHostsFile.py792 except Exception:
MEDIUMupdateHostsFile.py793 print("Error in updating source: ", updateurl)
LOWupdateHostsFile.py963 except Exception as e:
LOWupdateHostsFile.py1428 except Exception:
LOWupdateHostsFile.py1449 except Exception:
MEDIUMupdateHostsFile.py1721 print("Error retrieving data from {}".format(url))
Deep Nesting5 hits · 5 pts
SeverityFileLineSnippet
LOWupdateReadme.py20
LOWupdateHostsFile.py919
LOWupdateHostsFile.py1406
LOWupdateHostsFile.py1468
LOWupdateHostsFile.py1596
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMupdateHostsFile.py374 # Create a hosts file if it doesn't exist.
Unused Imports1 hit · 1 pts
SeverityFileLineSnippet
LOWmakeHosts.py8